8a47c4f32425 — cedricbonhomme 12 years ago
Iterating over each section of the configuration file.
1 files changed, 11 insertions(+), 10 deletions(-)

M watcher.py
M watcher.py +11 -10
@@ 122,15 122,16 @@ if __name__ == "__main__":
         config.read("./balloon.cfg")
     except:
         pass
-    type_repo = config.get('repo', 'type')
-    local_url = config.get('repo', 'local_url')
-    url = config.get('repo', 'url')
-    username = config.get('repo', 'username')
-    password = config.get('repo', 'password')
 
+    for repository in config.sections():
+        type_repo = config.get(repository, 'type')
+        local_url = config.get(repository, 'local_url')
+        url = config.get(repository, 'url')
+        username = config.get(repository, 'username')
+        password = config.get(repository, 'password')
 
-    # Launch a new thread for the repository to watch
-    thread = threading.Thread(None, start_watcher, None, (username, password, url, local_url))
-    thread = threading.Thread(None, start_watcher, None, (type_repo, username, password, url, local_url))
-    #thread.setDaemon(True)
-    thread.start()
  No newline at end of file
+        # Launch a new thread for the repository to watch
+        thread = threading.Thread(None, start_watcher, None, (username, password, url, local_url))
+        thread = threading.Thread(None, start_watcher, None, (type_repo, username, password, url, local_url))
+        #thread.setDaemon(True)
+        thread.start()
  No newline at end of file