| |
- 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
| |