[Checkins] SVN: Sandbox/philikon/five.publication/trunk/five/publication/request.py Actually, I read that spec wrong. request.getApplicationURL(n-1) is the same

Philipp von Weitershausen philikon at philikon.de
Sun Aug 5 17:57:46 EDT 2007


Log message for revision 78608:
  Actually, I read that spec wrong. request.getApplicationURL(n-1) is the same
  as BASEn, apparently.  Also the same behaviour wrt empty paths seems to be
  expected as with URLPATHn (don't have a test for this yet, but evidence from
  the Zope2 source seems to confirm that).
  

Changed:
  U   Sandbox/philikon/five.publication/trunk/five/publication/request.py

-=-
Modified: Sandbox/philikon/five.publication/trunk/five/publication/request.py
===================================================================
--- Sandbox/philikon/five.publication/trunk/five/publication/request.py	2007-08-05 21:53:13 UTC (rev 78607)
+++ Sandbox/philikon/five.publication/trunk/five/publication/request.py	2007-08-05 21:57:46 UTC (rev 78608)
@@ -53,8 +53,12 @@
             match = BASEmatch(key)
             if match is not None:
                 pathonly, n = match.groups()
+                n = int(n) - 1
                 try:
-                    return self.getApplicationURL(int(n), bool(pathonly))
+                    url = self.getApplicationURL(n, bool(pathonly))
+                    if url == '/':
+                        url = ''
+                    return url
                 except IndexError:
                     raise KeyError(key)
 



More information about the Checkins mailing list