bugfix in parseCommandLine() and parseTimeSpec(), tests passing
This commit is contained in:
parent
ab0f265baa
commit
3a225f002c
@ -27,7 +27,7 @@ class Command:
|
|||||||
timespec = parts[0].strip()
|
timespec = parts[0].strip()
|
||||||
if timespec[0] == '@':
|
if timespec[0] == '@':
|
||||||
self.time = self.parseTimeSpec(timespec[1:])
|
self.time = self.parseTimeSpec(timespec[1:])
|
||||||
parts = parts[1:]
|
parts = parts[1].split(None, 1)
|
||||||
if len(parts) == 1:
|
if len(parts) == 1:
|
||||||
command = parts[0].strip()
|
command = parts[0].strip()
|
||||||
rest = ''
|
rest = ''
|
||||||
@ -41,7 +41,7 @@ class Command:
|
|||||||
|
|
||||||
def parseTimeSpec(self, timespec):
|
def parseTimeSpec(self, timespec):
|
||||||
the_time = self.time
|
the_time = self.time
|
||||||
m = re.match('^(?:(\d{4})[-/])?(\d{1,2})[-/](\d{1,2}),(.*)$', timespec)
|
m = re.match('^(?:(\d{4})[-/])?(\d{1,2})[-/](\d{1,2}),(.+)$', timespec)
|
||||||
if m is not None:
|
if m is not None:
|
||||||
# a date was given
|
# a date was given
|
||||||
if m.group(1) is not None:
|
if m.group(1) is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user