1
1
"""Read parameter files containing configuration information."""
2
2
# -*- coding: utf-8 -*-
3
3
from json import load ,dump
4
- from os . path import exists
5
- from shutil import copyfile
4
+ from shutil import copyfile , move
5
+ import os
6
6
import sys
7
7
8
8
def read_params ():
@@ -11,7 +11,7 @@ def read_params():
11
11
If the file does not exist, it copies the file 'params.json.template' to
12
12
'params.json' and then reads the file.
13
13
"""
14
- if not exists ("params.json" ):
14
+ if not os . path . exists ("params.json" ):
15
15
copyfile ("params.json.template" , "params.json" )
16
16
17
17
with open ("params.json" , "r" ) as json_file :
@@ -87,3 +87,12 @@ def params_run():
87
87
with open ("params.json" , "w" ) as f :
88
88
dump (params , f , sort_keys = True , indent = 2 )
89
89
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