ATLAS Offline Software
Loading...
Searching...
No Matches
acmd Namespace Reference

Functions

 main ()

Variables

str __author__ = "Sebastien Binet"
str __doc__ = "main command line script for the general purpose athena scripts"

Function Documentation

◆ main()

acmd.main ( )

Definition at line 15 of file acmd.py.

15def main():
16 import PyUtils.scripts # noqa: F401 (register all plugins)
17 import PyUtils.Logging as L
18 msg = L.logging.getLogger('Acmd')
19 msg.setLevel(L.logging.INFO)
20
21 # To avoid loading all plugins every time, first try to find
22 # a specific plugin that matches the first N arguments:
23 cmd = None
24 for i in range(1,len(sys.argv)):
25 cmd_name = '.'.join(sys.argv[1:i+1])
26 if acmdlib.Plugins.exists(cmd_name):
27 cmd = acmdlib.Plugins.load(cmd_name)
28 break
29
30 # Otherwise load all plugins and leave the rest to the parser:
31 if cmd is None:
32 acmdlib.Plugins.loadAll()
33
34 parser = acmdlib.ACMD_PARSER
35 args = parser.parse_args()
36
37 exitcode = 1
38 try:
39 exitcode = cmd.main(args)
40 except Exception:
41 exitcode = 1
42 print(sys.exc_info()[0])
43 print(sys.exc_info()[1])
44 raise
45
46 return exitcode
47
48
void print(char *figname, TCanvas *c1)
int main()
Definition hello.cxx:18

Variable Documentation

◆ __author__

str acmd.__author__ = "Sebastien Binet"
private

Definition at line 9 of file acmd.py.

◆ __doc__

str acmd.__doc__ = "main command line script for the general purpose athena scripts"
private

Definition at line 10 of file acmd.py.