class documentation

class DebianSourceFormat(object):

View In Hierarchy

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_content Write a format file from type and format at format_file
Class Method parse_file Parse debian/source/format file
Method __init__ Undocumented
Method __str__ Undocumented
Class Variable format_file 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
@classmethod
def from_content(cls, version, type, format_file=None):

Write a format file from type and format at format_file

Parameters
versionthe source package format version
typethe format type
format_filethe format file to create with the above parameters
@classmethod
def parse_file(cls, filename):

Parse debian/source/format file

Parameters
filename:strthe file to parse
Returns

DebianSourceFormat

>>> 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
def __init__(self, content):

Undocumented

def __str__(self):

Undocumented

format_file: str =

Undocumented

@property
type =

The 'type' (e.g. git, native)

@property
version =

The source format version number

def _parse(self, content):

Undocumented

_type =

Undocumented

_version =

Undocumented