1 from regexes import re_verwithext
2 from dak_exceptions import UnknownFormatError
6 Parse a .changes Format string into a tuple representation for easy
9 >>> parse_format('1.0')
11 >>> parse_format('8.4 (hardy)')
14 If the format doesn't match these forms, raises UnknownFormatError.
17 format = re_verwithext.search(txt)
20 raise UnknownFormatError, txt
22 format = format.groups()
25 format = int(float(format[0])), 0, format[2]
27 format = int(format[0]), int(format[1]), format[2]