<s> """<STR_LIT>""" <EOL> try : <EOL> from datemx_types import * <EOL> from mx import DateTime as mx_DateTime <EOL> haveMX = <NUM_LIT:1> <EOL> DateTime_DT = mxDateTime_DT <EOL> DateTimeDelta_DT = mxDateTimeDelta_DT <EOL> TimeOfDay = mxTimeOfDay <EOL> DateTime = mx_DateTime . DateTimeFrom <EOL> DateTimeDelta = mx_DateTime . DateTimeDelta <EOL> now = mx_DateTime . now <EOL> today = mx_DateTime . today <EOL> except ImportError : <EOL> haveMX = <NUM_LIT:0> <EOL> haveImplementation = haveMX <EOL> from basictypes import enumeration <EOL> import calendar <EOL> def allInstances ( cls ) : <EOL> """<STR_LIT>""" <EOL> items = [ <EOL> ( choice . value , cls ( name = choice . name ) ) <EOL> for choice in cls . set . values ( ) <EOL> ] <EOL> items . sort ( ) <EOL> items = [ v [ <NUM_LIT:1> ] for v in items ] <EOL> return items <EOL> class WeekDay ( enumeration . Enumeration ) : <EOL> """<STR_LIT>""" <EOL> dataType = '<STR_LIT>' <EOL> set = enumeration . EnumerationSet . coerce ( <EOL> zip ( <EOL> calendar . day_name , <EOL> range ( len ( calendar . day_name ) ) <EOL> ) <EOL> ) <EOL> allInstances = classmethod ( allInstances ) <EOL> class WeekDayAbbr ( enumeration . Enumeration ) : <EOL> """<STR_LIT>""" <EOL> dataType = '<STR_LIT>' <EOL> set = enumeration . EnumerationSet . coerce ( <EOL> zip ( <EOL> calendar . day_abbr , <EOL> range ( len ( calendar . day_abbr ) ) <EOL> ) <EOL> ) <EOL> allInstances = classmethod ( allInstances ) <EOL> class Month ( enumeration . Enumeration ) : <EOL> """<STR_LIT>""" <EOL> dataType = '<STR_LIT>' <EOL> data = zip ( <EOL> calendar . month_name [ <NUM_LIT:1> : ] , <EOL> range ( len ( calendar . month_name ) ) [ <NUM_LIT:1> : ] <EOL> ) <EOL> set = enumeration . EnumerationSet . coerce ( <EOL> data <EOL> ) <EOL> allInstances = classmethod ( allInstances ) <EOL> class MonthAbbr ( enumeration . Enumeration ) : <EOL> """<STR_LIT>""" <EOL> dataType = '<STR_LIT>' <EOL> set = enumeration . EnumerationSet . coerce ( <EOL> zip ( <EOL> calendar . month_abbr [ <NUM_LIT:1> : ] , <EOL> range ( len ( calendar . month_abbr ) ) [ <NUM_LIT:1> : ] <EOL> ) <EOL> ) <EOL> allInstances = classmethod ( allInstances ) <EOL> del calendar <EOL> del enumeration </s>
