refactoring
authorEdouard Tisserant
Tue, 08 May 2012 12:18:57 +0200
changeset 719 db54ccc96309
parent 718 5d4dc150b956
child 720 6be032177e2a
refactoring
Beremiz_service.py
runtime/webinterface.js
webinterface.js
--- a/Beremiz_service.py	Mon May 07 19:19:08 2012 +0200
+++ b/Beremiz_service.py	Tue May 08 12:18:57 2012 +0200
@@ -607,7 +607,7 @@
         
         def __init__(self, plcState=False, *a, **kw):
             super(WebInterface, self).__init__(*a, **kw)
-            self.jsModules.mapping[u'WebInterface'] = util.sibpath(__file__, 'webinterface.js')
+            self.jsModules.mapping[u'WebInterface'] = util.sibpath(__file__, os.path.join('runtime', 'webinterface.js'))
             self.plcState = plcState
             self.MainPage.setPLCState(plcState)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/webinterface.js	Tue May 08 12:18:57 2012 +0200
@@ -0,0 +1,24 @@
+// import Nevow.Athena
+
+function init() {
+  Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
+}
+
+WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
+WebInterface.PLC.method(
+	 'updateHMI',
+	 function (self, data) {
+	   d = self.callRemote('getPLCElement');
+	   d.addCallback(
+			 function liveElementReceived(le) {
+				d2 = self.addChildWidgetFromWidgetInfo(le);
+				d2.addCallback(
+						function childAdded(widget) {
+						var node = self.nodeById('content');
+						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
+						init();
+						});
+				});
+	   });
+
+Divmod.Base.addLoadEvent(init);
\ No newline at end of file
--- a/webinterface.js	Mon May 07 19:19:08 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// import Nevow.Athena
-
-function init() {
-  Nevow.Athena.Widget.fromAthenaID(1).callRemote('HMIexec', 'HMIinitialisation');
-}
-
-WebInterface.PLC = Nevow.Athena.Widget.subclass('WebInterface.PLC');
-WebInterface.PLC.method(
-	 'updateHMI',
-	 function (self, data) {
-	   d = self.callRemote('getPLCElement');
-	   d.addCallback(
-			 function liveElementReceived(le) {
-				d2 = self.addChildWidgetFromWidgetInfo(le);
-				d2.addCallback(
-						function childAdded(widget) {
-						var node = self.nodeById('content');
-						node.replaceChild(widget.node, node.getElementsByTagName('div')[0]);
-						init();
-						});
-				});
-	   });
-
-Divmod.Base.addLoadEvent(init);
\ No newline at end of file