BugList
|
Size: 2066
Comment:
|
Size: 2764
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: |
| ''' Use `LaunchpadConnector` and setting authentification: ''' {{{ import launchpadBugs.Connector as Connector |
=== Use `LaunchpadConnector` and setting authentification: === {{{#!python import launchpadbugs.connector as Connector |
| Line 8: | Line 10: |
| BugList.authentification = "cookie.txt" | BugList.authentication = "cookie.txt" |
| Line 11: | Line 13: |
| ''' Getting a list of bugs and print available information: ''' {{{ l = bl.BugList("https://bugs.launchpad.net/ubuntu/+source/bughelper/+bugs") |
=== Getting a list of bugs and print available information: === {{{#!python l = BugList("https://bugs.launchpad.net/ubuntu/+source/bughelper/+bugs") |
| Line 26: | Line 29: |
| ''' Adding some (upstream) bugs to the set ''' {{{ l += bl.BugList("https://bugs.launchpad.net/bughelper/+bugs") |
=== Adding some (upstream) bugs to the set === {{{#!python l += BugList("https://bugs.launchpad.net/bughelper/+bugs") |
| Line 33: | Line 37: |
| ''' Setting a filter and filter the set of bugs ''' {{{ bl.set_filter(minbug=100000, filterbug="117701,109628", status="New") |
=== Setting a filter and filter the set of bugs === {{{#!python BugList.set_filter(minbug=100000, filterbug="117701,109628", status="New") |
| Line 41: | Line 46: |
| ''' Sorting the list of bugs ''' {{{ print l.sort("nr") |
=== Sorting the list of bugs === {{{#!python print l.sort("nr") |
| Line 47: | Line 53: |
| ''' add LP urloptions to an url ''' {{{ a = bl.BugList("https://launchpad.net/ubuntu/+source/apport/+bugs?%s" %bl.URLOPT) |
=== add LP urloptions to an url === {{{#!python a = BugList("https://launchpad.net/ubuntu/+source/apport/+bugs?%s" %BugList.urlopt) |
| Line 54: | Line 61: |
| ''' Raising `LPUrlError` for invalid urls ''' {{{ try: a = bl.BugList("https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs") |
=== Raising `LPUrlError` for invalid urls === {{{#!python try: a = BugList("https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs") |
| Line 58: | Line 66: |
| except bl.LPURLERROR, e: | except BugList.Error.LPUrlError, e: |
| Line 64: | Line 72: |
=== Use custom-made filter-functions === {{{#!python bl = BugList("https://bugs.launchpad.net/bughelper/+bugs") def RFE_filter(bugs): result = set() for b in bugs: if b.summary.startswith("RFE"): result.add(b) return result for b in bl.filter(func=[RFE_filter]).bugs: print "%s (%s)" %(b.summary, b.bugnumber) }}} {{{ RFE: Web interface to bughelper (81291) RFE: grep for package version (84723) }}} ---- Go Back to '''[:BugHelper/Dev]'''.[[BR]] CategoryBugHelper |
This is still work in progress
Example usage of BugList
Use `LaunchpadConnector` and setting authentification:
Getting a list of bugs and print available information:
{{{ 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
{{{ set([109628, 110937, 88521, 88102, 84723, 88102, 81291, 85152, 88521, 90084, 109547]) }}}
Setting a filter and filter the set of bugs
{{{ set([110937, 109547]) }}}
Sorting the list of bugs
1 print l.sort("nr")
{{{ [109547, 110937] }}}
add LP urloptions to an url
{{{ 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
"'Page not found (url: https://bugs.launchpad.net/ubuntu/+source/firefokkksss/+bugs)'"
Use custom-made filter-functions
{{{ RFE: Web interface to bughelper (81291) RFE: grep for package version (84723) }}}
Go Back to [:BugHelper/Dev].BR CategoryBugHelper
BugHelper/Dev/python-launchpad-bugs/BugList (last edited 2008-08-06 17:01:38 by localhost)