Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions aodncore/pipeline/archiveHandler.py
Original file line number Diff line number Diff line change
@@ -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)
# )
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
ENTRY_POINTS = {
'pipeline.module_versions': [
'compliance-checker = compliance_checker:__version__'
],
'pipeline.handlers': [
'ArchiveHandler = aodncore.pipeline.archiveHandler:ArchiveHandler'
]
}

Expand Down
Loading