ATLAS Offline Software
Tools
PyJobTransformsCore
share
find_data.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
4
import
sys,os
5
6
__doc__ =
"""Print the full path of files as found in DATAPATH.
7
Wildcards are accepted, in which case all (first) matches are printed.
8
If no match if found, nothing is printed."""
9
10
def
usage
():
11
use =
"usage: %s <file> [file]"
% os.path.basename(sys.argv[0])
12
print
(use + os.linesep*2 + __doc__)
13
14
if
len(sys.argv) <= 1:
15
usage
()
16
sys.exit(1)
17
18
try
:
19
from
PyJobTransformsCore.envutil
import
find_files_env
20
except
ImportError:
21
import
traceback
22
traceback.print_exc()
23
raise
EnvironmentError(
"ATLAS Runtime environment not setup."
)
24
25
for
data
in
sys.argv[1:]:
26
full =
find_files_env
(data,
'DATAPATH'
)
27
for
f
in
full:
print
(f)
find_data.usage
def usage()
Definition:
find_data.py:10
python.envutil.find_files_env
def find_files_env(filename, env_var_name, access=os.R_OK, sep=defaultPathSeps, depth=0)
Definition:
envutil.py:190
Generated on Mon Sep 1 2025 21:10:24 for ATLAS Offline Software by
1.8.18