basictypes.datemx_types
index
p:\properties\basictypes\datemx_types.py

mxDateTime-based date value-types
 
XXX Still need:
        full RelativeDateTime definition

 
Modules
       
basictypes.datatypedefinition
mx.DateTime.mxDateTime.mxDateTime
re
basictypes.registry
time
traceback

 
Classes
       
BaseType_DT(DataTypeDefinition)
mxDateTimeDelta_DT
mxDateTime_DT
object
_TimeParser
_TimeDeltaParser
mxTimeOfDay(_TimeParser, RelativeDateTime)

 
class _TimeDeltaParser(_TimeParser)
    Time parser with negative-value support
 
 
Method resolution order:
_TimeDeltaParser
_TimeParser
object

Class methods defined here:
parse(cls, text) from type
Takes user input and returns partial value dict
 
This just adds support for negative values, which
consists of negating all values if the hour value is
negative.

Data and other attributes defined here:
HOUR_RE = r'[+ -]*\d+'

Data and other attributes inherited from _TimeParser:
AM_RE = 'a[.]?[m]?[.]?'
MINUTE_RE = r'\d+'
PM_RE = 'p[.]?[m]?[.]?'
SECOND_RE = r'(\d+([.]\d+)?)|([.]\d+)'
TEMPLATE_RE = '\n\t(?P<hour>%(hour)s)\n\t(\n\t\t[:,.]\n\t\t(?P<minute>%(m...]*\n\t(\n\t\t(?P<am>%(am)s)\n\t\t|\n\t\t(?P<pm>%(pm)s)\n\t)?\n\t'
__dict__ = <dictproxy object at 0x01ACAE70>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of '_TimeParser' objects>
list of weak references to the object (if defined)

 
class _TimeParser(object)
    Class providing time-parsing functionality
 
  Class methods defined here:
parse(cls, text) from type
Takes user input and returns partial value dict
 
Defaults to 24 hours clock
 
Example inputs:
        2:13pm -> 14:13:00
        2:13 -> 2:13:00
        14:13:00 -> 14:13:00
        3pm -> 15:00:00
        4 -> 04:00:00
AM and PM formats:
        a, p, am, pm, a.m., p.m.,

Data and other attributes defined here:
AM_RE = 'a[.]?[m]?[.]?'
HOUR_RE = r'\d+'
MINUTE_RE = r'\d+'
PM_RE = 'p[.]?[m]?[.]?'
SECOND_RE = r'(\d+([.]\d+)?)|([.]\d+)'
TEMPLATE_RE = '\n\t(?P<hour>%(hour)s)\n\t(\n\t\t[:,.]\n\t\t(?P<minute>%(m...]*\n\t(\n\t\t(?P<am>%(am)s)\n\t\t|\n\t\t(?P<pm>%(pm)s)\n\t)?\n\t'
__dict__ = <dictproxy object at 0x01ACAE10>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of '_TimeParser' objects>
list of weak references to the object (if defined)

 
class mxDateTimeDelta_DT(BaseType_DT)
    Data type for an mx.DateTime.DateTimeDelta value
 
 
Method resolution order:
mxDateTimeDelta_DT
BaseType_DT
DataTypeDefinition
object

Class methods defined here:
check(cls, value) from type
Determine whether value conforms to definition
coerce(cls, value) from type
Coerce value to the appropriate data type
 
Will accept:
        DateTimeType
        string or Unicode representations (DateTimeFrom)
        float (DateTimeFromTicks)
format(cls, value) from type
Format as a string which is back-coercable
parse(cls, text) from type
Takes text (user input) and returns a DateTimeDelta object
 
Example inputs:
        2 hours, 3 days, 45 minutes
        3d2h45m
        45m
        2hours
        H:M:S (i.e. standard time format)
 
XXX should eventually allow:
        2,3,45 -> directly to the constructor (d,h,m,s)
        2h 15 -> imply order based on previous item
        2.5 -> fractional day or hour (see next note)
XXX should we take bare integer as _day_, not hour, as currently???
        seems more useful as-is, but it's not really in line
        with the base type

Data and other attributes defined here:
baseType = <type 'mx.DateTime.DateTimeDelta'>
dataType = 'datetimedelta.mx'

Class methods inherited from BaseType_DT:
factories(cls) from type
Determine a sequence of factory objects

Static methods inherited from BaseType_DT:
__new__(cls, *args, **named)
Create a new instance of our base-type

Data and other attributes inherited from DataTypeDefinition:
__dict__ = <dictproxy object at 0x01AD1090>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'DataTypeDefinition' objects>
list of weak references to the object (if defined)

 
class mxDateTime_DT(BaseType_DT)
    Data type for an mx.DateTime.DateTime value
 
 
Method resolution order:
mxDateTime_DT
BaseType_DT
DataTypeDefinition
object

