From c6741d43922991a6660e139038afb59905e71b32 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Tue, 12 Feb 2013 18:36:49 +0000 Subject: [PATCH] Renamed test script to inventory git-svn-id: http://comictagger.googlecode.com/svn/trunk@486 6c5673fe-1810-88d6-992b-cd32ca31540c --- scripts/{test.py => inventory.py} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename scripts/{test.py => inventory.py} (85%) diff --git a/scripts/test.py b/scripts/inventory.py similarity index 85% rename from scripts/test.py rename to scripts/inventory.py index 9f08c42..a3054fd 100755 --- a/scripts/test.py +++ b/scripts/inventory.py @@ -9,7 +9,7 @@ import platform import locale import codecs -sys.path += ".." + os.pathsep +sys.path.append("..") from comictaggerlib.comicarchive import * from comictaggerlib.settings import * @@ -26,10 +26,16 @@ def main(): #first read in CIX metadata from all files metadata_list = [] + max_name_len = 2 for filename in filelist: ca = ComicArchive(filename, settings ) metadata_list.append((filename, ca.readCIX())) + fmt_str = u"{{0:{0}}}".format(max_name_len) + print fmt_str.format( filename ) + "\r", + sys.stdout.flush() + print fmt_str.format( "" ) + "\r", + # now, figure out column widths w0 = 4 w1 = 4 @@ -43,7 +49,7 @@ def main(): # build a format string fmt_str = "{0:" + str(w0) + "} {1:" + str(w1) + "} #{2:6} ({3})" - # now sort the list by year + # now sort the list by series, and then issue metadata_list.sort(key=lambda x: IssueString(x[1].issue).asString(3), reverse=False) metadata_list.sort(key=lambda x: str(x[1].series).lower()+str(x[1].year), reverse=False) #metadata_list.sort(key=lambda x: x[1].series, reverse=False)