From 9e228e499b3f6130db7a2fa0cba9c74c85fa96c4 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Tue, 26 Jan 2010 22:13:32 +0100 Subject: [PATCH] Fix encoding. --- ack-sync | 109 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) mode change 100755 => 100644 ack-sync diff --git a/ack-sync b/ack-sync old mode 100755 new mode 100644 index b6d5598..5354c25 --- a/ack-sync +++ b/ack-sync @@ -1,32 +1,32 @@ #!/usr/bin/python -# +# # Copyright (C) 2007, Canonical Ltd. # Copyright (C) 2010, Benjamin Drung -# +# # It was initial written by Daniel Holbach. -# -# 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; version 3. -# -# 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. -# -# See file /usr/share/common-licenses/GPL-3 for more details. - +# +# 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; version 3. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-3 for more details. + import getopt import os import re -import subprocess +import subprocess import sys - -from ubuntutools.lp.libsupport import get_launchpad -from ubuntutools.requestsync.common import raw_input_exit_on_ctrlc + +from ubuntutools.lp.libsupport import get_launchpad +from ubuntutools.requestsync.common import raw_input_exit_on_ctrlc COMMAND_LINE_SYNTAX_ERROR = 1 -VERSION_DETECTION_FAILED = 2 +VERSION_DETECTION_FAILED = 2 def get_version(title): m = re.search("[() ][0-9][0-9a-zA-Z.:+-]*", title) @@ -69,12 +69,12 @@ def build_source(dsc_file): except subprocess.CalledProcessError: print >> sys.stderr, "E: %s failed to build." % (dsc_file) sys.exit(1) - -def main(bug_number, package, version, update, verbose=False, silent=False): - launchpad = get_launchpad("ubuntu-dev-tools") - - bug = launchpad.bugs[bug_number] - + +def main(bug_number, package, version, update, verbose=False, silent=False): + launchpad = get_launchpad("ubuntu-dev-tools") + + bug = launchpad.bugs[bug_number] + task = list(bug.bug_tasks)[0] if package is None: @@ -90,30 +90,30 @@ def main(bug_number, package, version, update, verbose=False, silent=False): subprocess.call(["sudo", "env", "DIST=lucid", "pbuilder", "update"]) build_source(dsc_file) - - print bug.title - print task.assignee - print task.status - raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ') - - people = launchpad.people - uus = people['ubuntu-universe-sponsors'] - bug.unsubscribe(person=uus) - print "uus unsubscribed" - task.transitionToAssignee(assignee=None) - print "unassigned me" - task.transitionToStatus (status="Confirmed") + + print bug.title + print task.assignee + print task.status + raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ') + + people = launchpad.people + uus = people['ubuntu-universe-sponsors'] + bug.unsubscribe(person=uus) + print "uus unsubscribed" + task.transitionToAssignee(assignee=None) + print "unassigned me" + task.transitionToStatus (status="Confirmed") print "status set to Confirmed" if task.importance == "Undecided": - task.transitionToImportance(importance="Wishlist") + task.transitionToImportance(importance="Wishlist") print "importance set to Wishlist" - bug.newMessage(content="package builds, sync request ACK'd") - print "Ack comment added" - aa = people['ubuntu-archive'] - bug.subscribe(person=aa) - print "Archive admin subscribed" - bug.subscribe(person=launchpad.me) - print "subscribed me" + bug.newMessage(content="package builds, sync request ACK'd") + print "Ack comment added" + aa = people['ubuntu-archive'] + bug.subscribe(person=aa) + print "Archive admin subscribed" + bug.subscribe(person=launchpad.me) + print "subscribed me" def usage(): print """ack-sync @@ -124,8 +124,8 @@ def usage(): -u, --update updates pbuilder before building -v, --verbose be more verbosive -V, --version= set the version""" - -if __name__ == '__main__': + +if __name__ == '__main__': try: long_opts = ["help", "package", "silent", "update", "verbose", "version"] opts, args = getopt.gnu_getopt(sys.argv[1:], "hp:suvV:", long_opts) @@ -142,7 +142,7 @@ if __name__ == '__main__': for o, a in opts: if o in ("-h", "--help"): - usage() + usage() sys.exit() elif o in ("-p", "--package"): package = a @@ -162,10 +162,11 @@ if __name__ == '__main__': print >> sys.stderr, "E: You must specify bug number." sys.exit(COMMAND_LINE_SYNTAX_ERROR) - try: - bug_number = int(args[0]) + try: + bug_number = int(args[0]) except: - if not silent: - print >> sys.stderr, "E: '%s' is not a valid bug number." % args[0] - sys.exit(COMMAND_LINE_SYNTAX_ERROR) + if not silent: + print >> sys.stderr, "E: '%s' is not a valid bug number." % args[0] + sys.exit(COMMAND_LINE_SYNTAX_ERROR) main(bug_number, package, version, update, verbose, silent) +