[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Traversing - ParameterParsing.py:1.1.2.1.4.1 Traverser.py:1.1.2.11.4.2

Jim Fulton jim@zope.com
Sun, 2 Jun 2002 10:35:24 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Traversing
In directory cvs.zope.org:/tmp/cvs-serv29793/lib/python/Zope/App/Traversing

Modified Files:
      Tag: Zope3InWonderland-branch
	ParameterParsing.py Traverser.py 
Log Message:
- Added template attribute to allow views to be created from a
  template source file.

- Added beginnings of a Zope debugger. This required seperating site
  and server configuration.

- Added the ability to specify a config file package in the
  zopeConfigure directive. Made "config.zcml" a default for the file
  attribute in the include directive.

- Fixed mapply to unwrap proxied objects. This was necessary once
  views became wrapped in proxies. We need to investigate why they
  weren't being wrapped before. 

- I updated enough system page templates and zcml directives so that:

  - Zope now starts. :)

  - The root folder contents listing can be viewed.

  Many more templates and zcml files need to be updated to reflect the
  way views are now handled.



=== Zope3/lib/python/Zope/App/Traversing/ParameterParsing.py 1.1.2.1 => 1.1.2.1.4.1 ===
 """
 
-class DuplicateNamespaces(Exception):
-    """More than one namespace was specified in a request"""
-
 def parameterizedNameParse(name):
     """Parse a name with parameters, including namespace parameters.
     
@@ -31,7 +28,18 @@
     
     - sequence of parameters, as name-value pairs.
     """
-    ns = ''
+
+    l = name.find('::')
+    if l > 0:
+        ns = name[:l]
+        name = name[l+2:]
+    else:
+        ns = ''
+
+    if ';' not in name:
+        return ns, name, ()
+
+        
     parts = name.split(';')
     nm = parts[:1][0]
     parms = ()
@@ -40,15 +48,10 @@
         if l >= 0:
             pname = param[:l]
             pval = param[l+1:]
-            if pname == 'ns':
-                if ns:
-                    raise DuplicateNamespaces(name)
-                ns = pval
-            else:
-                parms += ((pname, pval),)
         else:
-            if ns:
-                raise DuplicateNamespaces(name)
-            ns = param
+            pname = param
+            pval = ''
+        parms += ((pname, pval),)
+            
 
     return ns, nm, parms


=== Zope3/lib/python/Zope/App/Traversing/Traverser.py 1.1.2.11.4.1 => 1.1.2.11.4.2 ===
 
 
-                if name.find(';') >= 0:
+                if ':' in name or ';' in name:
                     ns, nm, parms = parameterizedNameParse(name)
                     if ns:
                         curr = namespaceLookup(name, ns, nm, parms,