gbp.deb.uscan.Uscan(object) class documentationgbp.deb.uscan
(View In Hierarchy)
| Method | __init__ | Undocumented |
| Method | uptodate | Undocumented |
| Method | tarball | Undocumented |
| Method | scan | Invoke uscan to fetch a new upstream version |
| Method | _parse | Parse the uscan output return and update the object's properties |
| Method | _parse_uptodate | Check if the uscan reports that we're up to date. |
| Method | _raise_error | Parse the uscan output for errors and warnings and raise a L{UscanError} exception based on this. If no error detail is found a generic error message is used. |
Parse the uscan output return and update the object's properties
@param out: uscan output
@type 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):
...
gbp.deb.uscan.UscanError: Couldn't find 'upstream-url' in uscan output
Check if the uscan reports that we're up to date.
@param out: uscan output
@type out: string
@returns: C{True} if package is uptodate
>>> u = Uscan('http://example.com/')
>>> u._parse_uptodate('<status>up to date</status>')
True
>>> u.tarball
>>> u.uptodate
True
>>> u._parse_uptodate('')
False
>>> u.tarball
>>> u.uptodate
False
Parse the uscan output for errors and warnings and raise
a L{UscanError} exception based on this. If no error detail
is found a generic error message is used.
@param out: uscan output
@type out: string
@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):
...
gbp.deb.uscan.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):
...
gbp.deb.uscan.UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
>>> u = u._raise_error('')
Traceback (most recent call last):
...
gbp.deb.uscan.UscanError: Uscan failed - debug by running 'uscan --verbose'