[Zope3-checkins] CVS: Zope3/src/zope/publisher - base.py:1.4
Jim Fulton
jim@zope.com
Mon, 3 Feb 2003 10:00:51 -0500
Update of /cvs-repository/Zope3/src/zope/publisher
In directory cvs.zope.org:/tmp/cvs-serv14925
Modified Files:
base.py
Log Message:
Added __iter__ method.
Got rid of HTTP-specific __repr__.
=== Zope3/src/zope/publisher/base.py 1.3 => 1.4 ===
--- Zope3/src/zope/publisher/base.py:1.3 Fri Dec 27 11:40:24 2002
+++ Zope3/src/zope/publisher/base.py Mon Feb 3 10:00:49 2003
@@ -114,10 +114,18 @@
has_key = __contains__
- def keys(self): return self.__map.keys()
- def items(self): return self.__map.items()
- def values(self): return self.__map.values()
- def __len__(self): return len(self.__map)
+ def keys(self):
+ return self.__map.keys()
+
+ def __iter__(self):
+ return iter(self.keys())
+
+ def items(self):
+ return self.__map.items()
+ def values(self):
+ return self.__map.values()
+ def __len__(self):
+ return len(self.__map)
class RequestDataProperty(object):
@@ -321,6 +329,9 @@
'See Interface.Common.Mapping.IEnumerableMapping'
return self._environ.keys()
+ def __iter__(self):
+ return iter(self.keys())
+
def values(self):
'See Interface.Common.Mapping.IEnumerableMapping'
result = []
@@ -364,11 +375,6 @@
L1 = self.items()
L1.sort()
return "\n".join(map(lambda item: "%s:\t%s" % item, L1))
-
- def __repr__(self):
- # Returns a *short* string.
- return '<%s instance at 0x%x, URL=%s>' % (
- str(self.__class__), id(self), `self.URL`)
def _setupPath_helper(self, attr):
path = self.get(attr, "/").strip()