Module _strptime :: Class TimeRE
[hide private]
[frames] | no frames]

type TimeRE

object --+    
         |    
      dict --+
             |
            TimeRE

Handle conversion from format directives to regexes.

Instance Methods [hide private]
new empty dictionary

__init__(self, locale_time=None)
Create keys/values.
 
__seqToRE(self, to_convert, directive)
Convert a list to a regex string for matching a directive.
 
pattern(self, format)
Return regex pattern for the format string.
 
compile(self, format)
Return a compiled re object for the format string.

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Method Details [hide private]

__init__(self, locale_time=None)
(Constructor)

 

Create keys/values.

Order of execution is important for dependency reasons.

Returns:
new empty dictionary

Overrides: dict.__init__

__seqToRE(self, to_convert, directive)

 

Convert a list to a regex string for matching a directive.

Want possible matching values to be from longest to shortest. This prevents the possibility of a match occuring for a value that also a substring of a larger value that should have matched (e.g., 'abc' matching when 'abcdef' should have been the match).

pattern(self, format)

 

Return regex pattern for the format string.

Need to make sure that any characters that might be interpreted as regex syntax are escaped.