diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-24 11:22:53 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-24 11:22:53 -0500 |
commit | 9e566087db878ee9420faaa422e5e3ea9bce724e (patch) | |
tree | 19fcc72835c749f5bc607fe5aac9e76e54794b82 /libbe/command/comment.py | |
parent | 4ea7a28e1bd97df5997b5f884378bd7d64edff6e (diff) | |
parent | 53074356bf715c820d3b9b852cd45e5073ba765d (diff) | |
download | bugseverywhere-9e566087db878ee9420faaa422e5e3ea9bce724e.tar.gz |
Merged be.doc documentation rewrite + bugfixes + new bugs
Highlights:
* Fix broken Diff.comment_body_change_string implementation.
* Fix List --severity handling, added --important
* Fix `be target --help`
* Fix non-text/plain `be comment` code and added 'Created
comment...' output
Diffstat (limited to 'libbe/command/comment.py')
-rw-r--r-- | libbe/command/comment.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libbe/command/comment.py b/libbe/command/comment.py index 16b0e77..cb46398 100644 --- a/libbe/command/comment.py +++ b/libbe/command/comment.py @@ -32,6 +32,7 @@ class Comment (libbe.command.Command): >>> import time >>> import libbe.bugdir + >>> import libbe.util.id >>> bd = libbe.bugdir.SimpleBugDir(memory=False) >>> io = libbe.command.StringInputOutput() >>> io.stdout = sys.stdout @@ -39,8 +40,12 @@ class Comment (libbe.command.Command): >>> ui.storage_callbacks.set_storage(bd.storage) >>> cmd = Comment(ui=ui) + >>> uuid_gen = libbe.util.id.uuid_gen + >>> libbe.util.id.uuid_gen = lambda: 'X' >>> ui._user_id = u'Fran\\xe7ois' >>> ret = ui.run(cmd, args=['/a', 'This is a comment about a']) + Created comment with ID abc/a/X + >>> libbe.util.id.uuid_gen = uuid_gen >>> bd.flush_reload() >>> bug = bd.bug_from_uuid('a') >>> bug.load_comments(load_full=False) @@ -65,7 +70,10 @@ class Comment (libbe.command.Command): UserError: No comment supplied, and EDITOR not specified. >>> os.environ['EDITOR'] = "echo 'I like cheese' > " + >>> libbe.util.id.uuid_gen = lambda: 'Y' >>> ret = ui.run(cmd, args=['/b']) + Created comment with ID abc/b/Y + >>> libbe.util.id.uuid_gen = uuid_gen >>> bd.flush_reload() >>> bug = bd.bug_from_uuid('b') >>> bug.load_comments(load_full=False) @@ -142,7 +150,8 @@ class Comment (libbe.command.Command): new = parent.new_reply(body=body) for key in ['alt-id', 'author', 'content-type']: if params[key] != None: - setattr(new, key, params[key]) + setattr(new, new._setting_name_to_attr_name(key), params[key]) + print >> self.stdout, 'Created comment with ID %s' % new.id.user() return 0 def _long_help(self): |