Public Member Functions | |
def | convert_to_seconds |
def | fromtimedelta |
def | parse |
Static Public Attributes | |
tuple | regexp |
Hideously ugly regular expression to parse the complex text form. |
Timedelta with text parsing. This accepts two input formats: - A simple integer, indicating a number of seconds. - A string of the form "wD xH yM zS" where w, x, y, and z are integers and D, H, M, and S indicate days, hours, minutes, and seconds. All of the fields are optional, but at least one must be specified. Eg, "3D4H" means "three days plus four hours".
Definition at line 174 of file sundial.py.
def rpki.sundial.timedelta.convert_to_seconds | ( | self | ) |
def rpki.sundial.timedelta.fromtimedelta | ( | cls, | ||
x | ||||
) |
def rpki.sundial.timedelta.parse | ( | cls, | ||
arg | ||||
) |
rpki::sundial.timedelta::regexp [static] |
Initial value:
re.compile("\\s*".join(("^", "(?:(?P<days>\\d+)D)?", "(?:(?P<hours>\\d+)H)?", "(?:(?P<minutes>\\d+)M)?", "(?:(?P<seconds>\\d+)S)?", "$")), re.I)
Tags are intended for use with re.MatchObject.groupdict() and map directly to the keywords expected by the timedelta constructor.
Definition at line 191 of file sundial.py.