[Zope-Checkins] CVS: Zope2 - pDocumentTemplate.py:1.31
shane@digicool.com
shane@digicool.com
Thu, 21 Jun 2001 15:43:45 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/DocumentTemplate
In directory korak.digicool.com:/tmp/cvs-serv31399
Modified Files:
pDocumentTemplate.py
Log Message:
Added a length implementation to pDocumentTemplate.
--- Updated File pDocumentTemplate.py in package Zope2 --
--- pDocumentTemplate.py 2001/06/21 19:08:59 1.30
+++ pDocumentTemplate.py 2001/06/21 19:43:44 1.31
@@ -160,6 +160,9 @@
self.cache[key]=r
return r
+ def __len__(self):
+ return 1
+
class MultiMapping:
def __init__(self): self.dicts=[]
@@ -219,6 +222,12 @@
else:
v = v()
return v
+
+ def __len__(self):
+ total = 0
+ for d in self.dicts.dicts:
+ total = total + len(d)
+ return total
def has_key(self,key):
try: