added an actual "start" command and test (failing)
This commit is contained in:
parent
51ab4c5d7e
commit
ab0f265baa
@ -19,7 +19,8 @@ class Command:
|
|||||||
'report' : 1,
|
'report' : 1,
|
||||||
'show' : 1,
|
'show' : 1,
|
||||||
'fill' : 1,
|
'fill' : 1,
|
||||||
'adjust' : 1
|
'adjust' : 1,
|
||||||
|
'start' : 1
|
||||||
}
|
}
|
||||||
parts = cmdline.split(None, 1)
|
parts = cmdline.split(None, 1)
|
||||||
if len(parts) > 1:
|
if len(parts) > 1:
|
||||||
@ -53,7 +54,7 @@ class Command:
|
|||||||
# an absolute time was given
|
# an absolute time was given
|
||||||
h = int(m.group(1))
|
h = int(m.group(1))
|
||||||
mins = 0 if m.group(2) is None else int(m.group(2))
|
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:
|
if len(am_pm) >= 1 and am_pm[0] == 'p' and h < 12:
|
||||||
h += 12
|
h += 12
|
||||||
elif len(am_pm) >= 1 and am_pm[0] == 'a' and h == 12:
|
elif len(am_pm) >= 1 and am_pm[0] == 'a' and h == 12:
|
||||||
|
1
test
1
test
@ -37,6 +37,7 @@ def main():
|
|||||||
testcmd(' adjust -10m ', 'adjust', '-10m')
|
testcmd(' adjust -10m ', 'adjust', '-10m')
|
||||||
testcmd(' @9:45 wr: nog: pbit ram test ',
|
testcmd(' @9:45 wr: nog: pbit ram test ',
|
||||||
'start', 'wr: nog: pbit ram test')
|
'start', 'wr: nog: pbit ram test')
|
||||||
|
testcmd('@12/14,3pm start arlx', 'start', 'arlx')
|
||||||
if n_tests == n_pass:
|
if n_tests == n_pass:
|
||||||
print " >= SUCCESS <="
|
print " >= SUCCESS <="
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user