@@ -110,6 +110,9 @@ def slice_columns(columns, low_freq, high_freq):
110110 stop_col = sum (f <= args .high_freq for f in columns )
111111 return start_col , stop_col - 1
112112
113+ def parse_time (t ):
114+ return datetime .datetime .strptime (t , '%Y-%m-%d %H:%M:%S' )
115+
113116freqs = set ()
114117f_cache = set ()
115118times = set ()
@@ -148,8 +151,8 @@ def slice_columns(columns, low_freq, high_freq):
148151 max_z = max (max_z , max (zs ))
149152
150153 if start is None :
151- start = datetime . datetime . strptime (line [0 ] + ' ' + line [1 ], '%Y-%m-%d %H:%M:%S' )
152- stop = datetime . datetime . strptime (line [0 ] + ' ' + line [1 ], '%Y-%m-%d %H:%M:%S' )
154+ start = parse_time (line [0 ] + ' ' + line [1 ])
155+ stop = parse_time (line [0 ] + ' ' + line [1 ])
153156
154157freqs = list (sorted (list (freqs )))
155158times = list (sorted (list (times )))
@@ -216,7 +219,7 @@ def rgb3(z):
216219 draw .text ((x , y ), s , font = font , fill = 'white' )
217220
218221duration = stop - start
219- duration = duration .seconds
222+ duration = duration .days * 24 * 60 * 60 + duration . seconds + 30
220223pixel_height = duration / len (times )
221224hours = int (duration / 3600 )
222225minutes = int ((duration - 3600 * hours ) / 60 )
0 commit comments