[svn] r5141 - trunk/tools/dstat

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Fri Feb 9 08:18:59 CET 2007


Author: dag
Date: 2007-02-09 08:18:56 +0100 (Fri, 09 Feb 2007)
New Revision: 5141

Modified:
   trunk/tools/dstat/ChangeLog
   trunk/tools/dstat/dstat
Log:
Fixed a problem with strings and CSV output in dstat_time and dstat_app (Vinod Kutty)

Modified: trunk/tools/dstat/ChangeLog
===================================================================
--- trunk/tools/dstat/ChangeLog	2007-02-06 18:26:50 UTC (rev 5140)
+++ trunk/tools/dstat/ChangeLog	2007-02-09 07:18:56 UTC (rev 5141)
@@ -3,6 +3,7 @@
 - Added tcp6 and udp6 statistics within dstat_tcp and dstat_udp
 - Added module readlines() taking care of seek() and multiple files
 - Improved module exception messages
+- Fixed a problem with strings and CSV output in dstat_time and dstat_app (Vinod Kutty)
 
 * 0.6.4 - Ahoy - released 12/12/2006
 - Fixed dstat_clock to use localtime() instead of gmtime()

Modified: trunk/tools/dstat/dstat
===================================================================
--- trunk/tools/dstat/dstat	2007-02-06 18:26:50 UTC (rev 5140)
+++ trunk/tools/dstat/dstat	2007-02-09 07:18:56 UTC (rev 5141)
@@ -425,6 +425,8 @@
 					line = line + printcsv(val)
 					if j + 1 != len(self.val[name]):
 						line = line + ','
+			elif isinstance(self.val[name], types.StringType):
+				line = line + self.val[name]
 			else:
 				line = line + printcsv(self.val[name])
 			if i + 1 != len(self.vars):
@@ -1246,17 +1248,18 @@
 		self.name = 'time'
 		self.format = ('s', 14, 0)
 		self.nick = ('date/time',)
-		self.vars = self.nick
+		self.vars = ('time',)
+		self.init(self.vars, 1)
 
 	def extract(self):
-		pass
+		self.val['time'] = time.strftime('%d-%m %H:%M:%S', time.localtime())
 
 	def show(self):
 		if step == op.delay:
 			color = 'silver'
 		else:
 			color = 'gray'
-		return ansi[color] + time.strftime('%d-%m %H:%M:%S', time.localtime())
+		return ansi[color] + self.val['time']
 
 class dstat_udp(dstat):
 	def __init__(self):



More information about the svn-commits mailing list