[Zope-Checkins] CVS: Zope3/lib/python/Interface - pyskel.py:1.7
Jim Fulton
jim@zope.com
Tue, 9 Jul 2002 09:02:16 -0400
Update of /cvs-repository/Zope3/lib/python/Interface
In directory cvs.zope.org:/tmp/cvs-serv10994
Modified Files:
pyskel.py
Log Message:
Added back the "See interface" doc strings, but removed the equivalent
comments. Took out the code to copy the doc string data from the
interface due to complaints that it cluttered up the code. Maybe
later, we'll add some call at the end that copies the data for an
entire interface in one statement.
Also fixed a bug in getAttributesInOrder that caused methods and
attributes to be ommitted if the interface-parsing code missfired.
=== Zope3/lib/python/Interface/pyskel.py 1.6 => 1.7 ===
namesAndDescriptions)
- if namesAndDescriptions and print_iface:
- print
- print " ######################################"
- print " # from:", name
+ # if namesAndDescriptions and print_iface:
+ # print
+ # print " ######################################"
+ # print " # from:", name
for aname, ades in namesAndDescriptions:
if isinstance(ades, Method):
@@ -67,13 +67,15 @@
else: sig = "self"
print
print " def %s(%s):" % (aname, sig)
- print
- print
- print " %s.__doc__ = %s['%s'].__doc__" % (
- aname, top.__name__, aname)
+ print ' "See %s"' % name
+ # print
+ # print
+ # print " %s.__doc__ = '%%s\\n\\n%%s' %% (%s['%s'].__doc__, %s.__doc__" % (
+ # aname, top.__name__, aname, aname)
elif isinstance(ades, Attribute):
print
+ print " # See %s" % name
print " %s = None" %aname
else:
@@ -96,15 +98,15 @@
print
print " __implements__ = ", iface.__name__
print
- print " ############################################################"
- print " # Implementation methods for interface"
- print " #", name
+ # print " ############################################################"
+ # print " # Implementation methods for interface"
+ # print " #", name
rskel(iface, iface, 0)
- print
- print " #"
- print " ############################################################"
+ # print
+ # print " #"
+ # print " ############################################################"
def resolve(name, _silly=('__doc__',), _globals={}):
@@ -181,7 +183,9 @@
if name_order is None:
# Something's wrong. Oh well.
- return interface.__dict__.items()
+ items = interface.namesAndDescriptions()
+ items.sort()
+ return items
else:
items = []
for key, value in interface.namesAndDescriptions():