An action. This is a step in a build process, corresponding to a set of steps to perform to produce results. An action can be performed directly by Python code, or by running soclib_builder.command.Command objects.
Initialization
Creates a new Action object. It must declare its sources and destinations, and can contain an arbitrary list of optional parameters.
Parameters: |
|
---|
Working with the action
Prepare this action:
Returns: | whether all the output files exist, and are newer than any of the inputs |
---|
Add a given list of soclib_builder.bblock.BBlock objects as users of this action. This is not necessarily a list of input objects, but can be bblocks needing completion of this action some time before their creation.
Parameters: | users – a list of soclib_builder.bblock.BBlock |
---|
Managing build steps
Build steps must be added in order in the action. This is up to Action inheriting class to populate the build steps with the following methods.
Add a command to the list of commands associated to this action.
Parameters: |
|
---|
Add a file to create in the build steps.
Parameters: |
|
---|
Running the action
Synchronously run all the steps involved in the action.
Notifies this action that at least one source file changed, and the action must recompute its completion state.
API used by the soclib_builder.todo.ToDo
Run all the associated steps of the action
Parameters: | synchronous – Whether to run the steps in background |
---|
Returns: | one of Action.BLOCKED, Action.DONE or Action.TODO corresponding to the current action’s state. |
---|
Returns: | whether the action is ready to be performed |
---|
Prints on sys.stdout why this action is blocked.
Delete all products
Pretty printing helpers
These methods can be reimplemented by subclassers in order to provide uniform output format among tools
Reformat the stdout of tools
Parameters: | msg – String containing a line of a stdout message |
---|---|
Returns: | A string reformated containing the same data |
Reformat the stderr of tools
Parameters: | msg – String containing a line of a stderr message |
---|---|
Returns: | A string reformated containing the same data |
A simple action that creates a file.
If file already exists, it will be overwritten only if its contents differs from the desired contents.
Creates a new textfile creation action that will contain the given contents.
Parameters: |
|
---|
All methods are inherited from soclib_builder.textfile.TextFile.