From d17fcd70aa3815371ca143b173872e82a47654fc Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Sun, 2 Nov 2008 18:59:46 +0100 Subject: [PATCH] Added count to version information --- pakfire/show.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pakfire/show.py b/pakfire/show.py index b460642b..08704a39 100644 --- a/pakfire/show.py +++ b/pakfire/show.py @@ -40,7 +40,7 @@ def beautify_ip(ip): error = "Couldn't look up name: %s" % e string = "%s (%s)" % (error, ip) return string - + def beautify_time(timestamp): return time.strftime("%d-%m-%Y - %H:%M", time.localtime(float(timestamp))) @@ -62,7 +62,7 @@ def get_attributes(line): def showuuid(uuid, ver): print "

%s

" % (os.environ['SCRIPT_NAME'], dir, uuid, uuid, uuid) - + def summurize_addons(): addons={} installed={} @@ -143,9 +143,9 @@ def showdetails(uuid, ver): line = f.readline() if len(line) == 0: break # EOF - + ip, timestamp, command, pak, status = get_attributes(line) - + if command == "update\n": last_update = timestamp continue @@ -154,18 +154,18 @@ def showdetails(uuid, ver): string += beautify_ip(ip) timestamp = beautify_time(timestamp) - - + + if command: string += " - %s - %s" % (command, command, pak) if not status == "0\n": string += " %s" % status - + string += "%s" % timestamp - + print string - print "Last update:%s" % beautify_time(timestamp) + print "Last update:%s" % beautify_time(timestamp) print "" f.close() @@ -179,20 +179,21 @@ def summary(type): if (dir == "empty.txt" ): pass else: - print "%s
" % dir, + print "%s (%s)
" % (dir, len(os.listdir("version/"+dir))), print "" - - print "Number of total hosts:", + count = 0 + version={} + for dir in os.listdir("version/"): if (dir == "empty.txt" ): - pass + pass else: count += len(os.listdir("version/"+dir)) - print count, + print "Number of total hosts:",count, print "" - + print "" ### HTTP-Header -- 2.47.3