lib.config

Module Contents

Classes

Config()

Functions

parse(cfg_file,cfg_section,c2ctemplate_style=False) Parses the defined YAML file and returns the defined section as dictionary.
parse(cfg_file, cfg_section, c2ctemplate_style=False)

Parses the defined YAML file and returns the defined section as dictionary.

Args:
cfg_file (str): The YAML file to be parsed. cfg_section (str): The section to be returned.
Returns:
dict: The parsed section as dictionary.
class Config
init(configsection, c2ctemplate_style=False)

Loads configuration from yaml file and provides methods for generating webservice output.

Args:
config_file (str): The configuration yaml file. config_section (str): The section within the yaml file.
update_settings()
get_themes()

Returns a list of available themes.

Returns:
list of pyramid_oereb.lib.records.theme.ThemeRecord: The available themes.
get_theme()

Returns the theme with the specified code.

Args:
code (str): The theme’s code.
Returns:
pyramid_oereb.lib.records.theme.ThemeRecord or None: The theme with the specified code.
get_theme_thresholds()

Returns the limits for the geometries of the theme with the specified code.

Parameters:code (str) – The theme’s code.
Returns:The geometric tolerances for this theme.
Return type:dict
get_all_federal()

Returns a list of all federal topic codes.

Returns:All federal topic codes.
Return type:list of str
get_crs()

Returns a list of available crs.

Returns:
list: The available crs.
get_language()

Returns a list of available languages.

Returns:
list: The available languages.
get_flavour()

Returns a list of available flavours.

Returns:
list: The available flavours.
get_geometry_types()

Returns a list of available geometry_types.

Returns:The available geometry types.
Return type:list
get_real_estate_config()

Returns a dictionary of the configured real estate settings.

Returns:
dict: The configured real estate settings.
get_address_config()

Returns a dictionary of the configured address settings.

Returns:
dict: The configured address settings.
get_glossary_config()

Returns a dictionary of the configured glossary settings.

Returns:
dict: The configured glossary settings.
get_exclusion_of_liability_config()

Returns a dictionary of the configured exclusion_of_liability settings.

Returns:
dict: The configured exclusion_of_liability settings.
get_municipality_config()

Returns a dictionary of the configured municipality settings.

Returns:
dict: The configured municipality settings.
get_extract_config()

Returns a dictionary of the configured extract settings.

Returns:
dict: The configured extract settings.
get_plr_cadastre_authority()

Returns an office record for the configured PLR cadastre authority.

Returns:
pyramid_oereb.lib.records.office.OfficeRecord: The configured PLR cadastre authority.
get_logo_config()

Returns a dictionary of the configured file path’s to the logos.

Returns:
dict: The configured paths to the logos wrapped in a dictionary.
get_oereblex_config()

Returns a dictionary of the configured OEREBlex settings.

Returns:
dict: The configured OEREBlex settings.
get_base_data()

Returns the multilingual base data description with updated currentness.

Args:
base_data_date datetime.datetime: The base data currentness.
Returns:
dict: The multilingual base data with updated currentness.
get(default=None)

Returns the specified configuration value.

Args:

key (str): Configuration parameter name. default (*): Default value if the specified parameter is not defined. Defaults to

None.
Returns:
*: The specified configuration or default value
get_object_path(default=None, required=None)

Returns the configuration object at a specified path.

example: get_object_path(‘app.print’, {‘dpi’: 300}, [‘map_size’])

Args:
path (str): Dot separated path of the wonted object. default (dict): Default dictionary values of the object. Defaults to {}. required (list): The list of required sub values in the object. Defaults to [].
Returns:
*: The specified configuration object.
_get_object_path(current_object, path, default, required)
get_law_status(law_status_config, law_status_code)
Args:

theme_code (str): The theme code. law_status_config (dict): The configured mapping of the plrs law status. law_status_code (str): The law status code read from the data to wrap it into the only two allowed

values: “inForce” or “runningModifications” which are possible on the extract.
Returns:
str: The mapped law status. This is “inForce” or “runningModifications”.
Raises:
AttributeError: If the passed law status code does not match one of the configured ones.
get_law_status_translations()

Obtaining the law status translations from config via the code.

Args:
code (str): The law status code. This must be “inForce” or “runningModifications”. Any other
value won’t match and throw a silent error.
Returns:
dict: The translation from the configuration.