ubuntutools/lp/lpapicache.py: Add __repr__() to the BaseWrapper class

This commit is contained in:
Michael Bienia 2010-02-12 19:36:08 +01:00
parent 4f21ae1cd0
commit b101712009

View File

@ -124,6 +124,11 @@ class BaseWrapper(object):
def __getattr__(self, attr): def __getattr__(self, attr):
return getattr(self._lpobject, attr) return getattr(self._lpobject, attr)
def __repr__(self):
if hasattr(str, 'format'):
return '<{0}: {1!r}>'.format(self.__class__.__name__, self._lpobject)
else:
return '<%s: %r>' % (self.__class__.__name__, self._lpobject)
class Distribution(BaseWrapper): class Distribution(BaseWrapper):
''' '''