CompositeBuilder

class disseminate.builders.composite_builders.composite_builder.CompositeBuilder(env, subbuilders=None, **kwargs)

A builder that integrates multiple (sub)-builders

Parameters
subbuildersOptional[List[builders.Builder]

The subbuilders to run as part of this composite builder.

Attributes
clear_donebool

If True (default), remove ‘done’ subbuilders during the build.

build(complete=False)

Run the build.

Parameters
completeOptional[bool]

If True, run the build until it has completed If False, start the build in the background.

Returns
statusstr

The current status of the build.

Note

  • This function will run the sub-builders.

  • Each builder is atomic

  • When running a build, not all of the builders might be called in the first build–for example, subsequent builders may rely on the results of previous builds. For this reason, builders should be used in conjunction with an environment to make sure a set of builds are completed or the build complete=True should be used.

flatten(builder=None)

Generate a flat list with this builder and all subbuilders (recursively).

Parameters
builderOptional[:obj:` <.composite_builders.CompositeBuilder>`]

If specified, flatten the given builder, instead of this builder.

Returns
flattened_listList[:obj:` <.composite_builders.CompositeBuilder>`]

The flattened list of builders.

futures(builder=None)

Generate a list of this builder’s future and all sub-builder futures (recursively)

Parameters
builderOptional[:obj:` <.composite_builders.CompositeBuilder>`]

If specified, flatten the given builder, instead of this builder.

Returns
futuresList[:obj:` <concurrent.futures.Future>`]

The flattened list of futures.

print(level=1, max_level=None)

Print the builder and subbuilders

run_cmd_args()

Format the for all sub commands

Returns
run_cmd_argsTuple[str]

A tuple of the arguments for all sub-builders

property status

The status of the builder.

The builder can have the following states:
  • ‘ready’: The builder is active and the parameters have been set

  • ‘inactive’: The builder isn’t active–see the active property

  • ‘missing (parameters)’: All the required parameters have not been specified or files for paths in the parameters do not exist

  • ‘missing (outfilepath)’: The outfilepath was not created

  • ‘cancelled’ : The build was cancelled.

  • ‘building’: The builder is building

  • ‘done’: The builder is done building