This patch adds a new command to pybugz. This command (namedcmd) enables pybugz to run saved searches from bugzilla as such: $ bugz namedcmd "Amd64 stable" It uses the same output as the search command.
Created attachment 129896 [details, diff] pybugz-0.7.0-namedcmd.patch
I have a couple of questions about this patch. 1) Does this command do anything other than retrieve saved searches? If not, the name of the command could be misleading -- "namedcmd" implies, to me anyway, that other things could be done with it such as running another command of some kind that is saved in bugzilla. 2) I did not see an addition to the detailed help section that explains the command. If I run bugz namecmd --help what information would I get? Thanks, William
Created attachment 129975 [details, diff] pybugz-0.7.0-namedcmd.patch (In reply to comment #2) > I have a couple of questions about this patch. > > 1) Does this command do anything other than retrieve saved searches? If not, > the name of the command could be misleading -- "namedcmd" implies, to me > anyway, that other things could be done with it such as running another command > of some kind that is saved in bugzilla. I got the name from the field used bu bugzilla. I've only seen it used for retrieving saved searches and the parsing code is the same as the one in Bugz.search() but I don't know if it's capable of doing other things. > 2) I did not see an addition to the detailed help section that explains the > command. If I run > bugz namecmd --help > what information would I get? $ bugz namedcmd --help Usage: bugz namedcmd <command name> Options: -h, --help show this help message and exit I've updated the patch with some more comments, more help text and removed a leftover debug print.
Can you please update this patch so it can be applied to 0.7.2? Thanks much. William
Created attachment 139581 [details, diff] New version for 0.7.2 How about adding this to the program? :)
If I give the name of a saved search that doesn't exist, I get a traceback. For example: bugz namedcmd "junk" * Using http://bugs.gentoo.org/ * Already logged in. * Unknown field: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" Traceback (most recent call last): File "/usr/bin/bugz", line 4, in ? bugz.main() File "/usr/lib/python2.4/site-packages/bugz.py", line 1828, in main getattr(bugz, cmd)(*args, **cmd_kwds) File "/usr/lib/python2.4/site-packages/bugz.py", line 1362, in namedcmd desc = row['desc'][:self.columns - 30] KeyError: 'desc' Is there any way you can update the patch to improve the error reporting in this situation? Thanks much, William
Created attachment 139792 [details, diff] pybugz-0.7.3-namedcmd.patch Fixes the traceback and does a small refactoring in that it moves the code that was duplicated in both Bugz.search() and Bugz.namedcmd() into a function of its own.
This is fixed in the latest git. Thanks for your patience. :-)