1.1 --- a/README.txt Fri Aug 19 13:27:38 2005 +0000
1.2 +++ b/README.txt Fri Aug 19 20:20:58 2005 +0000
1.3 @@ -66,6 +66,8 @@
1.4 different suggestion from Scott Robinson).
1.5 Changed the ResourceMap.MapResource class to provide the empty string as the
1.6 resource name where the virtual path info is only one component in length.
1.7 +Added a convenience method to Transaction for the decoding of path values and
1.8 +the production of Unicode objects - see the get_readable_path method.
1.9
1.10 New in WebStack 0.10 (Changes since WebStack 0.9)
1.11 -------------------------------------------------
2.1 --- a/WebStack/Generic.py Fri Aug 19 13:27:38 2005 +0000
2.2 +++ b/WebStack/Generic.py Fri Aug 19 20:20:58 2005 +0000
2.3 @@ -255,6 +255,21 @@
2.4 else:
2.5 return [value]
2.6
2.7 + # Public utility methods.
2.8 +
2.9 + def get_readable_path(self, path, encoding):
2.10 +
2.11 + """
2.12 + From the given 'path', use the given 'encoding' to decode the information and
2.13 + convert it to Unicode. Upon success, return the 'path' as a Unicode value. Upon
2.14 + failure, return None.
2.15 + """
2.16 +
2.17 + try:
2.18 + return urllib.unquote(path).decode(encoding)
2.19 + except UnicodeError:
2.20 + return None
2.21 +
2.22 # Server-related methods.
2.23
2.24 def get_server_name(self):