[Zope3-checkins] CVS: Zope3/src/pythonlib - __init__.py:1.3
Fred L. Drake, Jr.
fred@zope.com
Mon, 9 Jun 2003 12:11:03 -0400
Update of /cvs-repository/Zope3/src/pythonlib
In directory cvs.zope.org:/tmp/cvs-serv6602
Modified Files:
__init__.py
Log Message:
Load the __all__ and __doc__ from the module implementation into the
shim.
=== Zope3/src/pythonlib/__init__.py 1.2 => 1.3 ===
--- Zope3/src/pythonlib/__init__.py:1.2 Fri Apr 11 15:53:13 2003
+++ Zope3/src/pythonlib/__init__.py Mon Jun 9 12:11:02 2003
@@ -31,6 +31,15 @@
all = mod.__all__
except AttributeError:
all = [name for name in dir(mod) if not name.startswith('_')]
+ else:
+ # If the original had __all__, the exported version should as
+ # well, since there's no checking that it's the same as what
+ # would be auto-generated from the resulting module.
+ globals["__all__"] = mod.__all__
for attr in all:
globals[attr] = getattr(mod, attr)
+
+ # Add the module docstring if the shim module doesn't provide one.
+ if getattr(mod, "__doc__", None) and "__doc__" not in globals:
+ globals["__doc__"] = mod.__doc__