Browse Source

Re-read configration on every run

Nikola Kotur 11 years ago
parent
commit
b74c71a6eb
2 changed files with 9 additions and 2 deletions
  1. 1 0
      reddrip/commands/run.py
  2. 8 2
      reddrip/util/config.py

+ 1 - 0
reddrip/commands/run.py

@@ -39,5 +39,6 @@ class RunCommand(Command):
 
         # Main runner.
         while True:
+            conf.read()
             for subreddit in conf.subreddits():
                 rip.process(subreddit)

+ 8 - 2
reddrip/util/config.py

@@ -10,11 +10,17 @@ class Configuration(object):
         :param config_file: Configuration file path.
         :type config_file: string
         """
-        config = ConfigParser.ConfigParser()
-        config.read(config_file)
+        self.config_file = config_file
+        self.glob = {}
+        self.subs = {}
 
+        self.read()
+
+    def read(self):
         self.glob = {}
         self.subs = {}
+        config = ConfigParser.ConfigParser()
+        config.read(self.config_file)
 
         for section in config.sections():
             for item in config.items(section):