diff piecrust/serving/procloop.py @ 680:c2ea75e37540

serve: Fix some crashes introduced by recent refactor.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 08 Mar 2016 01:05:39 -0800
parents 81d9c3a3a0b5
children 08e02c2a2a1a
line wrap: on
line diff
--- a/piecrust/serving/procloop.py	Mon Mar 07 00:03:13 2016 -0800
+++ b/piecrust/serving/procloop.py	Tue Mar 08 01:05:39 2016 -0800
@@ -75,10 +75,11 @@
 
 
 class ProcessingLoop(threading.Thread):
-    def __init__(self, appfactory):
+    def __init__(self, appfactory, out_dir):
         super(ProcessingLoop, self).__init__(
                 name='pipeline-reloader', daemon=True)
         self.appfactory = appfactory
+        self.out_dir = out_dir
         self.last_status_id = 0
         self.interval = 1
         self.app = None
@@ -90,10 +91,9 @@
         self._last_config_mtime = 0
         self._obs = []
         self._obs_lock = threading.Lock()
-        if appfactory.theme_site:
-            self._config_path = os.path.join(root_dir, THEME_CONFIG_PATH)
-        else:
-            self._config_path = os.path.join(root_dir, CONFIG_PATH)
+        config_name = (
+                THEME_CONFIG_PATH if appfactory.theme_site else CONFIG_PATH)
+        self._config_path = os.path.join(appfactory.root_dir, config_name)
 
     def addObserver(self, obs):
         with self._obs_lock: