eproducer.cli package
Command-line interface of EPRoducer.
The use of the command line is described in Command-line interface.
Submodules
eproducer.cli.main
Entry point of the ‘eproducer’ command. It exposes the python functions in pymodules, the shell scripts in sh_executers and the bundled files in other_files as ‘eproducer <function> [args…]’, and opens the documentation with ‘eproducer doc’.
- eproducer.cli.main.main()[source]
Runs each time eproducer is called from the terminal. Depending on the first argument, it prints the list of functions (-h), runs a python function, runs a shell script, prints the path of a bundled file or opens the documentation (doc). After the name of a python function, -h prints its docstring and -path its module. After the name of a shell script or after doc, -path prints the path of the script or of the documentation.
- Return type:
(None)
- eproducer.cli.main.open_doc(path_only=False)[source]
Opens the html documentation of EPRoducer in the web browser. Before, it builds the documentation with Sphinx if it was not built yet or if its sources changed after the last build.
- Parameters:
path_only (bool. Default=False) – True to print the path of the documentation (index.html) instead of opening it.
- Return type:
(None)
- eproducer.cli.main.output_terminal(cmd, print_output=True, skip_error=False, **kwargs)[source]
Runs a command in a terminal and prints its output while it runs.
- Parameters:
cmd (str) – bash command to be executed in the terminal.
print_output (bool. Default=True) – True for printing the output besides of returning it.
skip_error (bool. Default=False) – True for continuing running although the command fails.
**kwargs – additional options for subprocess.Popen
- Return type:
(str) standard output of the executed command.