lp:~achiang/hydrazine/hydrazine-searching
- Get this branch:
- bzr branch lp:~achiang/hydrazine/hydrazine-searching
Branch merges
- Martin Pool: Needs Fixing
-
Diff: 134 lines (+38/-10)1 file modifiedbugclient (+38/-10)
Branch information
Recent revisions
- 101. By Alex Chiang
-
bugclient: improve 'filter regexp' error handling
Give the user a useful error message regarding an attempted invalid regexp.
- 100. By Alex Chiang
-
bugclient: add 'filter regexp' for more powerful search
Allow user to enter python regular expression to search.
Currently limited to searching bug titles only, but could easily
be expanded to search bug descriptions as well if so desired.This might be useful, e.g., to select all bugs with a certain
title, and then batch tag them so they can be found with the
web interface. - 99. By Alex Chiang
-
bugclient: internal whitespace cleanup
- make 'help filter' text output fit in 80 columns again
- clean up stray trailing whitespace at end of lines - 98. By Alex Chiang
-
bugclient: add 'filter search' support
Add support for Launchpad search, which does a full text search inside
titles, descriptions, and whatever else the searchTasks('search_ text')
API can do. - 97. By Alex Chiang
-
bugclient: 'batch' command requires a pillar defined
Without it, we get a splat:
hydrazine(None)> batch
Traceback (most recent call last):
File "./bugclient", line 540, in <module>
main(sys.argv)
File "./bugclient", line 536, in main
cmd.cmdloop()
File "/usr/lib/python2. 7/cmd.py" , line 142, in cmdloop
stop = self.onecmd(line)
File "./bugclient", line 398, in onecmd
return cmd.Cmd.onecmd( self, cmdline)
File "/usr/lib/python2. 7/cmd.py" , line 219, in onecmd
return func(arg)
File "./bugclient", line 86, in do_batch
self.task_list = self.pillar.searchTasks( **kwargs)
AttributeError: 'NoneType' object has no attribute 'searchTasks' - 96. By Alex Chiang
-
bugclient: add input validation for 'filter' command, other NamedEnums
Give the NamedEnum() class a new method, 'show_valid()'.
This gives us a standard way to handle error checking if the user
enters an invalid enum.Harden the 'filter' command so it doesn't puke when you just type it
without any arguments, such as the stack trace below:hydrazine(None)> filter
Traceback (most recent call last):
File "./bugclient", line 541, in <module>
main(sys.argv)
File "./bugclient", line 537, in main
cmd.cmdloop()
File "/usr/lib/python2. 7/cmd.py" , line 142, in cmdloop
stop = self.onecmd(line)
File "./bugclient", line 399, in onecmd
return cmd.Cmd.onecmd( self, cmdline)
File "/usr/lib/python2. 7/cmd.py" , line 219, in onecmd
return func(arg)
File "./bugclient", line 175, in do_filter
if not (args[0]):
IndexError: list index out of range - 94. By Alex Chiang
-
bugclient: fix stacktrace in do_official_tags when there are no tags
Slight refactor of logic to return early if there are no official tags
defined for a pillar. Without this fix, we get the following stack trace:Traceback (most recent call last):
File "./bugclient", line 519, in <module>
main(sys.argv)
File "./bugclient", line 515, in main
cmd.cmdloop()
File "/usr/lib/python2. 7/cmd.py" , line 142, in cmdloop
stop = self.onecmd(line)
File "./bugclient", line 379, in onecmd
return cmd.Cmd.onecmd( self, cmdline)
File "/usr/lib/python2. 7/cmd.py" , line 219, in onecmd
return func(arg)
File "./bugclient", line 233, in do_official_tags
_show_columnated (tags)
File "./bugclient", line 465, in _show_columnated
longest = max(map(len, tags))
ValueError: max() arg is an empty sequence - 93. By Alex Chiang
-
bugclient: add 'filter' and 'batch' commands
Add a filter for batch operations
examples:
filter milestone M1 # milestone named 'M1'
filter status new # all New bugs
filter tags a b c # tags 'a', 'b', and 'c'
filter clear # remove all filtersPerform batch operation on current pillar's bugs.
Use the 'filter' command to limit the batch command's scope of bugs.example:
filter status new
batch show # show information on all New bugs
batch status confirmed # change all New bugs to ConfirmedXXX: there is very little error checking right now. We allow users to
blow off their entire leg.But it's a good start.
select_new is completely superseded by the functionality of filters
and the batch command, so it is removed.OLD:
hydrazine> select_new # select New bugs and wait for user
hydrazine> next # go to next bug
hydrazine> next # go to next bugNEW:
hydrazine> filter status new # add filter for New bugs
hydrazine> batch # load bug list and wait for user
hydrazine> next # go to next bug
hydrazine> next # go to next bug - 92. By Alex Chiang
-
bugclient: internal new NamedEnum() class to hold status, importance
Create a new, generic enum class, into which we can stuff various
lists of enums, such as launchpad status, importance, etc.Demonstrate at least one new benefit of the refactorization, viz.
we can give better feedback if the user attempts to pass an invalid
value into do_status() or do_importance(), by displaying the values
we recognize.It would be better if we could learn these enums directly from
launchpadlib itself, but this class also allows us to define
hydrazine-specific enums in future commits.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:hydrazine