From: Marek Stępniowski Date: Sat, 6 Sep 2008 13:34:59 +0000 (+0200) Subject: Added small test code to dcparser. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/cbe0368b8c43013f3c73fd0927ebea67b7360618 Added small test code to dcparser. --- 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)) +