Package gbp :: Package deb :: Module uscan :: Class Uscan

[hide private]
[frames] | no frames]

# Class Uscan

    object --+
             |
            Uscan

Instance Methods | [hide private]

__init__(self, dir=`'``.``'`) x.__init__(...) initializes x; see help(type(x)) for signature |

_parse(self, out) Parse the uscan output return and update the object's properties |

_parse_uptodate(self, out) Check if the uscan reports that we're up to date. |

_raise_error(self, out) Parse the uscan output for errors and warnings and raise a UscanError exception based on this. |

scan(self, destdir=`'``..``'`) Invoke uscan to fetch a new upstream version |

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

Class Variables | [hide private]

| cmd = ``'``/usr/bin/uscan``'``

Properties | [hide private]

| uptodate
| tarball
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, dir=`'``.``'`)
(Constructor)

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

Overrides: object.__init__
  (inherited documentation)

### _parse(self, out)

Parse the uscan output return and update the object's properties

Parameters:
  - `out` (string

        >>> u = Uscan('http://example.com/')
        >>> u._parse('<target>virt-viewer_0.4.0.orig.tar.gz</target>')
        >>> u.tarball
        '../virt-viewer_0.4.0.orig.tar.gz'
        >>> u.uptodate
        False
        >>> u._parse('')
        Traceback (most recent call last):
        ...
        UscanError: Couldn't find 'upstream-url' in uscan output

    ) - uscan output

### _parse_uptodate(self, out)

Check if the uscan reports that we're up to date.

Parameters:
  - `out` (string

        >>> u = Uscan('http://example.com/')
        >>> u._parse_uptodate('<status>up to date</status>')
        >>> u.tarball
        >>> u.uptodate
        True
        >>> u._parse_uptodate('')
        >>> u.tarball
        >>> u.uptodate
        False

    ) - uscan output

### _raise_error(self, out)

Parse the uscan output for errors and warnings and raise a UscanError exception based on this. If no error detail is found a generic error message is used.

Parameters:
  - `out` (string) - uscan output
Raises:
  - `UscanError` - exception raised

        >>> u = Uscan('http://example.com/')
        >>> u._raise_error("<warnings>uscan warning: "
        ... "In watchfile debian/watch, reading webpage\n"
        ... "http://a.b/ failed: 500 Cant connect "
        ... "to example.com:80 (Bad hostname)</warnings>")
        Traceback (most recent call last):
        ...
        UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage
        http://a.b/ failed: 500 Cant connect to example.com:80 (Bad hostname)
        >>> u._raise_error("<errors>uscan: Can't use --verbose if "
        ... "you're using --dehs!</errors>")
        Traceback (most recent call last):
        ...
        UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
        >>> u = u._raise_error('')
        Traceback (most recent call last):
        ...
        UscanError: Uscan failed - debug by running 'uscan --verbose'

Property Details | [hide private]

### uptodate

Get Method:
  unreachable.uptodate(self)

### tarball

Get Method:
  unreachable.tarball(self)