[Zope-Checkins] CVS: Zope3/lib/python/Interface - pyskel.py:1.1.2.11
Stephan Richter
srichter@cbu.edu
Tue, 9 Apr 2002 04:16:25 -0400
Update of /cvs-repository/Zope3/lib/python/Interface
In directory cvs.zope.org:/tmp/cvs-serv16546
Modified Files:
Tag: Zope-3x-branch
pyskel.py
Log Message:
Based on the desire of a single individual, I changed the code so that the
first letter is only clipped for the class name, if it is an 'I'.
I also fixed another small bug I found.
=== Zope3/lib/python/Interface/pyskel.py 1.1.2.10 => 1.1.2.11 ===
def skel(name):
iface = resolve(name)
+ class_name = iface.__name__
+ if class_name.startswith('I'):
+ class_name = class_name[1:]
print "from %s import %s" % (iface.__module__, iface.__name__)
print
- print "class %s:" %iface.__name__[1:]
+ print "class %s:" %class_name
print
print " __implements__ = ", iface.__name__
print
@@ -104,7 +107,7 @@
names=name.split('.')
last=names[-1]
mod='.'.join(names[:-1])
-
+
while 1:
m=__import__(mod, _globals, _globals, _silly)
try:
@@ -146,7 +149,7 @@
if name_order is None:
# Something's wrong. Oh well.
- return interface.__dict__.values()
+ return interface.__dict__.items()
else:
items = []
for key, value in interface.namesAndDescriptions():