BugList

Differences between revisions 1 and 7 (spanning 6 versions)
Revision 1 as of 2007-07-02 08:16:26
Size: 1301
Editor: vpn126
Comment:
Revision 7 as of 2007-07-05 14:36:58
Size: 2236
Editor: vpn173
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from BugHelper/Dev/python-launchpad-bugs/API changes/BugList example
Line 4: Line 5:
''' Usage of `LaunchpadConnector` and setting authentification: '''
{{{ import launchpadBugs.Connector as Connector
''' Use `LaunchpadConnector` and setting authentification: '''
{{{ import launchpadbugs.connector as Connector
Line 12: Line 13:
{{{ l = bl.BugList("https://bugs.launchpad.net/ubuntu/+source/bughelper/+bugs") {{{ l = BugList("https://bugs.launchpad.net/ubuntu/+source/bughelper/+bugs")
Line 21: Line 22:
{{{ 88521 https://bugs.launchpad.net/ubuntu/+source/bughelper/+bug/88521 selectively pulling attachments by name Medium Incomplete None

88102 https://bugs.launchpad.net/ubuntu/+source/bughelper/+bug/88102 sort report by issue type rather than bug number Undecided Confirmed None
}}}
Line 23: Line 28:
{{{ l += bl.BugList("https://bugs.launchpad.net/bughelper/+bugs") {{{ l += BugList("https://bugs.launchpad.net/bughelper/+bugs")
Line 25: Line 30:
}}}
{{{ set([109628, 110937, 88521, 88102, 84723, 88102, 81291, 85152, 88521, 90084, 109547])
Line 28: Line 35:
{{{ bl.set_filter(minbug=100000, filterbug="117701,109628", status="New") {{{ BugList.set_filter(minbug=100000, filterbug="117701,109628", status="New")
Line 32: Line 39:

''' add LP urloptions to an url '''
{{{ a = bl.BugList("https://launchpad.net/ubuntu/+source/apport/+bugs?%s" %bl.URLOPT)
print a.bugs
{{{ set([110937, 109547])
Line 41: Line 45:
{{{ [109547, 110937]
}}}
Line 42: Line 48:
''' Raising LPUrlError for invalid urls ''' ''' add LP urloptions to an url '''
{{{ a = BugList("https://launchpad.net/ubuntu/+source/apport/+bugs?%s" %BugList.URLOPT)
print a.bugs
}}}
{{{ set([123180, 122818, 123394, 119270, 123440, 87364, 105224, 108482, 95504, 114215, 118407, 118827, 119104, 95822, 121121, 121341, 122196, 123216, 122274, 122347, 122522, 122798, 89916, 122882, 94130, 122859, 123062])
}}}

''' Raising `LPUrlError` for invalid urls '''
Line 44: Line 57:
    a = bl.BugList("https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs")     a = BugList("https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs")
Line 46: Line 59:
except bl.LPURLERROR, e: except BugList.Error.LPUrlError, e:
Line 49: Line 62:
{{{
"'Page not found (url: https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs)'"
}}}


----
Go Back to '''[:BugHelper/Dev]'''.[[BR]]
CategoryBugHelper

This is still work in progress

Example usage of BugList

Use LaunchpadConnector and setting authentification: {{{ import launchpadbugs.connector as Connector

BugList = Connector.ConnectBugList() BugList.authentification = "cookie.txt" }}}

Getting a list of bugs and print available information: {{{ l = BugList("https://bugs.launchpad.net/ubuntu/+source/bughelper/+bugs") for i in l.bugs:

  • print i.bugnumber, print i.url, print i.summary, print i.importance, print i.status, print i.sourcepackage

}}} {{{ 88521 https://bugs.launchpad.net/ubuntu/+source/bughelper/+bug/88521 selectively pulling attachments by name Medium Incomplete None

88102 https://bugs.launchpad.net/ubuntu/+source/bughelper/+bug/88102 sort report by issue type rather than bug number Undecided Confirmed None }}}

Adding some (upstream) bugs to the set {{{ l += BugList("https://bugs.launchpad.net/bughelper/+bugs") print l.bugs }}} {{{ set([109628, 110937, 88521, 88102, 84723, 88102, 81291, 85152, 88521, 90084, 109547]) }}}

Setting a filter and filter the set of bugs {{{ BugList.set_filter(minbug=100000, filterbug="117701,109628", status="New") l = l.filter() print l.bugs }}} {{{ set([110937, 109547]) }}}

Sorting the list of bugs {{{ print l.sort("nr") }}} {{{ [109547, 110937] }}}

add LP urloptions to an url {{{ a = BugList("https://launchpad.net/ubuntu/+source/apport/+bugs?%s" %BugList.URLOPT) print a.bugs }}} {{{ set([123180, 122818, 123394, 119270, 123440, 87364, 105224, 108482, 95504, 114215, 118407, 118827, 119104, 95822, 121121, 121341, 122196, 123216, 122274, 122347, 122522, 122798, 89916, 122882, 94130, 122859, 123062]) }}}

Raising LPUrlError for invalid urls {{{ try:

except BugList.Error.LPUrlError, e:

  • print e

}}}

"'Page not found (url: https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs)'"


Go Back to [:BugHelper/Dev].BR CategoryBugHelper

BugHelper/Dev/python-launchpad-bugs/BugList (last edited 2008-08-06 17:01:38 by localhost)