Merge ~ddstreet/ubuntu-dev-tools:cleanup into ubuntu-dev-tools:master

Proposed by Dan Streetman
Status: Merged
Merged at revision: 13123c51c61b7237e51b1e7bda95dd3fc7700f68
Proposed branch: ~ddstreet/ubuntu-dev-tools:cleanup
Merge into: ubuntu-dev-tools:master
Diff against target: 285 lines (+0/-55)
4 files modified
debian/control (+0/-1)
debian/copyright (+0/-3)
dev/null (+0/-50)
setup.py (+0/-1)
Reviewer Review Type Date Requested Status
Mattia Rizzolo Approve
Review via email: mp+412242@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mattia Rizzolo (mapreri) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/control b/debian/control
2index ff0ad61..3c03156 100644
3--- a/debian/control
4+++ b/debian/control
5@@ -90,7 +90,6 @@ Description: useful tools for Ubuntu developers
6 - dch-repeat - used to repeat a change log into an older release.
7 - grab-merge - grabs a merge from merges.ubuntu.com easily.
8 - grep-merges - search for pending merges from Debian.
9- - hugdaylist - compile HugDay lists from bug list URLs.
10 - import-bug-from-debian - copy a bug from the Debian BTS to Launchpad
11 - merge-changelog - manually merges two Debian changelogs with the same base
12 version.
13diff --git a/debian/copyright b/debian/copyright
14index 9db0196..42d84fc 100644
15--- a/debian/copyright
16+++ b/debian/copyright
17@@ -72,13 +72,11 @@ License: GPL-2+
18
19 Files: doc/bitesize.1
20 doc/grab-merge.1
21- doc/hugdaylist.1
22 doc/merge-changelog.1
23 doc/setup-packaging-environment.1
24 doc/syncpackage.1
25 bitesize
26 grab-merge
27- hugdaylist
28 merge-changelog
29 setup-packaging-environment
30 syncpackage
31@@ -109,7 +107,6 @@ Files: dch-repeat
32 grep-merges
33 mk-sbuild
34 ubuntu-build
35- ubuntutools/lp/libsupport.py
36 ubuntutools/lp/lpapicache.py
37 ubuntutools/misc.py
38 Copyright: 2007-2010, Canonical Ltd.
39diff --git a/doc/hugdaylist.1 b/doc/hugdaylist.1
40deleted file mode 100644
41index 71d0b9a..0000000
42--- a/doc/hugdaylist.1
43+++ /dev/null
44@@ -1,26 +0,0 @@
45-.TH HUGDAYLIST "1" "August 27, 2008" "ubuntu-dev-tools"
46-
47-.SH NAME
48-hugdaylist \- produce MoinMoin wiki formatted tables based on a Launchpad bug list
49-
50-.SH SYNOPSIS
51-.B hugdaylist [\fB\-n\fP|\fB\-\-number <NUMBER>\fP] \fBlaunchpad-buglist-url\fP
52-
53-.SH DESCRIPTION
54-\fBhugdaylist\fP produces MoinMoin wiki formatted tables based on a
55-Launchpad bug list
56-
57-.SH OPTIONS
58-.TP
59-\fB\-\-number=<NUMBER>\fP
60-This option allows you to specify the number of entries to output.
61-.TP
62-\fBlaunchpad-buglist-url\fP
63-Required, this option is a URL pointing to a launchpad bug list.
64-
65-.SH AUTHOR
66-\fBhugdaylist\fP has been written by Canonical Ltd., Daniel Holbach
67-<daniel.holbach@canonical.com> and Jonathan Patrick Davies <jpds@ubuntu.com>.
68-This manual page was written by Ryan Kavanagh <ryanakca@kubuntu.org>.
69-.PP
70-Both are released under the GNU General Public License, version 3.
71diff --git a/hugdaylist b/hugdaylist
72deleted file mode 100755
73index ef33523..0000000
74--- a/hugdaylist
75+++ /dev/null
76@@ -1,141 +0,0 @@
77-#!/usr/bin/python3
78-# -*- coding: utf-8 -*-
79-#
80-# Copyright (C) 2007 Canonical Ltd., Daniel Holbach
81-# Copyright (C) 2008 Jonathan Patrick Davies <jpds@ubuntu.com>
82-#
83-# ##################################################################
84-#
85-# This program is free software; you can redistribute it and/or
86-# modify it under the terms of the GNU General Public License
87-# as published by the Free Software Foundation; version 3.
88-#
89-# This program is distributed in the hope that it will be useful,
90-# but WITHOUT ANY WARRANTY; without even the implied warranty of
91-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92-# GNU General Public License for more details.
93-#
94-# See file /usr/share/common-licenses/GPL-3 for more details.
95-#
96-# ##################################################################
97-#
98-#
99-# hugdaylist - produces MoinMoin wiki formatted tables based on a Launchpad bug
100-# list.
101-#
102-# hugdaylist <url>
103-# - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw
104-#
105-# hugdaylist -n <howmany> <url>
106-# - will only list <howmany> URLs.
107-
108-import sys
109-from optparse import OptionParser
110-
111-from launchpadlib.launchpad import Launchpad
112-
113-from ubuntutools.lp.libsupport import translate_web_api
114-
115-from ubuntutools import getLogger
116-Logger = getLogger()
117-
118-
119-def check_args():
120- howmany = -1
121- url = ""
122-
123- # Our usage options.
124- usage = "usage: %prog [-n <number>] launchpad-buglist-url"
125- opt_parser = OptionParser(usage)
126-
127- # Options - namely just the number of bugs to output.
128- opt_parser.add_option("-n", "--number", type="int",
129- dest="number", help="Number of entries to output.")
130-
131- # Parse arguments.
132- (options, args) = opt_parser.parse_args()
133-
134- # Check if we want a number other than the default.
135- howmany = options.number
136-
137- # Check that we have an URL.
138- if not args:
139- Logger.error("An URL pointing to a Launchpad bug list is required.")
140- opt_parser.print_help()
141- sys.exit(1)
142- else:
143- url = args[0]
144-
145- return (howmany, url)
146-
147-
148-def filter_unsolved(task):
149- # TODO: don't use this filter here, only check status and assignee of
150- # the given task
151- # Filter out special types of bugs:
152- # - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs
153- # this is expensive, parse name out of self_link instead?
154- subscriptions = set(s.person.name for s in task.bug.subscriptions)
155- if (task.status != "Fix Committed" and
156- (not task.assignee or task.assignee.name in ['motu', 'desktop-bugs']) and
157- 'ubuntu-sponsors' not in subscriptions and
158- 'ubuntu-archive' not in subscriptions):
159- return True
160- return False
161-
162-
163-def main():
164- (howmany, url) = check_args()
165- if len(url.split("?", 1)) == 2:
166- # search options not supported, because there is no mapping web ui
167- # options <-> API options
168- Logger.error("Options in url are not supported, url: %s" % url)
169- sys.exit(1)
170-
171- launchpad = None
172- try:
173- launchpad = Launchpad.login_with("ubuntu-dev-tools", 'production')
174- except IOError as error:
175- Logger.exception(error)
176- sys.exit(1)
177-
178- api_url = translate_web_api(url, launchpad)
179- try:
180- product = launchpad.load(api_url)
181- except Exception as error:
182- response = getattr(error, "response", {})
183- if response.get("status", None) == "404":
184- Logger.error("The URL at '%s' does not appear to be a "
185- "valid url to a product" % url)
186- sys.exit(1)
187- else:
188- raise
189-
190- bug_list = [b for b in product.searchTasks() if filter_unsolved(b)]
191-
192- if not bug_list:
193- Logger.info("Bug list of %s is empty." % url)
194- sys.exit(0)
195- if howmany == -1:
196- howmany = len(bug_list)
197-
198- Logger.info("""
199-## ||<rowbgcolor="#CCFFCC"> This task is done || somebody || ||
200-## ||<rowbgcolor="#FFFFCC"> This task is assigned || somebody || <status> ||
201-## ||<rowbgcolor="#FFEBBB"> This task isn't || ... || ||
202-## ||<rowbgcolor="#FFCCCC"> This task is blocked on something || somebody || <explanation> ||
203-
204-|| Bug || Subject || Triager ||""")
205-
206- for i in list(bug_list)[:howmany]:
207- bug = i.bug
208- Logger.info('||<rowbgcolor="#FFEBBB"> [%s %s] || %s || ||' %
209- (bug.web_link, bug.id, bug.title))
210-
211-
212-if __name__ == '__main__':
213- try:
214- main()
215- except KeyboardInterrupt:
216- Logger.error("Aborted.")
217- sys.exit(1)
218diff --git a/setup.py b/setup.py
219index 59b00c2..dd6e76a 100755
220--- a/setup.py
221+++ b/setup.py
222@@ -21,7 +21,6 @@ scripts = [
223 'dch-repeat',
224 'grab-merge',
225 'grep-merges',
226- 'hugdaylist',
227 'import-bug-from-debian',
228 'merge-changelog',
229 'mk-sbuild',
230diff --git a/ubuntutools/lp/libsupport.py b/ubuntutools/lp/libsupport.py
231deleted file mode 100644
232index 24b1d3c..0000000
233--- a/ubuntutools/lp/libsupport.py
234+++ /dev/null
235@@ -1,50 +0,0 @@
236-#
237-# libsupport.py - functions which add launchpadlib support to the Ubuntu
238-# Developer Tools package.
239-#
240-# Copyright (C) 2009 Markus Korn <thekorn@gmx.de>
241-#
242-# This program is free software; you can redistribute it and/or
243-# modify it under the terms of the GNU General Public License
244-# as published by the Free Software Foundation; either version 3
245-# of the License, or (at your option) any later version.
246-#
247-# This program is distributed in the hope that it will be useful,
248-# but WITHOUT ANY WARRANTY; without even the implied warranty of
249-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
250-# GNU General Public License for more details.
251-#
252-# Please see the /usr/share/common-licenses/GPL file for the full text of
253-# the GNU General Public License license.
254-#
255-
256-from urllib.parse import urlsplit, urlencode, urlunsplit
257-
258-
259-def query_to_dict(query_string):
260- result = dict()
261- options = filter(None, query_string.split("&"))
262- for opt in options:
263- key, value = opt.split("=")
264- result.setdefault(key, set()).add(value)
265- return result
266-
267-
268-def translate_web_api(url, launchpad):
269- scheme, netloc, path, query, fragment = urlsplit(url)
270- query = query_to_dict(query)
271-
272- differences = set(netloc.split('.')).symmetric_difference(
273- set(launchpad._root_uri.host.split('.')))
274- if ('staging' in differences or 'edge' in differences):
275- raise ValueError("url conflict (url: %s, root: %s" %
276- (url, launchpad._root_uri))
277- if path.endswith("/+bugs"):
278- path = path[:-6]
279- if "ws.op" in query:
280- raise ValueError("Invalid web url, url: %s" % url)
281- query["ws.op"] = "searchTasks"
282- scheme, netloc, api_path, _, _ = urlsplit(str(launchpad._root_uri))
283- query = urlencode(query)
284- url = urlunsplit((scheme, netloc, api_path + path.lstrip("/"), query, fragment))
285- return url

Subscribers

People subscribed via source and target branches