17.1.1.6. AcquisitionForkStep

class acquisition.AcquisitionForkStep[source]

Bases: acquisition.AcquisitionStep

Class to describe a fork acquisition step.

Variables:command_template (string) – command template to execute

Attributes Summary

command_template

Methods Summary

add_extra_arguments(parser) Add some extra argument to commande line parsing.
get_command(filepath)
init() Method called after CLI parsing but before processing any files.
process(xaf) Process one file.

Attributes Documentation

command_template = None

Methods Documentation

add_extra_arguments(parser)[source]

Add some extra argument to commande line parsing.

If you have to add some, you have to override this method.

Parameters:parser – an ArgumentParser object (with default options added).
get_command(filepath)[source]
init()[source]

Method called after CLI parsing but before processing any files.

process(xaf)[source]

Process one file.

Process one XattrFile. You have to override this method (unless your class inherits from BatchStep, see batch_process() in that case).

The file is moved into a temporary directory before the call with an unique filename. Extended attributes are copied to it. So you can do what you want with it.

If the method returns True:

  • we considerer that the processing is ok
  • the file is delete if necessary

If the method doesn’t return True:

  • we considerer that the processing is not ok (a warning message is
    logged).
  • the file is given to the choosen failure policy.
Parameters:xaf – XattrFile object.
Returns:processing status (True: ok, False: not ok)
Return type:boolean