Exemplo n.º 1
0
 def standardise(self):
     """Format self.value into a standard representation."""
     try:
         self.value = str(interval_parse(self.value))
     except IsodatetimeError:
         raise IntervalParsingError(type(self), self.value)
     return self
Exemplo n.º 2
0
 def __init__(self, value):
     if (not isinstance(value, str) or
             not REC_INTERVAL.search(value)):
         raise IntervalParsingError("IntegerInterval", repr(value))
     super(IntegerInterval, self).__init__(value)