mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
ack-sync: Assign yourself before working on the sync request.
This commit is contained in:
parent
6f78086089
commit
55cd28cb31
59
ack-sync
59
ack-sync
@ -128,6 +128,28 @@ def get_email_from_file(name):
|
|||||||
return row[1]
|
return row[1]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def unsubscribe_sponsors(launchpad, bug):
|
||||||
|
succeeded_unsubscribe = True
|
||||||
|
ums = launchpad.people['ubuntu-main-sponsors']
|
||||||
|
uus = launchpad.people['ubuntu-universe-sponsors']
|
||||||
|
try:
|
||||||
|
bug.unsubscribe(person=ums)
|
||||||
|
except lazr.restfulclient.errors.HTTPError, http_error:
|
||||||
|
print "failed to unsubscribe ubuntu-main-sponsors: " + http_error.content
|
||||||
|
succeeded_unsubscribe = False
|
||||||
|
try:
|
||||||
|
bug.unsubscribe(person=uus)
|
||||||
|
except lazr.restfulclient.errors.HTTPError, http_error:
|
||||||
|
print "failed to unsubscribe ubuntu-universe-sponsors: " + http_error.content
|
||||||
|
succeeded_unsubscribe = False
|
||||||
|
if succeeded_unsubscribe:
|
||||||
|
print "ubuntu-{main,universe}-sponsors unsubscribed (for backward compatibility)"
|
||||||
|
|
||||||
|
us = launchpad.people['ubuntu-sponsors']
|
||||||
|
bug.unsubscribe(person=us)
|
||||||
|
print "ubuntu-sponsors unsubscribed"
|
||||||
|
|
||||||
|
|
||||||
def main(bug_numbers, all_package, all_version, all_section, update,
|
def main(bug_numbers, all_package, all_version, all_section, update,
|
||||||
all_uploader_email, key, verbose=False, silent=False):
|
all_uploader_email, key, verbose=False, silent=False):
|
||||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
launchpad = get_launchpad("ubuntu-dev-tools")
|
||||||
@ -161,6 +183,20 @@ def main(bug_numbers, all_package, all_version, all_section, update,
|
|||||||
|
|
||||||
task = list(bug.bug_tasks)[0]
|
task = list(bug.bug_tasks)[0]
|
||||||
|
|
||||||
|
if task.assignee == None:
|
||||||
|
task.assignee = launchpad.me
|
||||||
|
print "assigned me"
|
||||||
|
task.lp_save()
|
||||||
|
elif task.assignee != launchpad.me:
|
||||||
|
print >> sys.stderr, "E: %s is already assigned to https://launchpad.net/bugs/%i" % \
|
||||||
|
(task.assignee.display_name, bug.id)
|
||||||
|
sys.exit(1)
|
||||||
|
unsubscribe_sponsors(launchpad, bug)
|
||||||
|
if task.importance == "Undecided":
|
||||||
|
task.importance = "Wishlist"
|
||||||
|
print "importance set to Wishlist"
|
||||||
|
task.lp_save()
|
||||||
|
|
||||||
if all_package is not None:
|
if all_package is not None:
|
||||||
package = all_package
|
package = all_package
|
||||||
else:
|
else:
|
||||||
@ -192,7 +228,6 @@ def main(bug_numbers, all_package, all_version, all_section, update,
|
|||||||
test_install(dist, dsc_file)
|
test_install(dist, dsc_file)
|
||||||
|
|
||||||
print bug.title
|
print bug.title
|
||||||
print task.assignee
|
|
||||||
print task.status
|
print task.status
|
||||||
print "Uploader:", uploader_name + " <" + uploader_email + ">"
|
print "Uploader:", uploader_name + " <" + uploader_email + ">"
|
||||||
try:
|
try:
|
||||||
@ -200,30 +235,8 @@ def main(bug_numbers, all_package, all_version, all_section, update,
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
succeeded_unsubscribe = True
|
|
||||||
ums = launchpad.people['ubuntu-main-sponsors']
|
|
||||||
uus = launchpad.people['ubuntu-universe-sponsors']
|
|
||||||
try:
|
|
||||||
bug.unsubscribe(person=ums)
|
|
||||||
except lazr.restfulclient.errors.HTTPError, http_error:
|
|
||||||
print "failed to unsubscribe ubuntu-main-sponsors: " + http_error.content
|
|
||||||
succeeded_unsubscribe = False
|
|
||||||
try:
|
|
||||||
bug.unsubscribe(person=uus)
|
|
||||||
except lazr.restfulclient.errors.HTTPError, http_error:
|
|
||||||
print "failed to unsubscribe ubuntu-universe-sponsors: " + http_error.content
|
|
||||||
succeeded_unsubscribe = False
|
|
||||||
if succeeded_unsubscribe:
|
|
||||||
print "ubuntu-{main,universe}-sponsors unsubscribed (for backward compatibility)"
|
|
||||||
|
|
||||||
us = launchpad.people['ubuntu-sponsors']
|
|
||||||
bug.unsubscribe(person=us)
|
|
||||||
print "ubuntu-sponsors unsubscribed"
|
|
||||||
task.assignee = None
|
task.assignee = None
|
||||||
print "unassigned me"
|
print "unassigned me"
|
||||||
if task.importance == "Undecided":
|
|
||||||
task.importance = "Wishlist"
|
|
||||||
print "importance set to Wishlist"
|
|
||||||
task.lp_save()
|
task.lp_save()
|
||||||
bug.subscribe(person=launchpad.me)
|
bug.subscribe(person=launchpad.me)
|
||||||
print "subscribed me"
|
print "subscribed me"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user