~roshless/nnrss

ba89bfc6fc21f21795adc6f7805dcc4fa0190aec — Roshless 3 months ago 56574d5 master
SafeConfigParser was renamed into ConfigParser in py3.2
1 files changed, 5 insertions(+), 3 deletions(-)

M nnrss/config.py
M nnrss/config.py => nnrss/config.py +5 -3
@@ 1,4 1,4 @@
from configparser import SafeConfigParser
from configparser import ConfigParser
from os import environ, path, urandom
from sys import exit, stderr



@@ 24,7 24,7 @@ class ConfigManager:

    conn_string = "sqlite:///nnrss.db"

    def __load_config(self, loaded_config: SafeConfigParser):
    def __load_config(self, loaded_config: ConfigParser):
        loaded_config.read(self.config_filename)

        self.api_enabled = loaded_config.getboolean(self.section_access, "api_enabled")


@@ 40,10 40,12 @@ class ConfigManager:

        self.secret_key = loaded_config[self.section_access]["secret_key"]

        self.broker_string = loaded_config[self.section_queue]["broker"]

        self.backend = loaded_config[self.section_database]["backend"]

    def __init__(self):
        loaded_config = SafeConfigParser()
        loaded_config = ConfigParser()

        if path.exists(self.config_filename):
            self.__load_config(loaded_config)