* 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:
Stefano Rivera 2011-05-23 16:52:38 +01:00
commit e6ccf7c66c
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:
error_out(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("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