1.1 --- a/WebStack/Generic.py Fri Mar 26 18:59:55 2004 +0000
1.2 +++ b/WebStack/Generic.py Sun Apr 18 23:39:08 2004 +0000
1.3 @@ -246,6 +246,17 @@
1.4
1.5 raise NotImplementedError, "get_user"
1.6
1.7 + def get_cookies(self):
1.8 +
1.9 + """
1.10 + A framework-specific method which obtains cookie information from the
1.11 + request.
1.12 +
1.13 + Returns a dictionary mapping cookie names to cookie objects.
1.14 + """
1.15 +
1.16 + raise NotImplementedError, "get_cookies"
1.17 +
1.18 # Response-related methods.
1.19
1.20 def get_response_stream(self):
1.21 @@ -292,6 +303,40 @@
1.22
1.23 raise NotImplementedError, "set_content_type"
1.24
1.25 + # Higher level response-related methods.
1.26 +
1.27 + def set_cookie(self, cookie):
1.28 +
1.29 + """
1.30 + A framework-specific method which stores the given 'cookie' object in
1.31 + the response.
1.32 + """
1.33 +
1.34 + raise NotImplementedError, "set_cookie"
1.35 +
1.36 + def set_cookie_value(self, name, value, path=None, expires=None):
1.37 +
1.38 + """
1.39 + A framework-specific method which stores a cookie with the given 'name'
1.40 + and 'value' in the response.
1.41 +
1.42 + The optional 'path' is a string which specifies the scope of the cookie,
1.43 + and the optional 'expires' parameter is a value compatible with the
1.44 + time.time function, and indicates the expiry date/time of the cookie.
1.45 + """
1.46 +
1.47 + raise NotImplementedError, "set_cookie_value"
1.48 +
1.49 + def delete_cookie(self, cookie_name):
1.50 +
1.51 + """
1.52 + A framework-specific method which adds to the response a request that
1.53 + the cookie with the given 'cookie_name' be deleted/discarded by the
1.54 + client.
1.55 + """
1.56 +
1.57 + raise NotImplementedError, "delete_cookie"
1.58 +
1.59 class Resource:
1.60
1.61 "A generic resource interface."