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

Functions

 _setup ()

Variables

list __all__ = ['metadata']
dict metadata = {}

Function Documentation

◆ _setup()

python.MetaReaderPeeker._setup ( )
protected

Definition at line 9 of file MetaReaderPeeker.py.

9def _setup():
10 from PyUtils.MetaReader import read_metadata
11
12 from AthenaCommon.Logging import logging
13 msg = logging.getLogger('MetaReaderPeeker')
14
15 global metadata
16
17 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
18 inFiles = athenaCommonFlags.FilesInput()
19
20 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
21 if athenaCommonFlags.isOnline() and (not inFiles or all([f.strip() == '' for f in inFiles])):
22 # set minimal items of inputFileSummary
23 metadata = {
24 'file_type':'BS',
25 'eventTypes':['IS_DATA','IS_ATLAS','IS_PHYSICS'],
26 'TagStreamsRef':''
27 }
28 else:
29 if len(inFiles) < 1:
30 msg.info("No input files specified yet! Cannot do anything.")
31 return
32
33
34 for inFile in inFiles:
35
36 metadatas = read_metadata(inFile, mode='peeker', promote=True, ignoreNonExistingLocalFiles=True)
37
38 for foundFile, metadata in metadatas.items():
39
40 metadata['file_name'] = inFile
41 if metadata.get("nentries"):
42 break
43 else:
44 continue # This make the previous break to exit from both for loops
45 break
46
47 # if no nentries > 0 metadata is found, it will keep the last
48

Variable Documentation

◆ __all__

list python.MetaReaderPeeker.__all__ = ['metadata']
private

Definition at line 4 of file MetaReaderPeeker.py.

◆ metadata

dict python.MetaReaderPeeker.metadata = {}

Definition at line 6 of file MetaReaderPeeker.py.