aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-05-02 17:26:28 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-05-02 17:26:28 +0000
commit61014d8ba27b0bb25d83c62c0da2404073c362b5 (patch)
treeda5db14b6f09c05706daa918065cbc6c1963d2ab
parent87079b89cd471cb0c8f8415a0e3444c65596fbe3 (diff)
downloadmgarepo-61014d8ba27b0bb25d83c62c0da2404073c362b5.tar
mgarepo-61014d8ba27b0bb25d83c62c0da2404073c362b5.tar.gz
mgarepo-61014d8ba27b0bb25d83c62c0da2404073c362b5.tar.bz2
mgarepo-61014d8ba27b0bb25d83c62c0da2404073c362b5.tar.xz
mgarepo-61014d8ba27b0bb25d83c62c0da2404073c362b5.zip
Implemented __repr__ for the classes _Release and _Revision in order to
ease debugging.
-rw-r--r--RepSys/log.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/RepSys/log.py b/RepSys/log.py
index 24dca3c..b03e23d 100644
--- a/RepSys/log.py
+++ b/RepSys/log.py
@@ -90,6 +90,12 @@ class _Revision:
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
+ def __repr__(self):
+ lines = repr(self.lines)[:30] + "...]"
+ line = "<_Revision %d author=%r date=%r lines=%s>" % \
+ (self.revision, self.author, self.date, lines)
+ return line
+
class _Release(_Revision):
version = None
@@ -103,6 +109,11 @@ class _Release(_Revision):
self.revisions = []
_Revision.__init__(self, **kwargs)
+ def __repr__(self):
+ line = "<_Release v=%s r=%s revs=%r>" % \
+ (self.version, self.release, self.revisions)
+ return line
+
unescaped_macro_pat = re.compile(r"([^%])%([^%])")
def escape_macros(text):