From 35a0756afbfb3694303e8d6d4330fe34d2dd907e Mon Sep 17 00:00:00 2001 From: mhidas Date: Thu, 25 Sep 2025 10:10:19 +1000 Subject: [PATCH] add ArchiveHandler --- aodncore/pipeline/archiveHandler.py | 24 ++++++++++++++++++++++++ setup.py | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 aodncore/pipeline/archiveHandler.py diff --git a/aodncore/pipeline/archiveHandler.py b/aodncore/pipeline/archiveHandler.py new file mode 100644 index 00000000..d912086d --- /dev/null +++ b/aodncore/pipeline/archiveHandler.py @@ -0,0 +1,24 @@ +from aodncore.pipeline import HandlerBase, PipelineFileCheckType, PipelineFileCollection, PipelineFilePublishType + + +class ArchiveHandler(HandlerBase): + """This handler does nothing other than archiving the incoming file. + """ + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.default_addition_publish_type = PipelineFilePublishType.NO_ACTION + self.archive_input_file = True + + # def preprocess(self): + # """Here you can run code that needs to run before the compliance checker step. This might be where you specify + # which files in the "eligible_files" list are "UPLOAD_ONLY", or not published at all + # + # :return: None + # """ + # self.logger.info("Running preprocess from child class") + # ( + # PipelineFileCollection(f for f in self.file_collection if f.publish_type.is_addition_type)[1:] + # .filter_by_attribute_id('check_type', PipelineFileCheckType.UNSET) + # .set_check_types(PipelineFileCheckType.NO_ACTION) + # ) diff --git a/setup.py b/setup.py index 34feb8f0..07e1ee92 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,9 @@ ENTRY_POINTS = { 'pipeline.module_versions': [ 'compliance-checker = compliance_checker:__version__' + ], + 'pipeline.handlers': [ + 'ArchiveHandler = aodncore.pipeline.archiveHandler:ArchiveHandler' ] }