findFlowTemplate#

pyCGM2.flow.flowFilters.findFlowTemplate(template_pathFilename=None)#

Find the template of the flow user settings file.

The template is not distributed with pyCGM2. It is searched in this order:

  1. template_pathFilename, if provided;

  2. the path given by the PYCGM2_FLOW_TEMPLATE environment variable (it can be set in a .env file);

  3. the user folder %APPDATA%/pyCGM2/templates/cgm#i-settings.tpl;

  4. the pyCGM2 settings folder Settings/templates/cgm#i-settings.tpl (development copy).

An explicit path (1 or 2) which does not exist raises an error, without falling back to the other locations.

Parameters:

template_pathFilename (str, optional) – Path of the template.

Returns:

str – Path of the template.

Raises:

FileNotFoundError – If the template is not found.