Catch invalid date exceptions
svn: r9
This commit is contained in:
parent
8be0e73765
commit
8f483328bd
18
src/Date.py
18
src/Date.py
@ -61,11 +61,20 @@ class Date:
|
||||
match = Date.fmt.match(text)
|
||||
if match:
|
||||
matches = match.groups()
|
||||
try:
|
||||
self.start.set(matches[1])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.stop.set(matches[3])
|
||||
except:
|
||||
pass
|
||||
self.range = 1
|
||||
else:
|
||||
try:
|
||||
self.start.set(text)
|
||||
except:
|
||||
pass
|
||||
self.range = 0
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
@ -102,11 +111,20 @@ class Date:
|
||||
match = Date.fmt.match(text)
|
||||
if match:
|
||||
matches = match.groups()
|
||||
try:
|
||||
self.start.set(matches[1])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.stop.set(matches[3])
|
||||
except:
|
||||
pass
|
||||
self.range = 1
|
||||
else:
|
||||
try:
|
||||
self.start.quick_set(text)
|
||||
except:
|
||||
pass
|
||||
self.range = 0
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user