Exemplo n.º 1
0
def StartWebInterfaceThread(webInterface):
    current_dir = os.path.dirname(os.path.abspath(__file__))
    cherrypy.config.update({'engine.autoreload_on':False})
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config"))
    conf = {'/css/style.css': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': sharedfile('css/style.css'),
                     },
             '/images/control_xy.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_xy.png'),
                     },
             '/images/control_z.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_z.png'),
                     }}
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config"))
    cherrypy.quickstart(webInterface, '/', config = conf)
Exemplo n.º 2
0
def StartWebInterfaceThread(webInterface):
    current_dir = os.path.dirname(os.path.abspath(__file__))
    cherrypy.config.update({'engine.autoreload_on': False})
    cherrypy.config.update(
        configfile(webInterface.pface.web_config or "http.config"))
    conf = {
        '/css/style.css': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': sharedfile('css/style.css'),
        },
        '/images/control_xy.png': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': imagefile('control_xy.png'),
        },
        '/images/control_z.png': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': imagefile('control_z.png'),
        }
    }
    cherrypy.config.update(
        configfile(webInterface.pface.web_config or "http.config"))
    cherrypy.quickstart(webInterface, '/', config=conf)
Exemplo n.º 3
0
 def __init__(self, pface):
     if (sys.version_info[1] > 6):
         # 'allow_no_value' wasn't added until 2.7
         config = ConfigParser.SafeConfigParser(allow_no_value=True)
     else:
         config = ConfigParser.SafeConfigParser()
     config.read(configfile(pface.web_auth_config or 'auth.config'))
     users[config.get("user", "user")] = config.get("user", "pass")
     self.pface = pface
     global gPronterPtr
     global gWeblog
     self.name = "<div id='title'>Pronterface Web-Interface</div>"
     gWeblog = ""
     gPronterPtr = self.pface
Exemplo n.º 4
0
 def __init__(self, pface):
     if (sys.version_info[1] > 6):
         # 'allow_no_value' wasn't added until 2.7
         config = ConfigParser.SafeConfigParser(allow_no_value = True)
     else:
         config = ConfigParser.SafeConfigParser()
     config.read(configfile(pface.web_auth_config or 'auth.config'))
     users[config.get("user", "user")] = config.get("user", "pass")
     self.pface = pface
     global gPronterPtr
     global gWeblog
     self.name = "<div id='title'>Pronterface Web-Interface</div>"
     gWeblog = ""
     gPronterPtr = self.pface
Exemplo n.º 5
0
    cherrypy.engine.exit()


def StartWebInterfaceThread(webInterface):
    current_dir = os.path.dirname(os.path.abspath(__file__))
    cherrypy.config.update({'engine.autoreload_on': False})
    cherrypy.config.update(
        configfile(webInterface.pface.web_config or "http.config"))
    conf = {
        '/css/style.css': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': sharedfile('css/style.css'),
        },
        '/images/control_xy.png': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': imagefile('control_xy.png'),
        },
        '/images/control_z.png': {
            'tools.staticfile.on': True,
            'tools.staticfile.filename': imagefile('control_z.png'),
        }
    }
    cherrypy.config.update(
        configfile(webInterface.pface.web_config or "http.config"))
    cherrypy.quickstart(webInterface, '/', config=conf)


if __name__ == '__main__':
    cherrypy.config.update(configfile("http.config"))
    cherrypy.quickstart(WebInterfaceStub())
Exemplo n.º 6
0
        gWeblog = re.sub("\n", "</br>", gWeblog)+log
    index.exposed = True

class WebInterfaceStub(object):
    def index(self):
        return "<b>Web Interface Must be launched by running Pronterface!</b>"
    index.exposed = True

def KillWebInterfaceThread():
    cherrypy.engine.exit()

def StartWebInterfaceThread(webInterface):
    current_dir = os.path.dirname(os.path.abspath(__file__))
    cherrypy.config.update({'engine.autoreload_on':False})
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config"))
    conf = {'/css/style.css': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': sharedfile('css/style.css'),
                     },
             '/images/control_xy.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_xy.png'),
                     },
             '/images/control_z.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_z.png'),
                     }}
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config"))
    cherrypy.quickstart(webInterface, '/', config = conf)

if __name__ == '__main__':
    cherrypy.config.update(configfile("http.config"))
    cherrypy.quickstart(WebInterfaceStub())
Exemplo n.º 7
0
        gWeblog = re.sub("\n", "</br>", gWeblog)+log
    index.exposed = True

class WebInterfaceStub(object):
    def index(self):
        return "<b>Web Interface Must be launched by running Pronterface!</b>"
    index.exposed = True

def KillWebInterfaceThread():
    cherrypy.engine.exit()

def StartWebInterfaceThread(webInterface):
    current_dir = os.path.dirname(os.path.abspath(__file__))
    cherrypy.config.update({'engine.autoreload_on':False})
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config" or "/etc/printrun/http.config"))
    conf = {'/css/style.css': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': sharedfile('css/style.css'),
                     },
             '/images/control_xy.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_xy.png'),
                     },
             '/images/control_z.png': {'tools.staticfile.on': True,
                      'tools.staticfile.filename': imagefile('control_z.png'),
                     }}
    cherrypy.config.update(configfile(webInterface.pface.web_config or "http.config" or "/etc/printrun/http.config"))
    cherrypy.quickstart(webInterface, '/', config = conf)

if __name__ == '__main__':
    cherrypy.config.update(configfile("/etc/printrun/http.config"))
    cherrypy.quickstart(WebInterfaceStub())