class documentation
class DebianSourceFormat(object):
Contents of debian/source/format
>>> d = DebianSourceFormat("3.0 (quilt)") >>> d.type 'quilt' >>> d.version '3.0' >>> d = DebianSourceFormat("3.0 (native)") >>> d.type 'native' >>> d = DebianSourceFormat("1.0") >>> d.type >>> d.version '1.0' >>> d = DebianSourceFormat("1.0 broken") Traceback (most recent call last): ... gbp.deb.format.DebianSourceFormatError: Cannot get source format from '1.0 broken'
Class Method | from |
Write a format file from type and format at format_file |
Class Method | parse |
Parse debian/source/format file |
Method | __init__ |
Undocumented |
Method | __str__ |
Undocumented |
Class Variable | format |
Undocumented |
Property | type |
The 'type' (e.g. git, native) |
Property | version |
The source format version number |
Method | _parse |
Undocumented |
Instance Variable | _type |
Undocumented |
Instance Variable | _version |
Undocumented |
Write a format file from type and format at format_file
Parameters | |
version | the source package format version |
type | the format type |
format | the format file to create with the above parameters |
Parse debian/source/format file
Parameters | |
filename:str | the file to parse |
Returns | |
>>> import tempfile, os >>> with tempfile.NamedTemporaryFile(delete=False) as t: ... ret = t.write(b"3.0 (quilt)") >>> d = DebianSourceFormat.parse_file(t.name) >>> d.version '3.0' >>> d.type 'quilt' >>> os.unlink(t.name) | a debisn/source/format object |