Browse Source

add some repr's so the base class won't confuse me when printing..

this makes things a bit clearer, and prevents large output..

[git-p4: depot-paths = "//depot/": change = 821]
v0.3
John-Mark Gurney 19 years ago
parent
commit
9869ce7494
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      DIDLLite.py

+ 12
- 0
DIDLLite.py View File

@@ -58,6 +58,12 @@ class Object(object):
if kwargs.has_key('content'):
self._content = kwargs['content']

def __repr__(self):
cls = self.__class__
return '<%s.%s: id: %s, parent: %s, title: %s>' % \
(cls.__module__, cls.__name__, self.id, self.parentID,
self.title)

def checkUpdate(self):
return self

@@ -258,6 +264,12 @@ class Container(Object, list):

return root

def __repr__(self):
cls = self.__class__
return '<%s.%s: id: %s, parent: %s, title: %s, cnt: %d>' % \
(cls.__module__, cls.__name__, self.id, self.parentID,
self.title, len(self))

class Person(Container):
klass = Container.klass + '.person'



||||||
x
 
000:0
Loading…
Cancel
Save