Diff for "API/launchpadlib/code_snippets"

Not logged in - Log In / Register

Differences between revisions 2 and 3
Revision 2 as of 2009-02-24 18:05:21
Size: 1124
Editor: a89-182-14-148
Comment:
Revision 3 as of 2009-02-24 18:52:16
Size: 1122
Editor: host80-43-dynamic
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 6: Line 5:
'''''(Under sonstruction)''''' '''''(Under construction)'''''

code snippets

(Under construction)

This page lists some useful pieces of code

Bugs

Does a bug have a release target?

    >>> def has_target(bug, series):
    ...     series_url = str(series)
    ...     for task in bug.bug_tasks:
    ...         if str(task).startswith(series_url):
    ...             return True
    ...     return False
    ...
    >>> b = launchpad.bugs[324614]
    >>> ubuntu = launchpad.distributions["ubuntu"]
    >>> jaunty = ubuntu.getSeries(name_or_version="jaunty")
    >>> has_target(b, jaunty)
    True

Packages

listing the current package versions in a particular distroseries

    >>> ubuntu = launchpad.distributions["ubuntu"]
    >>> archive = ubuntu.main_archive
    >>> series = ubuntu.current_series
    >>> archive.getPublishedSources(exact_match=True, source_name="apport", distro_series=series)[0].source_package_version
    u'0.123'

API/launchpadlib/code_snippets (last edited 2009-11-25 20:19:27 by 70-8-217-239)