From 73c1310157665d803d5b72f1e2c428bdb12212eb Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 29 Dec 2010 00:06:32 -0500 Subject: [PATCH] fix up relative time in Command.parseTimeSpec() --- Command.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Command.py b/Command.py index 6abd37f..60bd3cd 100644 --- a/Command.py +++ b/Command.py @@ -64,13 +64,14 @@ class Command: # a relative time was given plus_minus = m.group(1) hms = m.group(3) + count = int(m.group(2)) if hms == 'm': - seconds = m.group(2) * 60 + seconds = count * 60 elif hms == 's': - seconds = m.group(2) + seconds = count else: # hours - seconds = m.group(2) * 60 * 60 - delta = datetime.timedelta(seconds = seconds) + seconds = count * 60 * 60 + delta = timedelta(seconds = seconds) if plus_minus == '-': the_time -= delta else: