Package daklib :: Module formats
[hide private]
[frames] | no frames]

Module formats

source code

Helper functions for the various changes formats


Contact: Debian FTPMaster <ftpmaster@debian.org>

Copyright:

License: GNU General Public License version 2 or later

Functions [hide private]
tuple
parse_format(txt)
Parse a .changes Format string into a tuple representation for easy comparison.
source code
 
validate_changes_format(format, field)
Validate a tuple-representation of a .changes Format: field.
source code
Variables [hide private]
  __package__ = 'daklib'

Imports: re_verwithext, UnknownFormatError


Function Details [hide private]

parse_format(txt)

source code 

Parse a .changes Format string into a tuple representation for easy comparison.

>>> parse_format('1.0')
(1, 0)
>>> parse_format('8.4 (hardy)')
(8, 4, 'hardy')

If the format doesn't match these forms, raises UnknownFormatError.

Parameters:
  • txt (string) - Format string to parse
Returns: tuple
Parsed format
Raises:

validate_changes_format(format, field)

source code 

Validate a tuple-representation of a .changes Format: field. Raises UnknownFormatError if the field is invalid, otherwise return type is undefined.