mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-07-03 11:01:31 +00:00
started to replace launchpadbugs by launchpadlib in hugdaylist
This commit is contained in:
parent
2963e1539c
commit
36f3176225
34
hugdaylist
34
hugdaylist
@ -35,14 +35,7 @@ import string
|
|||||||
import sys
|
import sys
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
try:
|
from common import get_launchpad, translate_web_api
|
||||||
import launchpadbugs.connector as Connector
|
|
||||||
BugList = Connector.ConnectBugList()
|
|
||||||
Bug = Connector.ConnectBug(method="Text")
|
|
||||||
except ImportError:
|
|
||||||
print >> sys.stderr, \
|
|
||||||
"python-launchpad-bugs (>= 0.2.25) needs to be installed to use hugdaylist."
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def check_args():
|
def check_args():
|
||||||
howmany = -1
|
howmany = -1
|
||||||
@ -75,7 +68,7 @@ def check_args():
|
|||||||
return (howmany, url)
|
return (howmany, url)
|
||||||
|
|
||||||
def filter_unsolved(b):
|
def filter_unsolved(b):
|
||||||
bug = Bug(int(b))
|
bug = launchpad.bugs[int(b)]
|
||||||
# Filter out special types of bugs:
|
# Filter out special types of bugs:
|
||||||
# - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs
|
# - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs
|
||||||
return filter(lambda a: a.status != 'Fix Committed' and \
|
return filter(lambda a: a.status != 'Fix Committed' and \
|
||||||
@ -87,14 +80,25 @@ def filter_unsolved(b):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
(howmany, url) = check_args()
|
(howmany, url) = check_args()
|
||||||
|
if len(url.split("?", 1)) == 2:
|
||||||
try:
|
# search options not supported, because there is no mapping web ui options <-> API options
|
||||||
bl = BugList(url)
|
print >> sys.stderr, "Options in url are not supported, url: %s" %url
|
||||||
except:
|
|
||||||
print >> sys.stderr, "The URL at '%s' does not appear to have a bug " \
|
|
||||||
"list." % url
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
launchpad = get_launchpad("ubuntu-dev-tools")
|
||||||
|
api_url = translate_web_api(url, launchpad)
|
||||||
|
try:
|
||||||
|
product = launchpad.load(api_url)
|
||||||
|
except Exception, e:
|
||||||
|
x = getattr(e, "response", {})
|
||||||
|
if response.get("status", None) == "404":
|
||||||
|
print >> sys.stderr, "The URL at '%s' does not appear to be a valid url to a product" %url
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
bl = product.searchTasks()
|
||||||
|
|
||||||
l = filter(filter_unsolved, bl)
|
l = filter(filter_unsolved, bl)
|
||||||
|
|
||||||
if not l:
|
if not l:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user