french_locator_filter.toolbelt.preferences module

Plugin settings.

class french_locator_filter.toolbelt.preferences.PlgEnvVariableSettings[source]

Bases: object

Plugin settings from environnement variable

env_variable_used(attribute: str, default_from_name: bool = True) str[source]

Get environnement variable used for environnement variable settings

Parameters:
  • attribute (str) – attribute to check

  • default_from_name (bool) – define default environnement value from attribute name QGIS_<upper case attribute>

Returns:

environnement variable used

Return type:

str

class french_locator_filter.toolbelt.preferences.PlgOptionsManager[source]

Bases: object

static get_plg_settings() PlgSettingsStructure[source]

Load and return plugin settings as a dictionary. Useful to get user preferences across plugin logic.

Returns:

plugin settings

Return type:

PlgSettingsStructure

static get_value_from_key(key: str, default=None, exp_type=None)[source]

Load and return plugin settings as a dictionary. Useful to get user preferences across plugin logic.

Returns:

plugin settings value matching key

classmethod save_from_object(plugin_settings_obj: PlgSettingsStructure)[source]

Load and return plugin settings as a dictionary. Useful to get user preferences across plugin logic.

Returns:

plugin settings value matching key

classmethod set_value_from_key(key: str, value)[source]

Load and return plugin settings as a dictionary. Useful to get user preferences across plugin logic.

Returns:

plugin settings value matching key

class french_locator_filter.toolbelt.preferences.PlgSettingsStructure(debug_mode: bool = False, version: str = '1.3.0-DEV', http_content_type: str = 'application/json', http_user_agent: str = 'French Locator Filter/1.3.0-DEV', min_search_length: int = 3, search_terms_to_ignore: Tuple[str] = ('null', 'undefined'), request_url: str = 'https://data.geopf.fr/geocodage/search/', request_url_query: str = 'limit=10&autocomplete=1', request_photon_url: str = 'https://photon.komoot.io/api/', request_photon_url_query: str = 'limit=10&lang=fr')[source]

Bases: object

Plugin settings structure and defaults values.

debug_mode: bool = False
http_content_type: str = 'application/json'
http_user_agent: str = 'French Locator Filter/1.3.0-DEV'
min_search_length: int = 3
request_photon_url: str = 'https://photon.komoot.io/api/'
request_photon_url_query: str = 'limit=10&lang=fr'
request_url: str = 'https://data.geopf.fr/geocodage/search/'
request_url_query: str = 'limit=10&autocomplete=1'
search_terms_to_ignore: Tuple[str] = ('null', 'undefined')
version: str = '1.3.0-DEV'