# HG changeset patch # User paulb # Date 1100561731 0 # Node ID 8469adf39084aa94cdb4f664b3dcbbe6df348ff9 # Parent a5a09e1164a81899a5a199af0f7245d714875a5b [project @ 2004-11-15 23:35:26 by paulb] Fixed path information for Zope. diff -r a5a09e1164a8 -r 8469adf39084 README.txt --- a/README.txt Thu Nov 04 17:11:21 2004 +0000 +++ b/README.txt Mon Nov 15 23:35:31 2004 +0000 @@ -37,6 +37,7 @@ stop the processing/production of a response; this is useful when resources need to issue a redirect without unnecessary content being generated, for example. +Fixed path information for Zope. New in WebStack 0.7 (Changes Since WebStack 0.6) ------------------------------------------------ diff -r a5a09e1164a8 -r 8469adf39084 WebStack/Adapters/Zope.py --- a/WebStack/Adapters/Zope.py Thu Nov 04 17:11:21 2004 +0000 +++ b/WebStack/Adapters/Zope.py Mon Nov 15 23:35:31 2004 +0000 @@ -44,8 +44,10 @@ resource. """ + # Provide the adapter so that "path info" can be determined correctly. + if REQUEST is not None: - trans = WebStack.Zope.Transaction(REQUEST) + trans = WebStack.Zope.Transaction(REQUEST, self) else: raise "Internal Error" diff -r a5a09e1164a8 -r 8469adf39084 WebStack/Zope.py --- a/WebStack/Zope.py Thu Nov 04 17:11:21 2004 +0000 +++ b/WebStack/Zope.py Mon Nov 15 23:35:31 2004 +0000 @@ -19,14 +19,16 @@ Zope transaction interface. """ - def __init__(self, request): + def __init__(self, request, adapter): """ - Initialise the transaction with the Zope 'request' object. + Initialise the transaction with the Zope 'request' object and the + 'adapter' which created this transaction. """ self.request = request self.response = request.RESPONSE + self.adapter = adapter # Cached information. @@ -140,7 +142,9 @@ handling the current request) from the request. """ - return self.request.environ.get("PATH_INFO") or "" + product_path = "/".join(self.adapter.getPhysicalPath()) + path_info = self.request.environ.get("PATH_INFO") or "" + return path_info[len(product_path):] def get_query_string(self): diff -r a5a09e1164a8 -r 8469adf39084 docs/PATH.txt --- a/docs/PATH.txt Thu Nov 04 17:11:21 2004 +0000 +++ b/docs/PATH.txt Mon Nov 15 23:35:31 2004 +0000 @@ -10,4 +10,4 @@ Twisted Same as path (correct) Webware <= 0.8.1 Not supported (needs ExtraPathInfo support) Webware > 0.8.1 Path beyond context (correct) -Zope 2.7.2-0 Same as path (should be path beyond resource) +Zope 2.7.2-0 Same as path (correct)