5.2. Script

script.make_graph(args, is_graphviz)

Make a graph depend on what command line options was inputed.

Parameters:
  • args – Command line args created by OptParser.
  • is_graphviz – Is graphiz avalible. If not, do nothing.
script.check_for_graphviz(args)

Check for dot command, but only if command line wanted graph.

Parameters:args – Command line args created by OptParser.
Returns:True if command line setted the graph argument and there is a dot command.
script.append_python_path([cwd=None])

Append provided (or actual cwd if not provided) path to python path.

Parametr cwd:path which will be appended
script.run_tasks(mkfile, args)

Run tasks from imported mkfile with command line arguments.

Parameters:
  • mkfile – mkfile.py module
  • args – Command line args created by OptParser.
Returns:

Text representing what have been done: * ‘list all’ - printed list of all tasks * ‘run tasks’ - run inputed task * ‘do graph of all’ - made graph of all tasks * ‘run default’ - run default task

script.run()

Main function of the program. Parse command line args and do the task provided. More info 3. Command line or with inputing “pymk -h”.

Returns:
Errors:
  1. Everything is ok.
  2. no mkfile.py found or it is corrupted
  3. error in external program
  4. wrong task name
  5. provided task has no output_file, which is needed becouse of dependencys
  6. could not create a file that is in depedency
  7. command aborted (by keyboard)

Previous topic

5.1. Graph

This Page