Previous topic

Actions

Next topic

Makefile rule parser

This Page

Commands

class soclib_builder.command.Command

A build step for an Action. This step may be performed by direct Python code or an external command execution.

__init__(self, cmd, cwd = None, on_done = None)

Creates a new command, with an optional callback on completion.

Parameters:
  • cmd – Command to run. This is a list of strings used as argv, containing argv[0].
  • cwd – Current working directory for the command, if relevant. If left to the None default value, the directory in which the command is run is not predictible.
  • on_done

    A callable called on completion of the command. This will be called with the following arguments:

    on_done(command, return_code, stdout, stderr)

command

A pretty-printed string corresponding to the command.

run(synchronous = False)

Runs the command.

Parameters:synchronous – Whether to wait for the completion of the command to return from the method.
classmethod pending_action_count()
Returns:the count of currently-running background commands
classmethod wait()

Waits for at least one background command to complete

is_background()
Returns:whether this command is performed in background
class soclib_builder.command.CreateFile(soclib_builder.command.Command)

A simple command able to create a file

__init__(filename, contents, on_done = None)
Parameters:
  • filename – File to create
  • contents – Future contents of the file
  • on_done – Callable to call back on completion
class soclib_builder.command.CreateDir(soclib_builder.command.Command)

A simple command able to create a directory

__init__(filename, on_done = None)
Parameters:
  • filename – Directory name to create
  • on_done – Callable to call back on completion