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