17.1.1.7. AcquisitionArchiveStep¶
-
class
acquisition.
AcquisitionArchiveStep
[source]¶ Bases:
acquisition.AcquisitionStep
Class to describe an archive acquisition step.
Variables: - archive_dir (string) – the root directory where files will be archived
- keep_tags (boolean) – keep tags into another file ?
- keep_tags_suffix (string) – suffix to add to the filename to keep tags
- strftime_template (string) – template to define the sub-directory inside archive directory
Attributes Summary
archive_dir
keep_tags
keep_tags_suffix
strftime_template
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
-
archive_dir
= None¶
-
strftime_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).
-
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