libbe.command.depend

class libbe.command.depend.Depend(*args, **kwargs)

Add/remove bug dependencies

>>> 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_storage(bd.storage)
>>> cmd = Depend(ui=ui)
>>> ret = ui.run(cmd, args=['/a', '/b'])
abc/a blocked by:
abc/b
>>> ret = ui.run(cmd, args=['/a'])
abc/a blocked by:
abc/b
>>> ret = ui.run(cmd, {'show-status':True}, ['/a']) 
abc/a blocked by:
abc/b closed
>>> ret = ui.run(cmd, args=['/b', '/a'])
abc/b blocked by:
abc/a
abc/b blocks:
abc/a
>>> ret = ui.run(cmd, {'show-status':True}, ['/a']) 
abc/a blocked by:
abc/b closed
abc/a blocks:
abc/b closed
>>> ret = ui.run(cmd, {'show-summary':True}, ['/a']) 
abc/a blocked by:
abc/b       Bug B
abc/a blocks:
abc/b       Bug B
>>> ret = ui.run(cmd, {'repair':True})
>>> ret = ui.run(cmd, {'remove':True}, ['/b', '/a'])
abc/b blocks:
abc/a
>>> ret = ui.run(cmd, {'remove':True}, ['/a', '/b'])
>>> ui.cleanup()
>>> bd.cleanup()

Methods

bug_string(_bug, params)
cleanup()
complete([argument, fragment])
help(*args)
run([options, args])
usage()
bug_string(_bug, params)
name = 'depend'
class libbe.command.depend.DependencyTree(bugdir, root_bug, depth_limit=0, filter=None)

Note: should probably be DependencyDiGraph.

Methods

blocked_by_tree()
blocks_tree()
blocked_by_tree()
blocks_tree()
class libbe.command.depend.Filter(status='all', severity='all', assigned='all', target='all', extra_strings_regexps=[])
libbe.command.depend.add_block(blocked_bug, blocking_bug)
libbe.command.depend.check_dependencies(bugdir, repair_broken_links=False)

Check that links are bi-directional for all bugs in bugdir.

>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir()
>>> a = bd.bug_from_uuid("a")
>>> b = bd.bug_from_uuid("b")
>>> blocked_by_string = _generate_blocked_by_string(b)
>>> _add_remove_extra_string(a, blocked_by_string, add=True)
>>> good,repaired,broken = check_dependencies(bd, repair_broken_links=False)
>>> good
[]
>>> repaired
[]
>>> broken
[(Bug(uuid='a'), Bug(uuid='b'))]
>>> _get_blocks(b)
[]
>>> good,repaired,broken = check_dependencies(bd, repair_broken_links=True)
>>> _get_blocks(b)
['a']
>>> good
[]
>>> repaired
[(Bug(uuid='a'), Bug(uuid='b'))]
>>> broken
[]
libbe.command.depend.get_blocked_by(bugdir, bug)

Return a list of bugs blocking the given bug.

libbe.command.depend.get_blocks(bugdir, bug)

Return a list of bugs that the given bug blocks.

libbe.command.depend.parse_severity(severity, important=False)
libbe.command.depend.parse_status(status)
libbe.command.depend.remove_block(blocked_bug, blocking_bug)

This Page