rpki.sundial.timedelta Class Reference

Inheritance diagram for rpki.sundial.timedelta:

Inheritance graph

List of all members.

Public Member Functions

def convert_to_seconds
def parse

Static Public Attributes

tuple regexp
 Hideously ugly regular expression to parse the complex text form.


Detailed Description

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 137 of file sundial.py.


Member Function Documentation

def rpki.sundial.timedelta.convert_to_seconds (   self  ) 

Convert a timedelta interval to seconds.

Definition at line 168 of file sundial.py.

def rpki.sundial.timedelta.parse (   cls,
  arg 
)

Parse text into a timedelta object.

Definition at line 159 of file sundial.py.


Member Data Documentation

Initial value:

re.compile("\\s*(?:(?P<days>\\d+)D)?" +
                      "\\s*(?:(?P<hours>\\d+)H)?" +
                      "\\s*(?:(?P<minutes>\\d+)M)?" +
                      "\\s*(?:(?P<seconds>\\d+)S)?\\s*", re.I)
Hideously ugly regular expression to parse the complex text form.

Tags are intended for use with re.MatchObject.groupdict() and map directly to the keywords expected by the timedelta constructor.

Definition at line 153 of file sundial.py.


The documentation for this class was generated from the following file:

Generated on Mon Jun 16 22:22:52 2008 for RPKI Engine by  doxygen 1.5.5