On Tue, Jun 22, 2010 at 10:29:16PM -0400, Chris Ball wrote: > > Again, close ;). From the Show command: > > bug,comment = libbe.command.util.bug_comment_from_user_id( > > bugdir, params['id'][0]) > ... > Is there a good rationale for keeping such a general operation inside > the command-line module ... > It feels like bugdir.bug_from_shortname(id) was an improvement.
Well, the command module was supposed to be for more than just
command-line commands. The commands are supposed to be all
higher-level manipulations that a UserInterface exposes. Then there
would be a command-line UI, a web UI, and email UI, ..., all giving
you a way to call those commands and see the output.
> (and what's with the "comment" in there)?
The id could be a bug id (bea/12c) or a comment id (bea/12c/88d). It
seemed easiest to return both, in case it was a comment id. If it is
a bug id, the returned comment is None.
You could add something like
def bug_from_user_id(bugdir, id):
bug,comment = bug_comment_from_user_id(bugdir, id)
if comment != None:
raise UserError('Need a bug ID, not a comment ID like %s' % id)
return bug
to libbe.command.util if you want ;).
--
This email may be signed or encrypted with GPG (http://www.gnupg.org).
The GPG signature (if present) will be attached as 'signature.asc'.
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
My public key is at http://www.physics.drexel.edu/~wking/pubkey.txt
pgpJqhPXKAl1Z.pgp
Description: PGP signature
_______________________________________________ Be-devel mailing list [email protected] http://void.printf.net/cgi-bin/mailman/listinfo/be-devel
