b.a.AddAction(object) : class documentation

Part of bzrlib.add View In Hierarchy

Known subclasses: bzrlib.add.AddFromBaseAction, bzrlib.add.AddWithSkipLargeAction, bzrlib.tests.test_smart_add.AddCustomIDAction

A class which defines what action to take when adding a file.
Method __init__ Initialize an action which prints added files to an output stream.
Method __call__ Add path to inventory.
Method skip_file Test whether the given file should be skipped or not.
def __init__(self, to_file=None, should_print=None):
Initialize an action which prints added files to an output stream.
Parametersto_fileThe stream to write into. This is expected to take Unicode paths. If not supplied, it will default to sys.stdout.
should_printIf False, printing will be suppressed.
def __call__(self, inv, parent_ie, path, kind, _quote=osutils.quotefn):
Add path to inventory.

The default action does nothing.

ParametersinvThe inventory we are working with.
pathThe FastPath being added
kindThe kind of the object being added.
def skip_file(self, tree, path, kind, stat_value=None):
Test whether the given file should be skipped or not.

The default action never skips. Note this is only called during
recursive adds

:param tree: The tree we are working in
:param path: The path being added
:param kind: The kind of object being added.
:param stat: Stat result for this file, if available already
:return bool. True if the file should be skipped (not added)
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.