changeset 475:ad2bc0980876

added some __repr__ to wikidicts to make debugging easier imported from: moin--main--1.5--patch-479
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 17 Mar 2006 09:34:24 +0000
parents 6535fed51de5
children 4be11eec9c4f
files ChangeLog MoinMoin/wikidicts.py
diffstat 2 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 17 07:10:40 2006 +0000
+++ b/ChangeLog	Fri Mar 17 09:34:24 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-03-17 10:34:24 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-479
+
+    Summary:
+      added some __repr__ to wikidicts to make debugging easier
+    Revision:
+      moin--main--1.5--patch-479
+
+    added some __repr__ to wikidicts to make debugging easier
+    
+
+    modified files:
+     ChangeLog MoinMoin/wikidicts.py
+
+
 2006-03-17 08:10:40 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-478
 
     Summary:
--- a/MoinMoin/wikidicts.py	Fri Mar 17 07:10:40 2006 +0000
+++ b/MoinMoin/wikidicts.py	Fri Mar 17 09:34:24 2006 +0000
@@ -70,7 +70,9 @@
     def __getitem__(self, key):
         return self._dict[key]
     
-    
+    def __repr__(self):
+        return "<DictBase name=%r items=%r>" % (self.name, self._dict.items())
+
 class Dict(DictBase):
     ''' Mapping of keys to values in a wiki page
 
@@ -97,6 +99,9 @@
             key, val = match.groups()
             self._dict[key] = val
 
+    def __repr__(self):
+        return "<Dict name=%r items=%r>" % (self.name, self._dict.items())
+
 class Group(DictBase):
     ''' Group of users, of pages, of whatever
 
@@ -179,6 +184,9 @@
         """ Invoke _expandgroup to recursively expand groups """
         self._dict = self._expandgroup(groupdict, self.name)
 
+    def __repr__(self):
+        return "<Group name=%r items=%r>" % (self.name, self._dict.keys())
+
 
 class DictDict:
     """a dictionary of Dict objects