diff --git a/Command.py b/Command.py index 35a33f5..99689a0 100644 --- a/Command.py +++ b/Command.py @@ -6,8 +6,13 @@ class Command: def __init__(self, timenow, cmdline): self.time = timenow self.command = 'start' + self.argstr = '' self.parseCommandLine(cmdline) + def __str__(self): + return "{'time' => %s, 'command' => %s, 'argstr' => %s}" % \ + (self.time, self.command, self.argstr) + def parseCommandLine(self, cmdline): COMMANDS = { 'out' : 1, @@ -65,3 +70,8 @@ class Command: seconds = m.group(2) else: # hours seconds = m.group(2) * 60 * 60 + delta = datetime.timedelta(seconds = seconds) + if plus_minus == '-': + the_time -= delta + else: + the_time += delta diff --git a/dwtt b/dwtt index d4c3c3f..f20e4ad 100755 --- a/dwtt +++ b/dwtt @@ -42,6 +42,7 @@ def main(argv): cmdline = doCmdWindow() cmd = Command(timenow, cmdline) + print "Command:", cmd def doCmdWindow(): c = CmdWindow()