From cbe0368b8c43013f3c73fd0927ebea67b7360618 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Sat, 6 Sep 2008 15:34:59 +0200 Subject: [PATCH] Added small test code to dcparser. --- lib/dcparser/dcparser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/dcparser/dcparser.py b/lib/dcparser/dcparser.py index 7d4386237..78800902d 100644 --- a/lib/dcparser/dcparser.py +++ b/lib/dcparser/dcparser.py @@ -111,3 +111,11 @@ class BookInfo(object): def parse(file_name): return BookInfo.from_file(file_name) + +if __name__ == '__main__': + import sys + + info = parse(sys.argv[1]) + for attribute, _ in BookInfo.mapping.values(): + print '%s: %r' % (attribute, getattr(info, attribute, None)) + -- 2.20.1