Exemplo n.º 1
0
 def parse_command_line():
     params = sys.argv[1:]
     __params_dict = dict({})
     if "help" in params:
         print message
         sys.exit(0)
     for param in params:
         __params_dict[param.split("=")[0]] = param.split("=")[1]
     set_cli_data(data=__params_dict)
Exemplo n.º 2
0
 def parse_command_line():
     params = sys.argv[1:]
     __params_dict = dict({})
     if "help" in params:
         print(message)
         sys.exit(0)
     for param in params:
         __params_dict[param.split("=")[0]] = param.split("=")[1]
     set_cli_data(data=__params_dict)
Exemplo n.º 3
0
 def __init__(self, handlers, settings=None, **kwargs):
     cli_data = get_cli_data()
     self.port = int(kwargs.get("port", 0)) or int(cli_data.get("port", DEFAULT_PORT))
     self.settings = settings
     self.handlers = handlers
     set_cli_data(self.settings)
     self.logger = init_logger()
     self.EOL1 = b'\n\n'
     self.EOL2 = b'\n\r\n'
     self.response = ""
Exemplo n.º 4
0
 def __init__(self, handlers, settings=None, **kwargs):
     cli_data = get_cli_data()
     self.port = int(kwargs.get("port", 0)) or int(
         cli_data.get("port", DEFAULT_PORT))
     self.settings = settings
     self.handlers = handlers
     set_cli_data(self.settings)
     self.logger = init_logger()
     self.EOL1 = b'\n\n'
     self.EOL2 = b'\n\r\n'
     self.response = ""
Exemplo n.º 5
0
    def __init__(self, handlers, settings=None, **kwargs):
        """

        :param handlers: handlers mapping, dict type
        :param settings: settings mapping, dict type
        :param kwargs: options

        """
        self.settings = settings
        self.handlers = handlers
        set_cli_data(self.settings)
        set_cli_data(kwargs)
        cli_data = get_cli_data()
        self.port = int(cli_data.get("port", DEFAULT_PORT))
        self.logger = init_logger()
        self.EOL1 = b'\n\n'
        self.EOL2 = b'\n\r\n'
        self.response = ""
Exemplo n.º 6
0
    def __init__(self, handlers, settings=None, **kwargs):
        """

        :param handlers: handlers mapping, dict type
        :param settings: settings mapping, dict type
        :param kwargs: options

        """
        self.handlers = handlers
        set_cli_data(settings)
        set_cli_data(kwargs)
        cli_data = get_cli_data()
        self.settings = cli_data
        self.port = int(cli_data.get("port", DEFAULT_PORT))
        log_conf = self.settings.get("log_conf", None) if self.settings else kwargs.get("log_conf", None)
        self.logger = init_logger(config_path=log_conf)
        self.EOL1 = '\n\n'
        self.EOL2 = '\n\r\n'
        self.response = ""
Exemplo n.º 7
0
    def __init__(self, handlers, settings=None, **kwargs):
        """

        :param handlers: handlers mapping, dict type
        :param settings: settings mapping, dict type
        :param kwargs: options

        """
        self.settings = settings
        self.handlers = handlers
        set_cli_data(self.settings)
        set_cli_data(kwargs)
        cli_data = get_cli_data()
        self.port = int(cli_data.get("port", DEFAULT_PORT))
        log_conf = self.settings.get("log_conf",
                                     None) if self.settings else kwargs.get(
                                         "log_conf", None)
        self.logger = init_logger(config_path=log_conf)
        self.EOL1 = b'\n\n'
        self.EOL2 = b'\n\r\n'
        self.response = ""
Exemplo n.º 8
0
 def default(**kwargs):
     set_cli_data(kwargs)
Exemplo n.º 9
0
 def default(**kwargs):
     set_cli_data(kwargs)