Exemple #1
0
    def take_action(self, parsed_args):
        config_data = web_config.get_config_dict(
            database_name=parsed_args.database,
            host=parsed_args.host,
            port=parsed_args.port,
        )
        app = load_app(config_data)

        # Add beaker session middleware so we can track where the user
        # is and navigate back to the same place as they change tabs.
        if not six.PY3:
            app = SessionMiddleware(app, config_data['beaker'])

        host = config_data['server']['host']
        port = int(config_data['server']['port'])
        srv = simple_server.make_server(host, port, app)
        if host == '0.0.0.0':
            self.log.info(
                'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s',
                port, port,
            )
        else:
            self.log.info("serving on http://%s:%s", host, port)
        try:
            srv.serve_forever()
        except KeyboardInterrupt:
            # allow CTRL+C to shutdown
            pass
    def take_action(self, parsed_args):
        config_data = web_config.get_config_dict(
            database_name=parsed_args.database,
            host=parsed_args.host,
            port=parsed_args.port,
        )
        app = load_app(config_data)

        # Add beaker session middleware so we can track where the user
        # is and navigate back to the same place as they change tabs.
        if not six.PY3:
            app = SessionMiddleware(app, config_data['beaker'])

        host = config_data['server']['host']
        port = int(config_data['server']['port'])
        srv = simple_server.make_server(host, port, app)
        if host == '0.0.0.0':
            self.log.info(
                'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s',
                port,
                port,
            )
        else:
            self.log.info("serving on http://%s:%s", host, port)
        try:
            srv.serve_forever()
        except KeyboardInterrupt:
            # allow CTRL+C to shutdown
            pass
Exemple #3
0
    def take_action(self, parsed_args):
        config_data = web_config.get_config_dict(
            database_name=parsed_args.database,
            host=parsed_args.host,
            port=parsed_args.port,
        )
        app = load_app(config_data)

        host = config_data['server']['host']
        port = int(config_data['server']['port'])
        srv = simple_server.make_server(host, port, app)
        if host == '0.0.0.0':
            self.log.info(
                'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s',
                port, port,
            )
        else:
            self.log.info("serving on http://%s:%s", host, port)
        try:
            srv.serve_forever()
        except KeyboardInterrupt:
            # allow CTRL+C to shutdown
            pass
Exemple #4
0
    def take_action(self, parsed_args):
        config_data = web_config.get_config_dict(
            database_name=parsed_args.database,
            host=parsed_args.host,
            port=parsed_args.port,
        )
        app = load_app(config_data)

        host = config_data['server']['host']
        port = int(config_data['server']['port'])
        srv = simple_server.make_server(host, port, app)
        if host == '0.0.0.0':
            self.log.info(
                'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s',
                port,
                port,
            )
        else:
            self.log.info("serving on http://%s:%s", host, port)
        try:
            srv.serve_forever()
        except KeyboardInterrupt:
            # allow CTRL+C to shutdown
            pass
Exemple #5
0
 def setUp(self):
     self.app = load_test_app(
         config.get_config_dict(':memory:', '0.0.0.0', 9090),
     )
 def setUp(self):
     self.app = load_test_app(
         config.get_config_dict(':memory:', '0.0.0.0', 9090), )