1.1 --- a/WebStack/BaseHTTPRequestHandler.py Sat Feb 19 14:23:47 2005 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Sat Feb 19 15:02:33 2005 +0000
1.3 @@ -179,10 +179,7 @@
1.4 handling the current request) from the request.
1.5 """
1.6
1.7 - if self.path_info is not None:
1.8 - return self.path_info
1.9 - else:
1.10 - return self.get_path_without_query()
1.11 + return self.get_path_without_query()
1.12
1.13 def get_query_string(self):
1.14
2.1 --- a/WebStack/CGI.py Sat Feb 19 14:23:47 2005 +0000
2.2 +++ b/WebStack/CGI.py Sat Feb 19 15:02:33 2005 +0000
2.3 @@ -178,10 +178,7 @@
2.4 handling the current request) from the request.
2.5 """
2.6
2.7 - if self.path_info is not None:
2.8 - return self.path_info
2.9 - else:
2.10 - return self.env.get("PATH_INFO") or ""
2.11 + return self.env.get("PATH_INFO") or ""
2.12
2.13 def get_query_string(self):
2.14
3.1 --- a/WebStack/Generic.py Sat Feb 19 14:23:47 2005 +0000
3.2 +++ b/WebStack/Generic.py Sat Feb 19 15:02:33 2005 +0000
3.3 @@ -531,15 +531,25 @@
3.4
3.5 self.user = username
3.6
3.7 - def set_path_info(self, path_info):
3.8 + def set_virtual_path_info(self, path_info):
3.9
3.10 """
3.11 An application-specific method which sets the 'path_info' in the
3.12 - transaction. This affects subsequent calls to 'get_path_info'.
3.13 + transaction. This affects subsequent calls to 'get_virtual_path_info'.
3.14 """
3.15
3.16 self.path_info = path_info
3.17
3.18 + def get_virtual_path_info(self):
3.19 +
3.20 + """
3.21 + An application-specific method which either returns path info set in the
3.22 + 'set_virtual_path_info' method, or the normal path info found in the
3.23 + request.
3.24 + """
3.25 +
3.26 + return self.path_info or self.get_path_info()
3.27 +
3.28 class Resource:
3.29
3.30 "A generic resource interface."
4.1 --- a/WebStack/JavaServlet.py Sat Feb 19 14:23:47 2005 +0000
4.2 +++ b/WebStack/JavaServlet.py Sat Feb 19 15:02:33 2005 +0000
4.3 @@ -211,10 +211,7 @@
4.4 handling the current request) from the request.
4.5 """
4.6
4.7 - if self.path_info is not None:
4.8 - return self.path_info
4.9 - else:
4.10 - return self.request.getPathInfo() or ""
4.11 + return self.request.getPathInfo() or ""
4.12
4.13 def get_query_string(self):
4.14
5.1 --- a/WebStack/ModPython.py Sat Feb 19 14:23:47 2005 +0000
5.2 +++ b/WebStack/ModPython.py Sat Feb 19 15:02:33 2005 +0000
5.3 @@ -162,10 +162,7 @@
5.4 handling the current request) from the request.
5.5 """
5.6
5.7 - if self.path_info is not None:
5.8 - return self.path_info
5.9 - else:
5.10 - return self.trans.path_info
5.11 + return self.trans.path_info
5.12
5.13 def get_query_string(self):
5.14
6.1 --- a/WebStack/Twisted.py Sat Feb 19 14:23:47 2005 +0000
6.2 +++ b/WebStack/Twisted.py Sat Feb 19 15:02:33 2005 +0000
6.3 @@ -133,10 +133,7 @@
6.4 handling the current request) from the request.
6.5 """
6.6
6.7 - if self.path_info is not None:
6.8 - return self.path_info
6.9 - else:
6.10 - return "/%s" % "/".join(self.trans.postpath)
6.11 + return "/%s" % "/".join(self.trans.postpath)
6.12
6.13 def get_query_string(self):
6.14
7.1 --- a/WebStack/WSGI.py Sat Feb 19 14:23:47 2005 +0000
7.2 +++ b/WebStack/WSGI.py Sat Feb 19 15:02:33 2005 +0000
7.3 @@ -181,10 +181,7 @@
7.4 handling the current request) from the request.
7.5 """
7.6
7.7 - if self.path_info is not None:
7.8 - return self.path_info
7.9 - else:
7.10 - return self.env.get("PATH_INFO") or ""
7.11 + return self.env.get("PATH_INFO") or ""
7.12
7.13 def get_query_string(self):
7.14
8.1 --- a/WebStack/Webware.py Sat Feb 19 14:23:47 2005 +0000
8.2 +++ b/WebStack/Webware.py Sat Feb 19 15:02:33 2005 +0000
8.3 @@ -139,15 +139,12 @@
8.4 handling the current request) from the request.
8.5 """
8.6
8.7 - if self.path_info is not None:
8.8 - return self.path_info
8.9 + path_info = self.trans.request().pathInfo()
8.10 + context_name = self.trans.request().contextName()
8.11 + if path_info.startswith(context_name):
8.12 + return path_info[len(context_name):]
8.13 else:
8.14 - path_info = self.trans.request().pathInfo()
8.15 - context_name = self.trans.request().contextName()
8.16 - if path_info.startswith(context_name):
8.17 - return path_info[len(context_name):]
8.18 - else:
8.19 - return path_info
8.20 + return path_info
8.21
8.22 def get_query_string(self):
8.23
9.1 --- a/WebStack/Zope.py Sat Feb 19 14:23:47 2005 +0000
9.2 +++ b/WebStack/Zope.py Sat Feb 19 15:02:33 2005 +0000
9.3 @@ -143,12 +143,9 @@
9.4 handling the current request) from the request.
9.5 """
9.6
9.7 - if self.path_info is not None:
9.8 - return self.path_info
9.9 - else:
9.10 - product_path = "/".join(self.adapter.getPhysicalPath())
9.11 - path_info = self.request.environ.get("PATH_INFO") or ""
9.12 - return path_info[len(product_path):]
9.13 + product_path = "/".join(self.adapter.getPhysicalPath())
9.14 + path_info = self.request.environ.get("PATH_INFO") or ""
9.15 + return path_info[len(product_path):]
9.16
9.17 def get_query_string(self):
9.18