11"""Read parameter files containing configuration information."""
22# -*- coding: utf-8 -*-
33from json import load ,dump
4- from os . path import exists
5- from shutil import copyfile
4+ from shutil import copyfile , move
5+ import os
66import sys
77
88def read_params ():
@@ -11,7 +11,7 @@ def read_params():
1111 If the file does not exist, it copies the file 'params.json.template' to
1212 'params.json' and then reads the file.
1313 """
14- if not exists ("params.json" ):
14+ if not os . path . exists ("params.json" ):
1515 copyfile ("params.json.template" , "params.json" )
1616
1717 with open ("params.json" , "r" ) as json_file :
@@ -87,3 +87,12 @@ def params_run():
8787 with open ("params.json" , "w" ) as f :
8888 dump (params , f , sort_keys = True , indent = 2 )
8989 print (f"Updated { n } items" )
90+
91+ def transfer_files ():
92+ """Transfer files to prepare for acquisition."""
93+ params = read_params ()
94+ export_dir = params ["common" ].get ("export_dir" , None )
95+ delivery_dir = params ["delivery" ].get ("delivery_dir" , None )
96+ files_to_export = os .listdir (export_dir )
97+ for file_name in files_to_export :
98+ move (os .path .join (export_dir , file_name ), delivery_dir )
0 commit comments