pytuflow.FileInput

pytuflow.FileInput#

class FileInput(parent, command)#

Bases: InputBuildState

Class for handling inputs that reference files.

This class will record all associated files and their scopes. This class assumes only one input file per line but the input can have variable names in it which expand to multiple files.

e.g.
Read File == input_file_<<~s~>>.trd
Parameters:
  • parent (ControlFileBuildState)

  • command (Command)

__init__(parent, command)#
Parameters:
  • parent (ControlFileBuildState)

  • command (Command)

Return type:

None

Methods

context

Create a RunState version of this object.

file_scope

Public function that will return the scope of a given file.

is_end_block

Returns whether this input is the end of a block.

is_match

Returns True if the input matches the search parameters, which is made of multiple parameters.

is_start_block

Returns whether this input is the start of a block.

record_change

Not private, but not for users to use directly either.

write

Write the object to file.

Attributes

TUFLOW_TYPE

A string identifying the PyTUFLOW object type.

comment

dirty

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

files

has_missing_files

lhs

Property holding the LHS string part of Command == Value

rhs

Property holding the value part of Command == Value.

scope

List of scopes associated with the object.

value

Property holding the value part of Command == Value.

parent

Parent object, if any.

config

Configuration settings for the TUFLOW model.

cf

A list of control file or database objects that are loaded from this input.

uuid

A unique identifier for the input, generated when the input is created.

trd

The .trd file that this input is from.

part_count

The number of parts in the input command.