Mercurial > libervia-backend
diff sat/tools/config.py @ 3031:98d1f34ce5b9
tools (config), memory: renamed SafeConfigParser following Python 3 port
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 16 Aug 2019 17:06:43 +0200 |
parents | ab2696e34d29 |
children | 8b36e5c3f28f |
line wrap: on
line diff
--- a/sat/tools/config.py Fri Aug 16 14:14:19 2019 +0200 +++ b/sat/tools/config.py Fri Aug 16 17:06:43 2019 +0200 @@ -23,7 +23,7 @@ import os import csv import json -from configparser import SafeConfigParser, DEFAULTSECT, NoOptionError, NoSectionError +from configparser import ConfigParser, DEFAULTSECT, NoOptionError, NoSectionError from xdg import BaseDirectory from sat.core.log import getLogger from sat.core.constants import Const as C @@ -42,7 +42,7 @@ @param value (str): the new value @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - config = SafeConfigParser() + config = ConfigParser() target_file = None for file_ in C.CONFIG_FILES[::-1]: # we will eventually update the existing file with the highest priority, @@ -72,7 +72,7 @@ def parseMainConf(): """look for main .ini configuration file, and parse it""" - config = SafeConfigParser(defaults=C.DEFAULT_CONFIG) + config = ConfigParser(defaults=C.DEFAULT_CONFIG) try: config.read(C.CONFIG_FILES) except Exception as e: @@ -83,7 +83,7 @@ def getConfig(config, section, name, default=None): """Get a configuration option - @param config (SafeConfigParser): the configuration instance + @param config (ConfigParser): the configuration instance @param section (str): section of the config file (None or '' for DEFAULT) @param name (str): name of the option @param default: value to use if not found, or Exception to raise an exception