@ -46,12 +46,6 @@ class DateDetector:
def addDefaultTemplate ( self ) :
def addDefaultTemplate ( self ) :
self . __lock . acquire ( )
self . __lock . acquire ( )
try :
try :
# standard
template = DateStrptime ( )
template . setName ( " MONTH Day Hour:Minute:Second " )
template . setRegex ( " \ S {3} \ s { 1,2} \ d { 1,2} \ d {2} : \ d {2} : \ d {2} " )
template . setPattern ( " % b %d % H: % M: % S " )
self . _appendTemplate ( template )
# asctime
# asctime
template = DateStrptime ( )
template = DateStrptime ( )
template . setName ( " WEEKDAY MONTH Day Hour:Minute:Second Year " )
template . setName ( " WEEKDAY MONTH Day Hour:Minute:Second Year " )
@ -64,6 +58,12 @@ class DateDetector:
template . setRegex ( " \ S {3} \ S {3} \ s { 1,2} \ d { 1,2} \ d {2} : \ d {2} : \ d {2} " )
template . setRegex ( " \ S {3} \ S {3} \ s { 1,2} \ d { 1,2} \ d {2} : \ d {2} : \ d {2} " )
template . setPattern ( " %a % b %d % H: % M: % S " )
template . setPattern ( " %a % b %d % H: % M: % S " )
self . _appendTemplate ( template )
self . _appendTemplate ( template )
# standard - most loose from above 3 so by default follows after
template = DateStrptime ( )
template . setName ( " MONTH Day Hour:Minute:Second " )
template . setRegex ( " \ S {3} \ s { 1,2} \ d { 1,2} \ d {2} : \ d {2} : \ d {2} " )
template . setPattern ( " % b %d % H: % M: % S " )
self . _appendTemplate ( template )
# simple date
# simple date
template = DateStrptime ( )
template = DateStrptime ( )
template . setName ( " Year/Month/Day Hour:Minute:Second " )
template . setName ( " Year/Month/Day Hour:Minute:Second " )