Пример #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
Пример #2
0
 def standardise(self):
     """Reformat self.value into a standard representation."""
     try:
         self.value = str(point_parse(self.value))
     except ValueError as exc:
         if self.value.startswith("+") or self.value.startswith("-"):
             message = WARNING_PARSE_EXPANDED_YEAR_DIGITS % (
                 SuiteSpecifics.NUM_EXPANDED_YEAR_DIGITS)
         else:
             message = str(exc)
         raise PointParsingError(type(self), self.value, message)
     return self