runtime/NevowServer.py
changeset 1680 6db967480b7d
parent 1667 cefc9219bb48
child 1682 496029f768d9
equal deleted inserted replaced
1679:2fcea15858a5 1680:6db967480b7d
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
     4 # This file is part of Beremiz runtime.
     4 # This file is part of Beremiz runtime.
     5 #
     5 #
     6 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
     6 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
       
     7 # Copyright (C) 2017: Andrey Skvortsov
     7 #
     8 #
     8 # See COPYING.Runtime file for copyrights details.
     9 # See COPYING.Runtime file for copyrights details.
     9 #
    10 #
    10 # This library is free software; you can redistribute it and/or
    11 # This library is free software; you can redistribute it and/or
    11 # modify it under the terms of the GNU Lesser General Public
    12 # modify it under the terms of the GNU Lesser General Public
    20 # You should have received a copy of the GNU Lesser General Public
    21 # You should have received a copy of the GNU Lesser General Public
    21 # License along with this library; if not, write to the Free Software
    22 # License along with this library; if not, write to the Free Software
    22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    23 
    24 
    24 import os
    25 import os
       
    26 import util.paths as paths
    25 from nevow import rend, appserver, inevow, tags, loaders, athena
    27 from nevow import rend, appserver, inevow, tags, loaders, athena
    26 from nevow.page import renderer
    28 from nevow.page import renderer
    27 from twisted.python import util
    29 from twisted.python import util
    28 from twisted.internet import reactor
    30 from twisted.internet import reactor
    29 
    31 
   120     MainPage = MainPage()
   122     MainPage = MainPage()
   121     PLCHMI = PLCHMI
   123     PLCHMI = PLCHMI
   122 
   124 
   123     def __init__(self, plcState=False, *a, **kw):
   125     def __init__(self, plcState=False, *a, **kw):
   124         super(WebInterface, self).__init__(*a, **kw)
   126         super(WebInterface, self).__init__(*a, **kw)
   125         self.jsModules.mapping[u'WebInterface'] = util.sibpath(__file__, 'webinterface.js')
   127         self.jsModules.mapping[u'WebInterface'] = paths.AbsNeighbourFile(__file__), 'webinterface.js')
   126         self.plcState = plcState
   128         self.plcState = plcState
   127         self.MainPage.setPLCState(plcState)
   129         self.MainPage.setPLCState(plcState)
   128 
   130 
   129     def getHMI(self):
   131     def getHMI(self):
   130         return self.MainPage.getHMI()
   132         return self.MainPage.getHMI()