Tag a bug, or search bugs for tags
>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> io = libbe.command.StringInputOutput()
>>> io.stdout = sys.stdout
>>> ui = libbe.command.UserInterface(io=io)
>>> ui.storage_callbacks.set_bugdirs({bd.uuid: bd})
>>> cmd = Tag(ui=ui)
>>> a = bd.bug_from_uuid('a')
>>> print a.extra_strings
[]
>>> ret = ui.run(cmd, args=['/a', 'GUI'])
Tags for abc/a:
GUI
>>> bd.flush_reload()
>>> a = bd.bug_from_uuid('a')
>>> print a.extra_strings
['TAG:GUI']
>>> ret = ui.run(cmd, args=['/a', 'later'])
Tags for abc/a:
GUI
later
>>> ret = ui.run(cmd, args=['/a'])
Tags for abc/a:
GUI
later
>>> ret = ui.run(cmd, {'list':True})
GUI
later
>>> ret = ui.run(cmd, args=['/a', 'Alphabetically first'])
Tags for abc/a:
Alphabetically first
GUI
later
>>> bd.flush_reload()
>>> a = bd.bug_from_uuid('a')
>>> print a.extra_strings
['TAG:Alphabetically first', 'TAG:GUI', 'TAG:later']
>>> a.extra_strings = []
>>> print a.extra_strings
[]
>>> ret = ui.run(cmd, args=['/a'])
>>> bd.flush_reload()
>>> a = bd.bug_from_uuid('a')
>>> print a.extra_strings
[]
>>> ret = ui.run(cmd, args=['/a', 'Alphabetically first'])
Tags for abc/a:
Alphabetically first
>>> ret = ui.run(cmd, {'remove':True}, ['/a', 'Alphabetically first'])
>>> ui.cleanup()
>>> bd.cleanup()
Methods
cleanup() | |
complete([argument, fragment]) | |
help(*args) | |
run([options, args]) | |
usage() |