Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > 34ec476497f9224385bc7f2b085ebd40 > files > 2

kazam-1.4.5-18.mga9.src.rpm

From 37e53a5aa61f4223a9ea03ceeda26eeba2b9d37b Mon Sep 17 00:00:00 2001
From: Spitsyn Sergey <sswebcoder@gmail.com>
Date: Fri, 5 Oct 2018 18:52:53 +0300
Subject: [PATCH] Preparing config was fixed.

---
 kazam/backend/config.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/kazam/backend/config.py b/kazam/backend/config.py
index 59a6c5a..15beb12 100644
--- a/kazam/backend/config.py
+++ b/kazam/backend/config.py
@@ -73,7 +73,7 @@ class KazamConfig(ConfigParser):
     CONFIGFILE = os.path.join(CONFIGDIR, "kazam.conf")
 
     def __init__(self):
-        ConfigParser.__init__(self, self.DEFAULTS[0]['keys'])
+        super().__init__(self)
         if not os.path.isdir(self.CONFIGDIR):
             os.makedirs(self.CONFIGDIR)
         if not os.path.isfile(self.CONFIGFILE):
@@ -98,9 +98,9 @@ class KazamConfig(ConfigParser):
                     if d_key == key:
                         return d_section["keys"][key]
 
-    def get(self, section, key):
+    def get(self, section, key, **kwargs):
         try:
-            return ConfigParser.get(self, section, key)
+            return super().get(section, key, **kwargs)
         except NoSectionError:
             default = self.find_default(section, key)
             self.set(section, key, default)
@@ -120,11 +120,7 @@ class KazamConfig(ConfigParser):
             return False
 
     def set(self, section, option, value):
-        # If the section referred to doesn't exist (rare case),
-        # then create it
-        if not self.has_section(section):
-            self.add_section(section)
-        ConfigParser.set(self, section, option, str(value))
+        super().set(section, option, str(value))
 
     def write(self):
         file_ = open(self.CONFIGFILE, "w")
-- 
2.25.2