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

Stand-alone type-definition objects for date-based data types
 
Three possible sources (1 implemented):
 
        * mx.DateTime (prefered, and implemented)
        * Python 2.3 datetime
        * standard time module (least interesting)
 
XXX Would be nice to get a Python 2.3 datetime module
implementation, but it's pretty low on my list of
priorities

 
Modules
       
mx.DateTime

 
Classes
       
Enumeration(Propertied)
Month
MonthAbbr
WeekDay
WeekDayAbbr

 
class Month(Enumeration)
    Locale-specific month enumeration
 
Uses calendar/mx.DateTime standard of January=1,
December = 12
 
 
Method resolution order:
Month
Enumeration
Propertied
object

Class methods defined here:
allInstances(cls) from type
Return cls instances for each of this class's set

Data and other attributes defined here:
data = [('January', 1), ('February', 2), ('March', 3), ('April', 4), ('May', 5), ('June', 6), ('July', 7), ('August', 8), ('September', 9), ('October', 10), ('November', 11), ('December', 12)]
dataType = 'enumeration.month'
set = {u'February': EnumerationChoice( name=u'February...: EnumerationChoice( name=u'November', value=11)}

Methods inherited from Enumeration:
__cmp__(self, other)
Compare this value to another value
__init__(self, name='', *arguments, **named)
__repr__(self)
Return a code-like representation of this object
choice(self)
Get the choice object associated with this value or None
value(self)
Get the value associated with this choice

Class methods inherited from Enumeration:
check(cls, value) from type
Check whether value is of cls type, and has the same set
coerce(cls, value) from type
Coerce a value into an Enumeration value
 
Accepted types:
        Enumeration objects
        integers/longs
        ([name,name,name],remainder) tuples
        [name,name,name,value] lists (values are |'d together)
fromValue(cls, value) from type
Create from an integer value
parse(cls, value) from type
Create from a string value
 
Possible formats:
        "coreName"
        "23"
        "friendlyName"

Data and other attributes inherited from Enumeration:
name = <BasicProperty 'name'>
Data-value choice within one of our sets

Methods inherited from Propertied:
__str__(self)
Get a friendly representation of the object
clone(self, **newValues)
Clone this object, with optional new property values
 
This method calls the __init__ method of your class with
the current property values of your class.  Providing newValues
(a dictionary) overrides property settings with new values.
getCloneProperties(self)
Get properties dictionary (key:value) for use in cloning of the instance
 
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
toString(self, indentation='', alreadyDone=None, indentString=' ')
Get a nicely formatted representation of this object
 
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
 
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
 
XXX Needs a far better API, likely a stand-alone class
        without the automatic inheritance problems here :(

Class methods inherited from Propertied:
getProperties(cls) from type
Get the BasicProperty properties for a particular object's class

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

 
class MonthAbbr(Enumeration)
    Locale-specific month (abbreviated) enumeration
 
Uses calendar/mx.DateTime standard of January=1,
December = 12
 
 
Method resolution order:
MonthAbbr
Enumeration
Propertied
object

Class methods defined here:
allInstances(cls) from type
Return cls instances for each of this class's set

Data and other attributes defined here:
dataType = 'enumeration.month.abbr'
set = {u'Mar': EnumerationChoice( name=u'Mar', value=3...'Oct': EnumerationChoice( name=u'Oct', value=10)}

Methods inherited from Enumeration:
__cmp__(self, other)
Compare this value to another value
__init__(self, name='', *arguments, **named)
__repr__(self)
Return a code-like representation of this object
choice(self)
Get the choice object associated with this value or None
value(self)
Get the value associated with this choice

Class methods inherited from Enumeration:
check(cls, value) from type
Check whether value is of cls type, and has the same set
coerce(cls, value) from type
Coerce a value into an Enumeration value
 
Accepted types:
        Enumeration objects
        integers/longs
        ([name,name,name],remainder) tuples
        [name,name,name,value] lists (values are |'d together)
fromValue(cls, value) from type
Create from an integer value
parse(cls, value) from type
Create from a string value
 
Possible formats:
        "coreName"
        "23"
        "friendlyName"

Data and other attributes inherited from Enumeration:
name = <BasicProperty 'name'>
Data-value choice within one of our sets

Methods inherited from Propertied:
__str__(self)
Get a friendly representation of the object
clone(self, **newValues)
Clone this object, with optional new property values
 
This method calls the __init__ method of your class with
the current property values of your class.  Providing newValues
(a dictionary) overrides property settings with new values.
getCloneProperties(self)
Get properties dictionary (key:value) for use in cloning of the instance
 
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
toString(self, indentation='', alreadyDone=None, indentString=' ')
Get a nicely formatted representation of this object
 
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
 
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
 
XXX Needs a far better API, likely a stand-alone class
        without the automatic inheritance problems here :(

Class methods inherited from Propertied:
getProperties(cls) from type
Get the BasicProperty properties for a particular object's class

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

 
class WeekDay(Enumeration)
    Locale-specific day-of-week enumeration
 
Uses both calendar and mx.DateTime's standard of
Monday = 0, Sunday = 6
 
 
Method resolution order:
WeekDay
Enumeration
Propertied
object

Class methods defined here:
allInstances(cls) from type
Return cls instances for each of this class's set

Data and other attributes defined here:
dataType = 'enumeration.weekday'
set = {u'Monday': EnumerationChoice( name=u'Monday', v...': EnumerationChoice( name=u'Saturday', value=5)}

Methods inherited from Enumeration:
__cmp__(self, other)
Compare this value to another value
__init__(self, name='', *arguments, **named)
__repr__(self)
Return a code-like representation of this object
choice(self)
Get the choice object associated with this value or None
value(self)
Get the value associated with this choice

Class methods inherited from Enumeration:
check(cls, value) from type
Check whether value is of cls type, and has the same set
coerce(cls, value) from type
Coerce a value into an Enumeration value
 
Accepted types:
        Enumeration objects
        integers/longs
        ([name,name,name],remainder) tuples
        [name,name,name,value] lists (values are |'d together)
fromValue(cls, value) from type
Create from an integer value
parse(cls, value) from type
Create from a string value
 
Possible formats:
        "coreName"
        "23"
        "friendlyName"

Data and other attributes inherited from Enumeration:
name = <BasicProperty 'name'>
Data-value choice within one of our sets

Methods inherited from Propertied:
__str__(self)
Get a friendly representation of the object
clone(self, **newValues)
Clone this object, with optional new property values
 
This method calls the __init__ method of your class with
the current property values of your class.  Providing newValues
(a dictionary) overrides property settings with new values.
getCloneProperties(self)
Get properties dictionary (key:value) for use in cloning of the instance
 
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
toString(self, indentation='', alreadyDone=None, indentString=' ')
Get a nicely formatted representation of this object
 
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
 
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
 
XXX Needs a far better API, likely a stand-alone class
        without the automatic inheritance problems here :(

Class methods inherited from Propertied:
getProperties(cls) from type
Get the BasicProperty properties for a particular object's class

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

 
class WeekDayAbbr(Enumeration)
    Locale-specific day-of-week (abbreviated) enumeration
 
Uses both calendar and mx.DateTime's standard of
Mon = 0, Sun = 6
 
 
Method resolution order:
WeekDayAbbr
Enumeration
Propertied
object

Class methods defined here:
allInstances(cls) from type
Return cls instances for each of this class's set

Data and other attributes defined here:
dataType = 'enumeration.weekday.abbr'
set = {u'Wed': EnumerationChoice( name=u'Wed', value=2...u'Sat': EnumerationChoice( name=u'Sat', value=5)}

Methods inherited from Enumeration:
__cmp__(self, other)
Compare this value to another value
__init__(self, name='', *arguments, **named)
__repr__(self)
Return a code-like representation of this object
choice(self)
Get the choice object associated with this value or None
value(self)
Get the value associated with this choice

Class methods inherited from Enumeration:
check(cls, value) from type
Check whether value is of cls type, and has the same set
coerce(cls, value) from type
Coerce a value into an Enumeration value
 
Accepted types:
        Enumeration objects
        integers/longs
        ([name,name,name],remainder) tuples
        [name,name,name,value] lists (values are |'d together)
fromValue(cls, value) from type
Create from an integer value
parse(cls, value) from type
Create from a string value
 
Possible formats:
        "coreName"
        "23"
        "friendlyName"

Data and other attributes inherited from Enumeration:
name = <BasicProperty 'name'>
Data-value choice within one of our sets

Methods inherited from Propertied:
__str__(self)
Get a friendly representation of the object
clone(self, **newValues)
Clone this object, with optional new property values
 
This method calls the __init__ method of your class with
the current property values of your class.  Providing newValues
(a dictionary) overrides property settings with new values.
getCloneProperties(self)
Get properties dictionary (key:value) for use in cloning of the instance
 
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
toString(self, indentation='', alreadyDone=None, indentString=' ')
Get a nicely formatted representation of this object
 
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
 
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
 
XXX Needs a far better API, likely a stand-alone class
        without the automatic inheritance problems here :(

Class methods inherited from Propertied:
getProperties(cls) from type
Get the BasicProperty properties for a particular object's class

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

 
Functions
       
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.
allInstances(cls)
Return cls instances for each of this class's set
now(...)
now()
 
Returns a DateTime-object reflecting the current local time.

 
Data
        haveImplementation = 1
haveMX = 1