ATLAS Offline Software
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 from __future__ import print_function
4 
5 import sys,os
6 
7 __doc__ = """Print the full path of files as found in DATAPATH.
8 Wildcards are accepted, in which case all (first) matches are printed.
9 If no match if found, nothing is printed."""
10 
11 def usage():
12  use = "usage: %s <file> [file]" % os.path.basename(sys.argv[0])
13  print (use + os.linesep*2 + __doc__)
14 
15 if len(sys.argv) <= 1:
16  usage()
17  sys.exit(1)
18 
19 try:
20  from PyJobTransformsCore.envutil import find_files_env
21 except ImportError:
22  import traceback
23  traceback.print_exc()
24  raise EnvironmentError("ATLAS Runtime environment not setup.")
25 
26 for data in sys.argv[1:]:
27  full = find_files_env(data,'DATAPATH')
28  for f in full: print (f)
find_data.usage
def usage()
Definition: find_data.py:11
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