27 """Implementation of `try` command, relying on homemade `prefix` lib."""
32 f
"Runs the command for {MAX_N_EVENTS} events. Only commands "
33 "running over n-tuples may be prefixed, and must natively "
46 if cmds.help
or cmds.git:
50 pref_try.prepare_io(multi =
False)
52 output = str(pref_try.absoutput)
54 if os.path.isdir(pref_try.output):
55 pref_try.output += f
"/0{pref_try.extension}"
64 if pref_try.splittable
and len(pref_try.inputs) > 0:
65 nevents = pref_try.get_entries(pref_try.inputs[0])
67 pref_try.nSplit = max(nevents // MAX_N_EVENTS, 1)
68 shell_cmd += [
"-j", str(pref_try.nSplit)]
70 print(
" ".join(shell_cmd))
71 subprocess.run(shell_cmd, check=
True)