1.1 --- a/WebStack/Generic.py Wed Aug 24 23:42:32 2005 +0000
1.2 +++ b/WebStack/Generic.py Thu Aug 25 13:29:40 2005 +0000
1.3 @@ -640,26 +640,34 @@
1.4
1.5 self.path_info = path_info
1.6
1.7 - def get_virtual_path_info(self):
1.8 + def get_virtual_path_info(self, encoding=None):
1.9
1.10 """
1.11 An application-specific method which either returns path info set in the
1.12 'set_virtual_path_info' method, or the normal path info found in the
1.13 request.
1.14 +
1.15 + If the optional 'encoding' is set, use that in preference to the default
1.16 + encoding to convert the path into a form not containing "URL encoded"
1.17 + character values.
1.18 """
1.19
1.20 if self.path_info is not None:
1.21 return self.path_info
1.22 else:
1.23 - return self.get_path_info()
1.24 + return self.get_path_info(encoding)
1.25
1.26 - def get_processed_virtual_path_info(self):
1.27 + def get_processed_virtual_path_info(self, encoding=None):
1.28
1.29 """
1.30 An application-specific method which returns the virtual path info that
1.31 is considered "processed"; that is, the part of the path info which is
1.32 not included in the virtual path info.
1.33
1.34 + If the optional 'encoding' is set, use that in preference to the default
1.35 + encoding to convert the path into a form not containing "URL encoded"
1.36 + character values.
1.37 +
1.38 Where the virtual path info is identical to the path info, an empty
1.39 string is returned.
1.40
1.41 @@ -670,8 +678,8 @@
1.42 of the path info, the entire path info is returned.
1.43 """
1.44
1.45 - real_path_info = self.get_path_info()
1.46 - virtual_path_info = self.get_virtual_path_info()
1.47 + real_path_info = self.get_path_info(encoding)
1.48 + virtual_path_info = self.get_virtual_path_info(encoding)
1.49
1.50 if virtual_path_info == "":
1.51 return real_path_info