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