|
def | list_traverse (self, *args, **kwargs) |
|
def | traverse (self, predicate=lambda i, True d, prune=lambda i, False d, depth=-1, branch_first=True, visit_once=True, ignore_self=1, as_edge=False) |
|
Simple interface to perform depth-first or breadth-first traversals
into one direction.
Subclasses only need to implement one function.
Instances of the Subclass must be hashable
◆ list_traverse()
def list_traverse |
( |
|
self, |
|
|
* |
args, |
|
|
** |
kwargs |
|
) |
| |
:return: IterableList with the results of the traversal as produced by
traverse()
◆ traverse()
def traverse |
( |
|
self, |
|
|
|
predicate = lambda i , |
|
|
True |
d, |
|
|
|
prune = lambda i , |
|
|
False |
d, |
|
|
|
depth = -1 , |
|
|
|
branch_first = True , |
|
|
|
visit_once = True , |
|
|
|
ignore_self = 1 , |
|
|
|
as_edge = False |
|
) |
| |
:return: iterator yielding of items found when traversing self
:param predicate: f(i,d) returns False if item i at depth d should not be included in the result
:param prune:
f(i,d) return True if the search should stop at item i at depth d.
Item i will not be returned.
:param depth:
define at which level the iteration should not go deeper
if -1, there is no limit
if 0, you would effectively only get self, the root of the iteration
i.e. if 1, you would only get the first level of predecessors/successors
:param branch_first:
if True, items will be returned branch first, otherwise depth first
:param visit_once:
if True, items will only be returned once, although they might be encountered
several times. Loops are prevented that way.
:param ignore_self:
if True, self will be ignored and automatically pruned from
the result. Otherwise it will be the first item to be returned.
If as_edge is True, the source of the first edge is None
:param as_edge:
if True, return a pair of items, first being the source, second the
destination, i.e. tuple(src, dest) with the edge spanning from
source to destination
The documentation for this class was generated from the following file:
- /home/passerat/Stage/flaskProject/venv/lib/python3.8/site-packages/git/objects/util.py