Commit 36372555 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

SFTPDMC. Remove picarro_id from settings.ini

parent 87b70b68
Pipeline #57585 passed with stages
in 1 minute and 53 seconds
......@@ -34,7 +34,7 @@ class Collector(utils.LogConfig):
+ "/DMC_" + picarro_id + "_" + day.strftime("%Y%m%d") + ".zip"
# Build destination file path
dest_filepath = self.__get_dest_filepath__(day, source_filepath)
dest_filepath = self.__get_dest_filepath__(picarro_id, day, source_filepath)
# Download file
self.logger.info("Downloading DMC Picarro file from SFTP server.", day_str)
......@@ -55,10 +55,10 @@ class Collector(utils.LogConfig):
else:
self.logger.info("Done. Archive file: " + lzma_filepath, day_str)
def __get_dest_filepath__(self, day: datetime.date, source_filepath: str) -> str:
def __get_dest_filepath__(self, picarro_id: str, day: datetime.date, source_filepath: str) -> str:
# Build destination directory
dest_dir = os.path.join(self.config["LOCAL"]["base_dir"],
"DMC", "picarro", self.config[self.object_id]["picarro_id"], str(day.year))
"DMC", "picarro", picarro_id, str(day.year))
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment