Filebase¶
flowtask.components.FileBase
¶
FileBase
¶
Bases: FlowComponent
FileBase
Overview
Abstract base class for file-based components.
Properties (inherited from FlowComponent)
.. table:: Properties :widths: auto
+--------------------+----------+-----------+------------------------------------------------------------+
| Name | Required | Summary |
+--------------------+----------+-----------+------------------------------------------------------------+
| create_destination | No | Boolean flag indicating whether to create the destination |
| | | directory if it doesn't exist (default: True). |
+--------------------+----------+-----------+------------------------------------------------------------+
| directory | Yes | The path to the directory containing the files. |
+--------------------+----------+-----------+------------------------------------------------------------+
| filename | No | A filename (string), list of filenames (strings), or a |
| | | glob pattern (string) to identify files. |
+--------------------+----------+-----------+------------------------------------------------------------+
| file | No | A pattern or filename (string) to identify files. |
| | | (This property takes precedence over 'filename' if both are specified.)|
+--------------------+----------+-----------+------------------------------------------------------------+
get_filelist
¶
Retrieves a list of files based on the component's configuration.
This method determines the list of files to process based on the component's attributes such as 'pattern', 'file', or 'filename'. It applies any masks or variables to the file patterns if specified.
Returns:
| Type | Description |
|---|---|
list[PurePath]
|
list[PurePath]: A list of PurePath objects representing the files to be processed. If no specific pattern or filename is set, it returns all files in the component's directory. |