18.1.1.3. AcquisitionMoveStep

class acquisition.AcquisitionMoveStep[source]

Bases: acquisition.AcquisitionStep

Class to describe a move acquisition step.

Variables
  • dest_dir (string) – destination directory

  • keep_original_basenames (boolean) – keep original basenames for move ?

  • force_chmod (string) – if set, force chmod on target files with well know octal value such as 0700

  • keep_tags (boolean) – keep tags into another file ?

  • keep_tags_suffix (string) – suffix to add to the filename to keep tags

  • drop_tags (string) – drop tags for the moved file

Attributes Summary

dest_dir

drop_tags

force_chmod

keep_original_basenames

keep_tags

keep_tags_suffix

Methods Summary

add_extra_arguments(parser)

Add some extra argument to commande line parsing.

init()

Method called after CLI parsing but before processing any files.

process(xaf)

Process one file.

Attributes Documentation

dest_dir = None
drop_tags = None
force_chmod = None
keep_original_basenames = True
keep_tags = True
keep_tags_suffix = 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).

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