ATLAS Offline Software
Loading...
Searching...
No Matches
python.filemovemod Namespace Reference

Functions

 move_files (prefix, config)

Function Documentation

◆ move_files()

python.filemovemod.move_files ( prefix,
config )

Definition at line 3 of file filemovemod.py.

3def move_files(prefix, config):
4 import os, shutil, subprocess
5
6 filemap = config.filemap
7 if filemap == {}:
8 return
9 for src, dest in filemap.items():
10 print(src, dest)
11 if os.access(src, os.R_OK):
12 if dest.startswith('root://'):
13 try:
14 subprocess.check_call(['xrdcp', src, os.path.join(dest, prefix + '_' + os.path.basename(src))])
15 except subprocess.CalledProcessError as e:
16 print(e)
17 else:
18 try:
19 shutil.copy2(src, os.path.join(dest, prefix + '_' + os.path.basename(src)))
20 except IOError as e:
21 print(e)
22
void print(char *figname, TCanvas *c1)