Class methods defined here:
__store__(cls, value) from type
Return a stable, low-level representation of the value
 
In this case, an ISO date-string for the UTC value of the
DateTime
__unstore__(cls, value) from type
Take our opaque date-store value and convert to an instance
check(cls, value) from type
Determine whether value conforms to definition
coerce(cls, value) from type
Coerce value to the appropriate data type
 
Will accept:
        DateTimeType
        string or Unicode representations (DateTimeFrom)
        float (DateTimeFromTicks)
        time.struct_time (mktime)

Data and other attributes defined here:
baseType = <type 'mx.DateTime.DateTime'>
dataType = 'datetime.mx'

Class methods inherited from BaseType_DT:
factories(cls) from type
Determine a sequence of factory objects

Static methods inherited from BaseType_DT:
__new__(cls, *args, **named)
Create a new instance of our base-type

Data and other attributes inherited from DataTypeDefinition:
__dict__ = <dictproxy object at 0x01AD1310>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'DataTypeDefinition' objects>
list of weak references to the object (if defined)

 
class mxTimeOfDay(_TimeParser, RelativeDateTime)
    Representation of a time during a particular day
 
This implementation is simply a sub-class of
RelativeDateTime which provides the functionality
of a data-type definition
 
 
Method resolution order:
mxTimeOfDay
_TimeParser
object
RelativeDateTime

Methods defined here:
__eq__(self, other)
Are we equal to the other value?
__init__(self, years=0, months=0, days=0, hours=0, minutes=0, seconds=0, year=None, month=None, day=None, hour=None, minute=None, second=None, weekday=None, weeks=0)
__repr__(self)
Get a code-like representation of the time of day
__str__(self)
Get the string representation of the time of day

Class methods defined here:
check(cls, value) from type
Check that this is a RDT with only hour, minute and second
coerce(cls, value) from type
Coerce the value to our internal format (RelativeDateTime)
 
