34 def __init__(self, jo_name=None, prog=None, print_caller_help=True, **kwargs):
40 The name of the calling job option, used to format the help
41 text. Will attempt to deduce it if possible
43 The start of the usage message, usually can be deduced
45 Whether or not to print the help text from the calling program
48 All other keyword arguments are forwarded to the base class
58 for frame
in inspect.stack():
61 fname = inspect.getfile(frame[0])
64 script
for script
in opts.scripts
if fname.endswith(script)
71 jo_name =
"User job option"
72 prog =
"{0} {1} [{0} options] -".format(os.path.basename(caller), jo_name)
75 caller_help, _ = Popen(
76 [caller,
"--help"], stdout=PIPE, stderr=PIPE
79 caller_help = caller_help.decode(
"utf-8")
80 if caller.endswith(
"athena.py"):
83 caller_help = caller_help.split(
"\n", 3)[3]
85 os.path.basename(caller), caller_help
89 super().
__init__(prog=prog, **kwargs)
93 help=
"Any remaining scripts to be run by athena after this job option. Mainly used to run the 'post' script on the grid.",