From 68e00dacaa70c1da27ddb22564918de12bd7810c Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Fri, 30 Apr 2010 13:07:42 +0300 Subject: [PATCH] ppf/log-parser: add timestamp support to callback functions --- ppf/log-parser/generic/GenericStatusParser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ppf/log-parser/generic/GenericStatusParser.py b/ppf/log-parser/generic/GenericStatusParser.py index 5077175..efead77 100644 --- a/ppf/log-parser/generic/GenericStatusParser.py +++ b/ppf/log-parser/generic/GenericStatusParser.py @@ -102,8 +102,7 @@ class GenericStatusParser: download_speed, upload_speed, download_size, upload_size, eta_seconds): - print "ps = %d, dht = %d, ds = %d kb/s, us = %d kb/s, dsize = %d bytes, usize = %d bytes" % (num_peers, dht, - download_speed, upload_speed, download_size, upload_size) + print "time = %s, ps = %d, dht = %d, ds = %d kb/s, us = %d kb/s, dsize = %d bytes, usize = %d bytes" % (timestamp.strftime("%H:%M:%S %d/%m/%y"), num_peers, dht, download_speed, upload_speed, download_size, upload_size) def parse(self, callback_func, callback_arg = None): try: @@ -122,12 +121,12 @@ class GenericStatusParser: logging.debug("(%d, %d, %d kb/s, %d kb/s, %d bytes, %d bytes)" % (num_peers, dht, download_speed, upload_speed, download_size, upload_size)) if callback_arg == None: - callback_func(num_peers, dht, + callback_func(timestamp, num_peers, dht, download_speed, upload_speed, download_size, upload_size, eta_seconds) else: - callback_func(callback_arg, + callback_func(callback_arg, timestamp, num_peers, dht, download_speed, upload_speed, download_size, upload_size, -- 2.20.1