pytuflow.BlockControl

pytuflow.BlockControl#

class BlockControl(path=None, config=None, parent=None, scope=None, parser=None, parent_input=None, **kwargs)#

Bases: ControlFileBuildState

Control file class for TUFLOW FV blocks.

Unlike other control file classes, this class is not directly associated with a control file command. It also does not have a separate file path associated with the control file, as a block is just a collection of inputs within an FV control file.

Parameters:
  • path (str | Path)

  • config (TCFConfig)

  • parent (BuildState | None)

  • scope (ScopeList)

  • parser (Iterator[ControlFileBuildState])

  • parent_input (T_Input)

__init__(path=None, config=None, parent=None, scope=None, parser=None, parent_input=None, **kwargs)#
Parameters:
  • path (str | Path)

  • config (TCFConfig)

  • parent (ControlFile)

  • scope (ScopeList)

  • parser (Iterator[ControlFileBuildState])

  • parent_input (T_Input)

Methods

append_input

Appends a new input to the end of the control file.

comment_out

Comments out a given input.

context

Create a RunState version of this object.

find_input

Find a particular input(s) using a search filter.

input

Returns the input with the given UUID.

insert_input

Inserts an input before, or after, another reference input.

preview

Preview the control file in stdout.

remove_input

Removes the input from the control file.

reset

Resets all recorded changes made to the control file since the last call to write().

uncomment

Uncomment a given input.

undo

Undo the last recorded change.

write

Write the object to file.

write_block

Attributes

TUFLOW_TYPE

A string identifying the PyTUFLOW object type.

dirty

Whether the object has been changed since it was last written to file.

fpath

The path to the control file.

root_cf

Allows overriding by FVC to be the fvc rather than the tcf.

scope

List of scopes associated with the object.

config

The configuration settings for the model.

inputs

The list of inputs and comments in the control file

parent

The parent control file

altered_inputs

The list of all changes made to the control file since the last time write() was called.

loaded

Whether the control file has been loaded from disk or not.