示例#1
0
 def init_shutdown(self):
     doorpi.DoorPi().event_handler('OnWebServerStop', __name__)
     self.keep_running = False
     if self.sessions: self.sessions.destroy()
     DoorPiWebRequestHandler.destroy()
     self.fake_request()
     doorpi.DoorPi().event_handler.unregister_source(__name__, True)
示例#2
0
    def start(self):
        doorpi.DoorPi().event_handler.register_event('OnWebServerStart',
                                                     __name__)
        doorpi.DoorPi().event_handler.register_event('OnWebServerStop',
                                                     __name__)

        self.www = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, 'www', '!BASEPATH!/../DoorPiWeb')
        self.indexfile = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, 'indexfile', 'index.html')
        self.loginfile = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, 'loginfile', 'login.html')
        self.area_public_name = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, 'public', 'AREA_public')
        # https://raw.githubusercontent.com/motom001/DoorPiWeb/master/ or http://motom001.github.io/DoorPiWeb/
        self.online_fallback = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, 'online_fallback',
            'http://motom001.github.io/DoorPiWeb')
        check_config(self.config)

        doorpi.DoorPi().event_handler.register_action(
            'OnWebServerStart',
            WebServerStartupAction(self.handle_while_not_shutdown))
        doorpi.DoorPi().event_handler.register_action(
            'OnShutdown', WebServerShutdownAction(self.init_shutdown))
        doorpi.DoorPi().event_handler('OnWebServerStart', __name__)

        DoorPiWebRequestHandler.prepare()
        return self
示例#3
0
 def init_shutdown(self):
     doorpi.DoorPi().event_handler('OnWebServerStop', __name__)
     self.keep_running = False
     if self.sessions: self.sessions.destroy()
     DoorPiWebRequestHandler.destroy()
     self.fake_request()
     doorpi.DoorPi().event_handler.unregister_source(__name__, True)
示例#4
0
    def start(self):
        doorpi.DoorPi().event_handler.register_event('OnWebServerStart', __name__)
        doorpi.DoorPi().event_handler.register_event('OnWebServerStop', __name__)

        self.www = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, 'www', '!BASEPATH!/../DoorPiWeb')
        self.indexfile = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, 'indexfile', 'index.html')
        self.loginfile = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, 'loginfile', 'login.html')
        self.area_public_name = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, 'public', 'AREA_public')
        self.online_fallback = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, 'online_fallback', 'https://raw.githubusercontent.com/motom001/DoorPiWeb/master/')
        check_config(self.config)

        doorpi.DoorPi().event_handler.register_action('OnWebServerStart', WebServerStartupAction(self.handle_while_not_shutdown))
        doorpi.DoorPi().event_handler.register_action('OnShutdown', WebServerShutdownAction(self.init_shutdown))
        doorpi.DoorPi().event_handler('OnWebServerStart', __name__)

        DoorPiWebRequestHandler.prepare()
        return self
示例#5
0
    def start(self):
        doorpi.DoorPi().event_handler.register_event("OnWebServerStart", __name__)
        doorpi.DoorPi().event_handler.register_event("OnWebServerStop", __name__)

        self.www = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, "www", "!BASEPATH!/../DoorPiWeb")
        self.indexfile = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, "indexfile", "index.html")
        self.loginfile = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, "loginfile", "login.html")
        self.area_public_name = doorpi.DoorPi().config.get_string_parsed(DOORPIWEB_SECTION, "public", "AREA_public")
        # https://raw.githubusercontent.com/motom001/DoorPiWeb/master/ or http://motom001.github.io/DoorPiWeb/
        self.online_fallback = doorpi.DoorPi().config.get_string_parsed(
            DOORPIWEB_SECTION, "online_fallback", "http://motom001.github.io/DoorPiWeb"
        )
        check_config(self.config)

        doorpi.DoorPi().event_handler.register_action(
            "OnWebServerStart", WebServerStartupAction(self.handle_while_not_shutdown)
        )
        doorpi.DoorPi().event_handler.register_action("OnShutdown", WebServerShutdownAction(self.init_shutdown))
        doorpi.DoorPi().event_handler("OnWebServerStart", __name__)

        DoorPiWebRequestHandler.prepare()
        return self