fab.steps.find_source_files module#
Gather files from a source folder.
- class fab.steps.find_source_files.Include(*filter_strings)#
Bases:
_PathFilter
A path filter which includes matching paths, this convenience class improves config readability.
- Parameters:
filter_strings – One or more strings to be used as pattern matches.
- class fab.steps.find_source_files.Exclude(*filter_strings)#
Bases:
_PathFilter
A path filter which excludes matching paths, this convenience class improves config readability.
- Parameters:
filter_strings – One or more strings to be used as pattern matches.
- fab.steps.find_source_files.find_source_files(config, source_root=None, output_collection='all_source', path_filters=None)#
Find the files in the source folder, with filtering.
Files can be included or excluded with simple pattern matching. Every file is included by default, unless the filters say otherwise.
Path filters are expected to be provided by the user in an ordered collection. The two convenience subclasses,
Include
andExclude
, improve readability.Order matters. For example:
path_filters = [ Exclude('my_folder'), Include('my_folder/my_file.F90'), ]
In the above example, swapping the order would stop the file being included in the build.
A path matches a filter string simply if it contains it, so the path my_folder/my_file.F90 would match filters “my_folder”, “my_file” and “er/my”.
- Parameters:
config – The
fab.build_config.BuildConfig
object where we can read settings such as the project workspace folder or the multiprocessing flag.source_root – Optional path to source folder, with a sensible default. (default:
None
)output_collection – Name of artefact collection to create, with a sensible default. (default:
'all_source'
)path_filters (
Optional
[Iterable
[_PathFilter
]]) – Iterable of Include and/or Exclude objects, to be processed in order. (default:None
)name – Human friendly name for logger output, with sensible default.