예제 #1
0
    def setup(self, options=dict):
        Module.setup(self, options)

        if self.options.get("host") == self.default_options.get("host"):
            self.options["host"] = self.get_ip()

        self.connected_clients = {}

        app = Flask(__name__)
        app.config["SECRET_KEY"] = self.options.get(
            "Flask_secret_key", self.default_options.get("Flask_secret_key"))

        login_manager = LoginManager()
        login_manager.init_app(app)

        self.app = app
        self.websocket = SocketIO(
            app,
            async_mode=self.options.get(
                "SocketIO_asynch_mode",
                self.default_options.get("SocketIO_asynch_mode")),
            debug=self.options.get("SocketIO_debug",
                                   self.default_options.get("SocketIO_debug")),
            engineio_logger=self.options.get(
                "engineio_logger",
                self.default_options.get("engineio_logger")),
            use_reloader=self.options.get(
                "SocketIO_use_reloader",
                self.default_options.get("SocketIO_use_reloader")),
            passthrough_errors=True,
            ping_timeout=15,
            ping_interval=5)
        self.login_manager = login_manager
예제 #2
0
 def setup(self, options=dict):
     Module.setup(self, options)
     self.dom_element_root = self.options.get(
         "dom_element_root",
         self.default_options.get("dom_element_root", None))
     self.dom_element_select_root = self.options.get(
         "dom_element_select_root",
         self.default_options.get("dom_element_select_root", None))
     self.run_observer_interval = self.options.get(
         "run_observer_interval",
         self.default_options.get("run_observer_interval", None))
예제 #3
0
    def setup(self, options=dict):
        Module.setup(self, options)

        self.run_observer_interval = self.options.get(
            "run_observer_interval",
            self.default_options.get("run_observer_interval", None))
        self.run_observer_interval_idle = self.options.get(
            "run_observer_interval_idle",
            self.default_options.get("run_observer_interval_idle", None))
        self.dom_element_root = self.options.get(
            "dom_element_root",
            self.default_options.get("dom_element_root", None))
        self.dom_element_select_root = self.options.get(
            "dom_element_select_root",
            self.default_options.get("dom_element_select_root", None))
        self.default_max_locations = self.options.get(
            "default_max_locations",
            self.default_options.get("default_max_locations", None))
        self.standard_location_shape = self.options.get(
            "standard_location_shape",
            self.default_options.get("standard_location_shape", None))
예제 #4
0
    def setup(self, options=dict):
        Module.setup(self, options)

        self.telnet_lines_to_process = deque(
            maxlen=self.options["max_queue_length"])
        self.valid_telnet_lines = deque(
            maxlen=self.options["max_queue_length"])
        self.run_observer_interval = self.options.get(
            "run_observer_interval",
            self.default_options.get("run_observer_interval", None))
        self.run_observer_interval_idle = self.options.get(
            "run_observer_interval_idle",
            self.default_options.get("run_observer_interval_idle", None))
        self.max_command_queue_execution = self.options.get(
            "max_command_queue_execution",
            self.default_options.get("max_command_queue_execution", None))
        self.telnet_buffer = ""

        self.last_execution_time = 0.0

        setattr(self, "last_connection_loss", None)
        setattr(self, "recent_telnet_response", None)
예제 #5
0
 def setup(self, options=dict):
     Module.setup(self, options)
예제 #6
0
 def setup(self, options=dict):
     self.root_dir = path.dirname(path.abspath(__file__))
     Module.setup(self, options)