ATLAS Offline Software
Public Member Functions | List of all members
han_lark_tester.T Class Reference
Inheritance diagram for han_lark_tester.T:
Collaboration diagram for han_lark_tester.T:

Public Member Functions

def __default_token__ (self, tok)
 
def referenceblock (self, tok)
 

Detailed Description

Definition at line 11 of file han_lark_tester.py.

Member Function Documentation

◆ __default_token__()

def han_lark_tester.T.__default_token__ (   self,
  tok 
)

Definition at line 12 of file han_lark_tester.py.

12  def __default_token__(self,tok):
13  print(tok)
14  return tok

◆ referenceblock()

def han_lark_tester.T.referenceblock (   self,
  tok 
)

Definition at line 15 of file han_lark_tester.py.

15  def referenceblock(self, tok):
16  locations = [_ for _ in tok if isinstance(_, lark.Tree) and _.data == 'location']
17  if len(locations) > 1:
18  raise ValueError(f'More than one location given for reference {tok[0].children[0]}')
19  if len(locations) > 0:
20  locs = locations[0].children[0].split(',')
21  else:
22  locs = [_.children[0] for _ in tok if isinstance(_, lark.Tree) and _.data == 'file']
23  afspaths = [_ for _ in locs if _.startswith('/afs')]
24  if any(afspaths):
25  raise ValueError('A reference location for a production han configuration is given with an AFS path\n'
26  f'Offending path is {",".join(afspaths)} of reference {tok[0].children[0]}')
27  eospaths = [_ for _ in locs if _.startswith('/eos')]
28  xrootdpaths = [_ for _ in locs if _.startswith('root://')]
29  if len(eospaths) != len(xrootdpaths):
30  raise ValueError(f'Backup xrootd locations must be given for references with EOS paths for reference {tok[0].children[0]}\n'
31  f'Given EOS paths are {",".join(eospaths)}\n'
32  f'Given xrootd paths are {",".join(xrootdpaths)}')
33  return tok

The documentation for this class was generated from the following file:
referenceblock
void referenceblock(const std::string &file)
Definition: hcg.cxx:1059
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
Trk::split
@ split
Definition: LayerMaterialProperties.h:38