Accepts:
        RelativeDateTime with only hour, minute, and second values
        tuple/list with up to 4 values for (default 0):
                hour, minute, second, millisecond
        RelativeDateTime with more data (copies to new with just time data)
        DateTime (creates a RelativeDateTime for the DateTime's TimeOfDay)
        float, int or long -> bare hours values
format(cls, value) from type
Format as a string which is back-coercable

Data and other attributes defined here:
dataType = 'timeofday.mx'

Class methods inherited from _TimeParser:
parse(cls, text) from type
Takes user input and returns partial value dict
 
Defaults to 24 hours clock
 
Example inputs:
        2:13pm -> 14:13:00
        2:13 -> 2:13:00
        14:13:00 -> 14:13:00
        3pm -> 15:00:00
        4 -> 04:00:00
AM and PM formats:
        a, p, am, pm, a.m., p.m.,

Data and other attributes inherited from _TimeParser:
AM_RE = 'a[.]?[m]?[.]?'
HOUR_RE = r'\d+'
MINUTE_RE = r'\d+'
PM_RE = 'p[.]?[m]?[.]?'
SECOND_RE = r'(\d+([.]\d+)?)|([.]\d+)'
TEMPLATE_RE = '\n\t(?P<hour>%(hour)s)\n\t(\n\t\t[:,.]\n\t\t(?P<minute>%(m...]*\n\t(\n\t\t(?P<am>%(am)s)\n\t\t|\n\t\t(?P<pm>%(pm)s)\n\t)?\n\t'
__dict__ = <dictproxy object at 0x01AD11F0>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of '_TimeParser' objects>
list of weak references to the object (if defined)

Methods inherited from RelativeDateTime:
__add__(self, other, isinstance=<built-in function isinstance>)
__div__(self, other)
__mul__(self, other)
__neg__(self)
__nonzero__(self)
__radd__(self, other, isinstance=<built-in function isinstance>, DateTimeType=<type 'mx.DateTime.DateTime'>, DateTime=<built-in function DateTime>, DateTimeDelta=<built-in function DateTimeDelta>)
__rmul__ = __mul__(self, other)
__rsub__(self, other, isinstance=<built-in function isinstance>, DateTimeType=<type 'mx.DateTime.DateTime'>)
__sub__(self, other)

Data and other attributes inherited from RelativeDateTime:
__allow_access_to_unprotected_subobjects__ = 1
__roles__ = None
day = 0
days = 0
hour = None
hours = 0
minute = None
minutes = 0
month = 0
months = 0
second = None
seconds = 0
weekday = None
year = None
years = 0

 
Functions
       
Date = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions. Note that the function does not accept keyword args.
DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions. Note that the function does not accept keyword args.
DateTimeDelta(...)
DateTimeDelta(days[,hours=0.0,minutes=0.0,seconds=0.0])
 
Returns a DateTimeDelta-object reflecting the given
day and time delta.  Note that the function does not accept
keyword args.
DateTimeDeltaFromDays(...)
DateTimeDeltaFromDays(days)
 
Returns a DateTimeDelta-object reflecting the given time
value given in days (fractions are allowed).
DateTimeDeltaFromSeconds(...)
DateTimeDeltaFromSeconds(seconds)
 
Returns a DateTimeDelta-object reflecting the given time
value.
DateTimeFromAbsDateTime(...)
DateTimeFromAbsDateTime(absdate[,abstime=0.0])
 
Returns a DateTime-object for the given absolute values.
Note that the function does not accept keyword args.
DateTimeFromAbsDays(...)
DateTimeFromAbsDays(absdays)
 
Returns a DateTime-object reflecting the given time
value (days since the epoch).
DateTimeFromCOMDate(...)
DateTimeFromCOMDate(comdate)
 
Returns a DateTime-object reflecting the given date
and time.
GregorianDate = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions. Note that the function does not accept keyword args.
GregorianDateTime = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions. Note that the function does not accept keyword args.
JulianDate = JulianDateTime(...)
JulianDateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given Julian date
and time. Seconds can be given as float to indicate
fractions.  Note that the function does not accept keyword args.
JulianDateTime(...)
JulianDateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given Julian date
and time. Seconds can be given as float to indicate
fractions.  Note that the function does not accept keyword args.
Timestamp = DateTime(...)
DateTime(year,month=1,day=1,hour=0,minute=0,second=0.0)
 
Returns a DateTime-object reflecting the given date
and time. Seconds can be given as float to indicate
fractions. Note that the function does not accept keyword args.
cmp(...)
cmp(value1,value2[,accuracy=0.0])
 
Compares two DateTime[Delta] objects. If accuracy is
given, then equality will result in case the absolute
difference between the two values is less than or equal
to accuracy.
gmt = utc(...)
utc()
 
Returns a DateTime-object reflecting the current UTC time.
now(...)
now()
 
Returns a DateTime-object reflecting the current local time.
setnowapi(...)
setnowapi(fct)
 
Sets the current time API used by now(). This must be
a callable function which returns the current local time in
Unix ticks.
utc(...)
utc()
 
Returns a DateTime-object reflecting the current UTC time.

 
Data
        ARPA = <LazyModule 'mx.DateTime.ARPA'>
April = 4
August = 8
December = 12
Epoch = <mx.DateTime.DateTime object for '0001-01-01 00:00:00.00' at 1311320>
Feasts = <LazyModule 'mx.DateTime.Feasts'>
February = 2
Friday = 4
Gregorian = 'Gregorian'
ISO = <LazyModule 'mx.DateTime.ISO'>
January = 1
Julian = 'Julian'
July = 7
June = 6
Locale = <LazyModule 'mx.DateTime.Locale'>
March = 3
MaxDateTime = <mx.DateTime.DateTime object for '5867440-12-31 00:00:00.00' at 13116e0>
MaxDateTimeDelta = <mx.DateTime.DateTimeDelta object for '2147483647:00:00:00.00' at 1312980>
May = 5
MinDateTime = <mx.DateTime.DateTime object for '-5851455-01-01 00:00:00.00' at 13119e0>
MinDateTimeDelta = <mx.DateTime.DateTimeDelta object for '-2147483647:00:00:00.00' at 13129a8>
Monday = 0
Month = {None: 0, 0: None, 1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', ...}
NIST = <LazyModule 'mx.DateTime.NIST'>
November = 11
ODMG = <LazyModule 'mx.DateTime.ODMG'>
October = 10
POSIX = 1
Parser = <LazyModule 'mx.DateTime.Parser'>
Saturday = 5
September = 9
Sunday = 6
Thursday = 3
Tuesday = 1
Wednesday = 2
Weekday = {0: 'Monday', 1: 'Tuesday', 2: 'Wednesday', 3: 'Thursday', 4: 'Friday', 5: 'Saturday', 6: 'Sunday', 'Friday': 4, 'Monday': 0, 'Saturday': 5, ...}
__all__ = ('mxDateTime_DT', 'mxDateTimeDelta_DT', 'mxTimeOfDay', 'RelativeDateTime')
current_myriad = 245
mxDateTimeAPI = <PyCObject object at 0x0076A650>
oneDay = <mx.DateTime.DateTimeDelta object for '1:00:00:00.00' at 1312890>
oneHour = <mx.DateTime.DateTimeDelta object for '01:00:00.00' at 1312868>
oneMinute = <mx.DateTime.DateTimeDelta object for '00:01:00.00' at 1312818>
oneSecond = <mx.DateTime.DateTimeDelta object for '00:00:01.00' at 13079a8>
oneWeek = <mx.DateTime.DateTimeDelta object for '7:00:00:00.00' at 13128b8>