beremiz
Clone
Summary
Browse
Changes
Graph
Fixed Nevow website startup
2015-02-27, Edouard Tisserant
f31353cac197
Parents
7a2b344de8cf
Children
29b02164e65d
e723c1dd6faa
Fixed Nevow website startup
2 files changed, 6 insertions(+), 2 deletions(-)
+1
-0
Beremiz_service.py
+5
-2
runtime/NevowServer.py
--- a/Beremiz_service.py Wed Feb 25 14:00:11 2015 +0100
+++ b/Beremiz_service.py Fri Feb 27 00:40:44 2015 +0100
@@ -514,6 +514,7 @@
except Exception, e:
print "Nevow/Athena import failed :", e
webport = None
+ NS.WorkingDir = WorkingDir
if wampconf is not None :
try:
--- a/runtime/NevowServer.py Wed Feb 25 14:00:11 2015 +0100
+++ b/runtime/NevowServer.py Fri Feb 27 00:40:44 2015 +0100
@@ -9,6 +9,8 @@
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
'''
+WorkingDir = None
+
class PLCHMI(athena.LiveElement):
initialised = False
@@ -162,8 +164,9 @@
def listen(self, state):
if state != self.oldstate:
- {'Started': self.site.PLCStarted,
- 'Stopped': self.site.PLCStopped}[state]()
+ action = {'Started': self.site.PLCStarted,
+ 'Stopped': self.site.PLCStopped}.get(state, None)
+ if action is not None: action ()
self.oldstate = state
def website_statuslistener_factory(site):