* bitesize:

- display error message properly. 
  - error out if bug is already marked as 'bitesize'.
  - rephrase bug comment and subscribe person who adds the comment.
  - work-around LP:336866 and LP:254901.
This commit is contained in:
Daniel Holbach 2011-05-23 15:49:06 +02:00
parent 2d4683260b
commit f8abc5b881
2 changed files with 28 additions and 11 deletions

View File

@ -34,6 +34,16 @@ def error_out(msg):
Logger.error(msg)
sys.exit(1)
def save_entry(entry):
try:
entry.lp_save()
except HTTPError, error:
print error.content
def tag_bug(bug):
bug.tags = bug.tags + ['bitesize'] # LP: #254901 workaround
save_entry(bug)
def main():
usage = "Usage: %prog <bug number>"
opt_parser = OptionParser(usage)
@ -61,18 +71,18 @@ def main():
bug = launchpad.bugs[args[0]]
except HTTPError, error:
if error.response.status == 401:
error_out("E: Don't have enough permissions to access bug %s" % args[0])
error_out(error.content)
error_out("E: Don't have enough permissions to access bug %s. %s" % \
(args[0], error.content))
else:
raise
if 'bitesize' not in bug.tags:
bug.tags += ['bitesize']
content = """I'm marking this bug as 'bitesize' as it looks like an issue
that is easy to fix and suitable for newcomers in Ubuntu development. If you
need any help with fixing it, talk to me (https://launchpad.net/~%s) about
it.""" % (launchpad.me.name)
bug.newMessage(content=content, subject="bitesize bug")
bug.lp_save()
if 'bitesize' in bug.tags:
error_out("Bug is already marked as 'bitesize'.")
bug.newMessage(content="I'm marking this bug as 'bitesize' as it looks "
"like an issue that is easy to fix and suitable "
"for newcomers in Ubuntu development. If you need "
"any help with fixing it, talk to me about it.")
bug.subscribe(person=launchpad.me)
tag_bug(launchpad.bugs[bug.id]) # fresh bug object, LP: #336866 workaround
if __name__ == '__main__':
main()

9
debian/changelog vendored
View File

@ -7,7 +7,14 @@ ubuntu-dev-tools (0.124) UNRELEASED; urgency=low
[ Mackenzie Morgan ]
* Add debhelper and quilt as recommends (LP: #786370)
-- Mackenzie Morgan <maco.m@ubuntu.com> Sat, 21 May 2011 19:29:35 -0400
[ Daniel Holbach ]
* bitesize:
- display error message properly.
- error out if bug is already marked as 'bitesize'.
- rephrase bug comment and subscribe person who adds the comment.
- work-around LP:336866 and LP:254901.
-- Daniel Holbach <daniel.holbach@ubuntu.com> Mon, 23 May 2011 15:47:04 +0200
ubuntu-dev-tools (0.123) unstable; urgency=low