diff --git a/AUTHORS b/AUTHORS index efee5f0..167c7dd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,13 +2,15 @@ Albert Damen Albin Tonnerre Daniel Hahler Daniel Holbach +Iain Lane Jamin W. Collins +Jonathan Patrick Davies Jordan Mantha +Kees Cook Luke Yelavich Martin Pitt Michael Bienia Pete Savage -Kees Cook Siegfried-A. Gevatter Soren Hansen Steve Kowalik diff --git a/debian/changelog b/debian/changelog index 4d1adee..e79f6c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,7 +7,11 @@ ubuntu-dev-tools (0.36ubuntu1) intrepid; urgency=low - grab-attachment.1. * doc/requestsync.1: Described variables used by requestsync in man page. (LP: #237595) - * hugdaylist: Added code to handle exceptions. + * hugdaylist: + - Added code to handle exceptions and short version of GPL. + - Rewrote option handling with optparse. + - Filter bugs subscribed to the ubuntu-archive team. + * debian/copyright: Updated Authors and copyrights. [ Siegfried-Angel Gevatter Pujals ] * Change the versioning scheme from 0.XX to 0.XXubuntu1. Delete diff --git a/debian/copyright b/debian/copyright index 46a43c3..8e64534 100644 --- a/debian/copyright +++ b/debian/copyright @@ -7,18 +7,19 @@ Upstream Authors: Albin Tonnerre Daniel Hahler Daniel Holbach + Iain Lane Jamin W. Collins + Jonathan Patrick Davies Jordan Mantha + Kees Cook Luke Yelavich Martin Pitt Michael Bienia Pete Savage - Kees Cook Siegfried-A. Gevatter Soren Hansen Steve Kowalik Terence Simpson - Iain Lane Copyright: @@ -34,6 +35,7 @@ Copyright: (C) 2007-2008, Siegfried-A. Gevatter (C) 2007, Terence Simpson (C) 2008, Iain Lane + (C) 2008, Jonathan Patrick Davies Licenses: diff --git a/hugdaylist b/hugdaylist index 85c2a86..22b6ac0 100755 --- a/hugdaylist +++ b/hugdaylist @@ -2,20 +2,37 @@ # -*- coding: utf-8 -*- # # Copyright 2007, Canonical, Daniel Holbach +# Copyright (C) 2008 Jonathan Patrick Davies # -# GPL 3 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# +# hugdaylist - produces MoinMoin wiki formatted tables based on a Launchpad bug +# list. # # hugdaylist # - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw # # hugdaylist -n -# - will only list URLs +# - will only list URLs. # -import re import os -import sys +import re import string +import sys +from optparse import OptionParser try: import launchpadbugs.connector as Connector @@ -23,41 +40,55 @@ try: Bug = Connector.ConnectBug(method="Text") except ImportError: print >> sys.stderr, \ - "You need python-launchpad-bugs (>= 0.2.25) installed to use hugdaylist." + "python-launchpad-bugs (>= 0.2.25) needs to be installed to use hugdaylist." sys.exit(1) - -USAGE = "hugdaylist [-n ] " - def check_args(): howmany = -1 url = "" + + # Our usage options. + usage = "usage: %prog [-n ] launchpad-buglist-url" + optParser = OptionParser(usage) + + # Options - namely just the number of bugs to output. + optParser.add_option("-n", "--number", action = "store_true", + dest = "number", help = "Number of entries to output.") + + # Parse arguments. + (options, args) = optParser.parse_args() - if len(sys.argv) < 2: - print >> sys.stderr, USAGE - sys.exit(1) - - if sys.argv[1] == "-n": + # Check if we want a number other than the default. + if options.number: try: - howmany = int(sys.argv[2]) - except IndexError: - print "Option '-n' requires a number." - if len(sys.argv) < 4: - print USAGE - sys.exit(1) - url = sys.argv[3] + howmany = int(args[0]) + except: + print >> sys.stderr, "Option '-n' requires an integer for an " \ + "argument." + optParser.print_help() + sys.exit(1) + + # Check that we have an URL. + if not args: + print >> sys.stderr, "An URL pointing to a Launchpad bug list is " \ + "required." + optParser.print_help() + sys.exit(1) else: - url = sys.argv[1] - + url = args[0] + return (howmany, url) def filter_unsolved(b): bug = Bug(int(b)) + # Filter out special types of bugs: + # - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs return filter(lambda a: a.status != 'Fix Committed' and \ (a.assignee in ['motu','desktop-bugs'] or \ not a.assignee), bug.infotable) and \ 'ubuntu-main-sponsors' not in [str(s) for s in bug.subscribers] and \ - 'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers] + 'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers] and \ + 'ubuntu-archive' not in [str(s) for s in bug.subscribers] def main(): (howmany, url) = check_args() @@ -88,5 +119,5 @@ if __name__ == '__main__': try: main() except KeyboardInterrupt: - print >> sys.stderr, "Aborted" + print >> sys.stderr, "Aborted." sys.exit(1)