Skip to content
Snippets Groups Projects
Commit aaf04517 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Copying flagtargetstemplate.txt files into the rawdata if they exist

parent ddc364d6
No related branches found
No related tags found
2 merge requests!1669Catchup with main,!1640WS-1975 Image flagtemplate rawdata
......@@ -56,6 +56,7 @@ class GeneralFoundation(FoundationIF):
def __init__(self, parameters: dict, metadata: AbstractTextFile):
self.logger = logging.getLogger("casa_envoy")
self.parent_path = parameters["parent_path"]
self.rawdata_dir = self.parent_path / "rawdata"
self.working_dir = self.parent_path / "working"
self.content = json.loads(metadata.content)
......@@ -76,8 +77,21 @@ class GeneralFoundation(FoundationIF):
if stripped_file:
shutil.copy(stripped_file, self.working_dir)
self.copy_into_rawdata()
self.logger.info("General data foundation complete!")
def copy_into_rawdata(self):
"""
CASA expects some files from the 'working' directory to also exist next to the data in the 'rawdata' directory.
:return:
"""
# Copy files that need to exist next to the data into the rawdata directory
for file in self.working_dir.glob('*flagtargetstemplate.txt'):
if file.exists():
shutil.copy(file, self.rawdata_dir)
class RestoreFoundation(FoundationIF):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment