File tree 1 file changed +5
-7
lines changed
addons/source-python/packages/source-python/listeners
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,7 @@ def time_remaining(self):
181
181
:rtype: float
182
182
"""
183
183
if not self .running :
184
- # TODO: what should we return here, or should we raise an error?
185
- return None
184
+ return 0
186
185
return self .exec_time - time .time ()
187
186
188
187
@property
@@ -192,8 +191,7 @@ def time_elapsed(self):
192
191
:rtype: float
193
192
"""
194
193
if not self .running :
195
- # TODO: what should we return here, or should we raise an error?
196
- return None
194
+ return 0
197
195
return time .time () - self ._start_time
198
196
199
197
def _unload_instance (self ):
@@ -314,10 +312,10 @@ def total_time_remaining(self):
314
312
315
313
:rtype: float
316
314
"""
317
- if self .delay_time_remaining is None :
318
- return None
315
+ if not self .delay_time_remaining :
316
+ return 0
319
317
return (
320
- self .loops_remaining * self .interval +
318
+ ( self .loops_remaining - 1 ) * self .interval +
321
319
self .delay_time_remaining
322
320
)
323
321
You can’t perform that action at this time.
0 commit comments