Exemplo n.º 1
0
 def standardise(self):
     """Format self.value into a standard representation and check it."""
     try:
         self.value = str(int(self))
     except (TypeError, ValueError) as exc:
         raise PointParsingError(type(self), self.value, exc)
     return self
Exemplo n.º 2
0
 def standardise(self):
     """Reformat self.value into a standard representation."""
     try:
         self.value = str(point_parse(self.value))
     except IsodatetimeError as exc:
         if self.value.startswith("+") or self.value.startswith("-"):
             message = WARNING_PARSE_EXPANDED_YEAR_DIGITS % (
                 WorkflowSpecifics.NUM_EXPANDED_YEAR_DIGITS)
         else:
             message = str(exc)
         raise PointParsingError(type(self), self.value, message)
     return self