Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191137 - [PATCH] www-client/pybugz: Enable running of saved searches
Summary: [PATCH] www-client/pybugz: Enable running of saved searches
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: William Hubbs
URL: http://dx.homelinux.org/pub/gentoo/po...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-03 10:27 UTC by Togge
Modified: 2009-03-21 22:38 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pybugz-0.7.0-namedcmd.patch (pybugz-0.7.0-namedcmd.patch,3.67 KB, patch)
2007-09-03 10:28 UTC, Togge
Details | Diff
pybugz-0.7.0-namedcmd.patch (pybugz-0.7.0-namedcmd.patch,3.90 KB, patch)
2007-09-04 07:58 UTC, Togge
Details | Diff
New version for 0.7.2 (pybugz-0.7.2-namedcmd.patch,4.37 KB, patch)
2007-12-29 22:13 UTC, Togge
Details | Diff
pybugz-0.7.3-namedcmd.patch (pybugz-0.7.3-namedcmd.patch,5.75 KB, patch)
2008-01-01 14:41 UTC, Togge
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Togge 2007-09-03 10:27:40 UTC
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.
Comment 1 Togge 2007-09-03 10:28:21 UTC
Created attachment 129896 [details, diff]
pybugz-0.7.0-namedcmd.patch
Comment 2 William Hubbs gentoo-dev 2007-09-03 15:30:39 UTC
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
Comment 3 Togge 2007-09-04 07:58:21 UTC
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.
Comment 4 William Hubbs gentoo-dev 2007-12-29 16:00:48 UTC
Can you please update this patch so it can be applied to 0.7.2?

Thanks much.

William
Comment 5 Togge 2007-12-29 22:13:35 UTC
Created attachment 139581 [details, diff]
New version for 0.7.2

How about adding this to the program? :)
Comment 6 William Hubbs gentoo-dev 2007-12-30 02:07:28 UTC
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

Comment 7 Togge 2008-01-01 14:41:11 UTC
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.
Comment 8 William Hubbs gentoo-dev 2009-03-21 22:38:37 UTC
This is fixed in the latest git.

Thanks for your patience. :-)