Exemple #1
0
    def run(self, reload, logging, **kwargs):
        config = self._commandor_res

        if not config:
            self.error("You need specify --config\n")
            self.exit()

        configure_logging(logging)

        self.application = AggregatorApplication(config)
        ioloop = tornado.ioloop.IOLoop.instance()

        self.application.configure_app(ioloop)

        if reload:
            self.display("Autoreload enabled")
            autoreload.start(io_loop=ioloop, check_time=100)

        # Init signals handler
        signal.signal(signal.SIGTERM, self.sig_handler)

        # This will also catch KeyboardInterrupt exception
        signal.signal(signal.SIGINT, self.sig_handler)

        ioloop.start()
Exemple #2
0
    def get_app(self):
        config = Config()
        config.from_module(gottwall.default_config)
        config.update({
            "TASKS_CHUNK": 15,
            "BACKENDS": {
                "gottwall.backends.tcpip.TCPIPBackend": {
                    "PORT": get_unused_port()
                }
            }
        })

        app = AggregatorApplication(config)
        app.configure_app(tornado.ioloop.IOLoop().instance())
        return app
Exemple #3
0
    def get_app(self):
        config = Config()
        config.from_module(gottwall.default_config)
        config.update({
            "BACKENDS": {
                "gottwall.backends.http.HTTPBackend": {
                    "PORT": get_unused_port()
                }
            },
            "PROJECTS": {
                "test_project": "secretkey"
            },
            "SECRET_KEY": "myprivatekey"
        })

        self.aggregator = AggregatorApplication(config)
        self.aggregator.configure_app(self.io_loop)

        return self.aggregator.backends[0].web_application
Exemple #4
0
    def get_app(self):
        config = Config()
        config.from_module(gottwall.default_config)

        config.update({
            "BACKENDS": {
                "gottwall.backends.tcpip.TCPIPBackend": {
                    "PORT": get_unused_port()
                }
            },
            "STORAGE": "gottwall.storages.MemoryStorage",
            "PROJECTS": {
                "test_project": "secretkey"
            },
            "PRIVATE_KEY": "myprivatekey"
        })
        self.app = AggregatorApplication(config)
        self.app.configure_app(self.io_loop)

        return self.app