Skip to content
Browse files

Fixed a problem with strings and CSV output in dstat_time and dstat_a…

…pp (Vinod Kutty)
  • Loading branch information...
1 parent 1c9cf8c commit 9600c8be80f9249528d32a7bb6e347fec54f5d80 @dagwieers committed Feb 9, 2007
Showing with 7 additions and 3 deletions.
  1. +1 −0 ChangeLog
  2. +6 −3 dstat
View
1 ChangeLog
@@ -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()
View
9 dstat
@@ -425,6 +425,8 @@ class dstat:
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 @@ class dstat_time(dstat):
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):

0 comments on commit 9600c8b

Please sign in to comment.
Something went wrong with that request. Please try again.