| | |
- __builtin__.dict(__builtin__.object)
-
- TimeRE
- __builtin__.object
-
- LocaleTime
class LocaleTime(__builtin__.object) |
| |
Stores and handles locale-specific information related to time.
This is not thread-safe! Attributes are lazily calculated and no
precaution is taken to check to see if the locale information has changed
since the creation of the instance in use.
ATTRIBUTES (all read-only after instance creation! Instance variables that
store the values have mangled names):
f_weekday -- full weekday names (7-item list)
a_weekday -- abbreviated weekday names (7-item list)
f_month -- full month names (13-item list; dummy value in [0], which
is added by code)
a_month -- abbreviated month names (13-item list, dummy value in
[0], which is added by code)
am_pm -- AM/PM representation (2-item list)
LC_date_time -- format string for date/time representation (string)
LC_date -- format string for date representation (string)
LC_time -- format string for time representation (string)
timezone -- daylight- and non-daylight-savings timezone representation
(3-item list; code tacks on blank item at end for
possible lack of timezone such as UTC)
lang -- Language used by instance (string) |
| |
Methods defined here:
- __init__(self, f_weekday=None, a_weekday=None, f_month=None, a_month=None, am_pm=None, LC_date_time=None, LC_time=None, LC_date=None, timezone=None, lang=None)
- Optionally set attributes with passed-in values.
Properties defined here:
- LC_date
- Format string for locale's date representation ('%x' format)
- get = __get_LC_date(self)
- set = __set_nothing(self, stuff)
- LC_date_time
- Format string for locale's date/time representation ('%c' format)
- get = __get_LC_date_time(self)
- set = __set_nothing(self, stuff)
- LC_time
- Format string for locale's time representation ('%X' format)
- get = __get_LC_time(self)
- set = __set_nothing(self, stuff)
- a_month
- Abbreviated month names (dummy value at index 0)
- get = __get_a_month(self)
- set = __set_nothing(self, stuff)
- a_weekday
- Abbreviated weekday names
- get = __get_a_weekday(self)
- set = __set_nothing(self, stuff)
- am_pm
- AM/PM representation
- get = __get_am_pm(self)
- set = __set_nothing(self, stuff)
- f_month
- Full month names (dummy value at index 0)
- get = __get_f_month(self)
- set = __set_nothing(self, stuff)
- f_weekday
- Full weekday names
- get = __get_f_weekday(self)
- set = __set_nothing(self, stuff)
- lang
- Language used for instance
- get lambda self
- set = __set_nothing(self, stuff)
- timezone
- Timezone representation (dummy value at index 2)
- get = __get_timezone(self)
- set = __set_nothing(self, stuff)
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'LocaleTime' objects>
- list of weak references to the object (if defined)
|
class TimeRE(__builtin__.dict) |
| |
Handle conversion from format directives to regexes. |
| |
- Method resolution order:
- TimeRE
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __getitem__(self, fetch)
- Try to fetch regex; if it does not exist, construct it.
- __init__(self, locale_time=None)
- Init inst with non-locale regexes and store LocaleTime object.
- compile(self, format)
- Return a compiled re object for the format string.
- pattern(self, format)
- Return re pattern for the format string.
Need to make sure that any characters that might be interpreted as
regex syntax is escaped.
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'TimeRE' objects>
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k]
- values(...)
- D.values() -> list of D's values
Data and other attributes inherited from __builtin__.dict:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- fromkeys = <built-in method fromkeys of type object>
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
| |