added an actual "start" command and test (failing)

This commit is contained in:
Josh Holtrop 2010-12-29 00:15:27 -05:00
parent 51ab4c5d7e
commit ab0f265baa
2 changed files with 4 additions and 2 deletions

View File

@ -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:

1
test
View File

@ -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: