Package gbp :: Package deb :: Module format :: Class DebianSourceFormat
[hide private]
[frames] | no frames]

Class DebianSourceFormat

object --+
         |
        DebianSourceFormat

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):
...
DebianSourceFormatError: Cannot get source format from '1.0 broken'
Instance Methods [hide private]
 
_parse(self, content)
 
__init__(self, content)
x.__init__(...) initializes x; see help(type(x)) for signature

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
DebianSourceFormat
>>> import tempfile, os
>>> with tempfile.NamedTemporaryFile(delete=False) as t:
...    t.write("3.0 (quilt)")
>>> d = DebianSourceFormat.parse_file(t.name)
>>> d.version
'3.0'
>>> d.type
'quilt'
>>> os.unlink(t.name)
parse_file(klass, filename)
Parse debian/source/format file
Properties [hide private]
  version
The source format version number
  type
The 'type' (e.g.

Inherited from object: __class__

Method Details [hide private]

__init__(self, content)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

parse_file(klass, filename)
Class Method

 

Parse debian/source/format file

Parameters:
  • filename (str) - the file to parse
Returns: DebianSourceFormat
>>> import tempfile, os
>>> with tempfile.NamedTemporaryFile(delete=False) as t:
...    t.write("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

Property Details [hide private]

version

The source format version number

Get Method:
unreachable.version(self) - The source format version number

type

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

Get Method:
unreachable.type(self) - The 'type' (e.g.