From ab0f265baae4ac3e443ff8e0136e955ea231f190 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 29 Dec 2010 00:15:27 -0500 Subject: [PATCH] added an actual "start" command and test (failing) --- Command.py | 5 +++-- test | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Command.py b/Command.py index 4d80ec2..c9408c4 100644 --- a/Command.py +++ b/Command.py @@ -19,7 +19,8 @@ class Command: 'report' : 1, 'show' : 1, 'fill' : 1, - 'adjust' : 1 + 'adjust' : 1, + 'start' : 1 } parts = cmdline.split(None, 1) if len(parts) > 1: @@ -53,7 +54,7 @@ class Command: # an absolute time was given h = int(m.group(1)) mins = 0 if m.group(2) is None else int(m.group(2)) - am_pm = m.group(3).lower() + am_pm = '' if m.group(3) is None else m.group(3).lower() if len(am_pm) >= 1 and am_pm[0] == 'p' and h < 12: h += 12 elif len(am_pm) >= 1 and am_pm[0] == 'a' and h == 12: diff --git a/test b/test index e3f9039..f3f2534 100755 --- a/test +++ b/test @@ -37,6 +37,7 @@ def main(): testcmd(' adjust -10m ', 'adjust', '-10m') testcmd(' @9:45 wr: nog: pbit ram test ', 'start', 'wr: nog: pbit ram test') + testcmd('@12/14,3pm start arlx', 'start', 'arlx') if n_tests == n_pass: print " >= SUCCESS <=" else: