[Zope-Checkins] CVS: ZODB3/zLOG - datatypes.py:1.11.10.1
Jeremy Hylton
jeremy at zope.com
Tue Dec 23 14:06:48 EST 2003
Update of /cvs-repository/ZODB3/zLOG
In directory cvs.zope.org:/tmp/cvs-serv26665/zLOG
Modified Files:
Tag: ZODB3-mvcc-2-branch
datatypes.py
Log Message:
Merge the head to the mvcc branch.
This merge should be the final preparation for merging the branch to
the trunk.
=== ZODB3/zLOG/datatypes.py 1.11 => 1.11.10.1 ===
--- ZODB3/zLOG/datatypes.py:1.11 Sat Aug 2 01:45:51 2003
+++ ZODB3/zLOG/datatypes.py Tue Dec 23 14:05:47 2003
@@ -238,3 +238,22 @@
if handler_level < lowest:
lowest = factory.getLevel()
return lowest
+
+def importable_name(name):
+ try:
+ components = name.split('.')
+ start = components[0]
+ g = globals()
+ package = __import__(start, g, g)
+ modulenames = [start]
+ for component in components[1:]:
+ modulenames.append(component)
+ try:
+ package = getattr(package, component)
+ except AttributeError:
+ n = '.'.join(modulenames)
+ package = __import__(n, g, g, component)
+ return package
+ except ImportError:
+ raise ValueError, (
+ 'The object named by "%s" could not be imported' % name )
More information about the Zope-Checkins
mailing list