[Zope3-checkins] CVS: Zope3/src/zope/configuration - config.py:1.23

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 10 07:24:03 EST 2004


Update of /cvs-repository/Zope3/src/zope/configuration
In directory cvs.zope.org:/tmp/cvs-serv23174/src/zope/configuration

Modified Files:
	config.py 
Log Message:


Allow for single "." as reference to current package.




=== Zope3/src/zope/configuration/config.py 1.22 => 1.23 ===
--- Zope3/src/zope/configuration/config.py:1.22	Mon Mar  8 18:39:00 2004
+++ Zope3/src/zope/configuration/config.py	Wed Mar 10 07:24:02 2004
@@ -116,6 +116,8 @@
                                                                   """'package'
         >>> import zope.configuration
         >>> c.package = zope.configuration
+        >>> c.resolve('.') is zope.configuration
+        1
         >>> c.resolve('.config.ConfigurationContext') is ConfigurationContext
         1
         >>> c.resolve('..interface') is zope.interface
@@ -127,6 +129,9 @@
         name = dottedname.strip()
         if not name:
             raise ValueError("The given name is blank")
+
+        if name == '.':
+            return self.package
 
         names = name.split('.')
         if not names[-1]:




More information about the Zope3-Checkins mailing list