File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 XMLManifestationMetadataExtractor
2626from ted_sws .notice_packager import DEFAULT_NOTICE_PACKAGE_EXTENSION
2727from ted_sws .notice_packager .services .metadata_transformer import MetadataTransformer
28- from ted_sws .notice_packager .services .notice_packager import create_notice_package , package_notice_and_save_to
28+ from ted_sws .notice_packager .services .notice_packager import create_notice_package , package_notice_and_save_to , \
29+ ARCHIVE_NAME_FORMAT
2930
3031CMD_NAME = "CMD_BULK_PACKAGER"
3132DEFAULT_FILES_COUNT : int = 3000
@@ -62,7 +63,7 @@ def run_cmd(self):
6263 self .output_path .mkdir (parents = True , exist_ok = True )
6364 if self .notices :
6465 for notice in self .notices :
65- output_file = self .output_path / ( notice . ted_id + DEFAULT_NOTICE_PACKAGE_EXTENSION )
66+ output_file = self .output_path / ARCHIVE_NAME_FORMAT . format ( publication_work_identifier () )
6667 self .log ("Saving package to " + str (output_file ))
6768 package_notice_and_save_to (notice = notice ,
6869 save_to = output_file )
Original file line number Diff line number Diff line change 2929from ted_sws .notice_packager .services .metadata_transformer import MetadataTransformer
3030from ted_sws .notice_packager import DEFAULT_NOTICE_PACKAGE_EXTENSION
3131
32- ARCHIVE_NAME_FORMAT = "eProcurement_notice_{notice_id }" + DEFAULT_NOTICE_PACKAGE_EXTENSION
32+ ARCHIVE_NAME_FORMAT = "{work_identifier}_{action }" + DEFAULT_NOTICE_PACKAGE_EXTENSION
3333FILE_METS_XML_FORMAT = "{notice_id}-0.mets.xml.dmd.rdf"
34- FILE_METS_ACTION_FORMAT = "{notice_id}_mets2 {action}.mets.xml"
34+ FILE_METS_ACTION_FORMAT = "{work_identifier}_ {action}.mets.xml"
3535FILE_TMD_FORMAT = "techMDID001.tmd.rdf"
3636FILE_RDF_FORMAT = "{notice_id}.rdf"
3737
@@ -79,7 +79,7 @@ def package_notice(notice: Notice) -> Notice:
7979 return notice
8080
8181
82- def package_notice_and_save_to (notice : Notice , save_to : PATH_TYPE = None ) -> str :
82+ def package_notice_and_save_to (notice : Notice , save_to : PATH_TYPE = None , work_identifier : str = None ) -> str :
8383 """
8484 This function package a Notice to save_to location.
8585 """
You can’t perform that action at this time.
0 commit comments