1.1 --- a/WebStack/BaseHTTPRequestHandler.py Thu Nov 16 23:39:56 2006 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Thu Nov 16 23:40:10 2006 +0000
1.3 @@ -103,6 +103,18 @@
1.4 self.trans.end_headers()
1.5 self.trans.wfile.write(content)
1.6
1.7 + def rollback(self):
1.8 +
1.9 + """
1.10 + A special method, partially synchronising the transaction with
1.11 + framework-specific objects, but discarding previously emitted content
1.12 + that is to be replaced by an error message.
1.13 + """
1.14 +
1.15 + self.content = StringIO()
1.16 + self.headers_out = {}
1.17 + self.cookies_out = SimpleCookie()
1.18 +
1.19 # Server-related methods.
1.20
1.21 def get_server_name(self):
2.1 --- a/WebStack/CGI.py Thu Nov 16 23:39:56 2006 +0000
2.2 +++ b/WebStack/CGI.py Thu Nov 16 23:40:10 2006 +0000
2.3 @@ -100,6 +100,18 @@
2.4 self.content.seek(0)
2.5 self.output.write(self.content.read())
2.6
2.7 + def rollback(self):
2.8 +
2.9 + """
2.10 + A special method, partially synchronising the transaction with
2.11 + framework-specific objects, but discarding previously emitted content
2.12 + that is to be replaced by an error message.
2.13 + """
2.14 +
2.15 + self.content = StringIO()
2.16 + self.headers_out = {}
2.17 + self.cookies_out = SimpleCookie()
2.18 +
2.19 # Server-related methods.
2.20
2.21 def get_server_name(self):
3.1 --- a/WebStack/Django.py Thu Nov 16 23:39:56 2006 +0000
3.2 +++ b/WebStack/Django.py Thu Nov 16 23:40:10 2006 +0000
3.3 @@ -60,6 +60,17 @@
3.4 self.content.seek(0)
3.5 self.response.content = self.content.read()
3.6
3.7 + def rollback(self):
3.8 +
3.9 + """
3.10 + A special method, partially synchronising the transaction with
3.11 + framework-specific objects, but discarding previously emitted content
3.12 + that is to be replaced by an error message.
3.13 + """
3.14 +
3.15 + self.response = HttpResponse()
3.16 + self.content = StringIO()
3.17 +
3.18 # Server-related methods.
3.19
3.20 def get_server_name(self):
4.1 --- a/WebStack/Generic.py Thu Nov 16 23:39:56 2006 +0000
4.2 +++ b/WebStack/Generic.py Thu Nov 16 23:40:10 2006 +0000
4.3 @@ -74,6 +74,16 @@
4.4
4.5 pass
4.6
4.7 + def rollback(self):
4.8 +
4.9 + """
4.10 + A special method, partially synchronising the transaction with
4.11 + framework-specific objects, but discarding previously emitted content
4.12 + that is to be replaced by an error message.
4.13 + """
4.14 +
4.15 + pass
4.16 +
4.17 # Utility methods.
4.18
4.19 def parse_header_value(self, header_class, header_value_str):
5.1 --- a/WebStack/WSGI.py Thu Nov 16 23:39:56 2006 +0000
5.2 +++ b/WebStack/WSGI.py Thu Nov 16 23:40:10 2006 +0000
5.3 @@ -77,6 +77,18 @@
5.4 if self.session_store is not None:
5.5 self.session_store.close()
5.6
5.7 + def rollback(self):
5.8 +
5.9 + """
5.10 + A special method, partially synchronising the transaction with
5.11 + framework-specific objects, but discarding previously emitted content
5.12 + that is to be replaced by an error message.
5.13 + """
5.14 +
5.15 + self.content = StringIO()
5.16 + self.headers_out = {}
5.17 + self.cookies_out = SimpleCookie()
5.18 +
5.19 def get_wsgi_headers(self):
5.20 wsgi_headers = []
5.21