Mercurial > libervia-backend
changeset 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 | e80694d536d7 |
children | 95e2fd14a761 |
files | sat/memory/memory.py sat/tools/config.py |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/memory/memory.py Fri Aug 16 14:14:19 2019 +0200 +++ b/sat/memory/memory.py Fri Aug 16 17:06:43 2019 +0200 @@ -26,7 +26,7 @@ import os.path import copy from collections import namedtuple -from configparser import SafeConfigParser, NoOptionError, NoSectionError +from configparser import ConfigParser, NoOptionError, NoSectionError from uuid import uuid4 from twisted.python import failure from twisted.internet import defer, reactor, error @@ -229,7 +229,7 @@ @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - user_config = SafeConfigParser() + user_config = ConfigParser() try: user_config.read(C.CONFIG_FILES) except:
--- 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