ATLAS Offline Software
DQFileMove.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 
5 from __future__ import print_function
6 
7 
8 def importConfiguration(modname):
9  from DataQualityConfigurations import getmodule
10  print('getting configuration', modname)
11  return getmodule(modname)
12 
13 def usage():
14  cmdi = sys.argv[0].rfind("/")
15  cmd = sys.argv[0][cmdi+1:]
16  print("")
17  print("Usage: ", cmd, "<config> <prefix>")
18  print("")
19  print("This is a production utility; use TEST config for development and testing.")
20  print("")
21 
22 if __name__ == '__main__':
23  import sys
24  from DataQualityUtils import filemovemod
25 
26  if len(sys.argv) != 3:
27  usage()
28  sys.exit(1)
29 
30  configModule = sys.argv[1]
31 
32  try:
33  cmod = importConfiguration(configModule)
34  except Exception:
35  print("Could not import configuration module \'" + configModule + "\'")
36  sys.exit(1)
37 
38  try:
39  config = cmod.dqconfig
40  except Exception:
41  print("Configuration object 'dqconfig' not defined in module \'" + configModule + "\'")
42  sys.exit(1)
43 
44  filemovemod.move_files(sys.argv[2], config)
DQFileMove.usage
def usage()
Definition: DQFileMove.py:13
python.DQCDispatch.getmodule
def getmodule(modname)
Definition: DQCDispatch.py:10
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
DQFileMove.importConfiguration
def importConfiguration(modname)
Definition: DQFileMove.py:8