Example #1
0
class Flower(tornado.web.Application):
    def __init__(self, celery_app=None, events=None, state=None,
                 auth=None, io_loop=None, options={}, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.auth = auth or []
        self.options = options

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app)

    def start(self):
        self.events.start()
        if self.options.inspect:
            self.state.start()
        self.listen(self.options.port, address=self.options.address)
        self.io_loop.start()

    def stop(self):
        self.events.stop()
Example #2
0
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 options=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)
        self.ssl = None
        if options and self.options.certfile and self.options.keyfile:
            cwd = os.environ.get('PWD') or os.getcwd()
            self.ssl = {
                'certfile': os.path.join(cwd, self.options.certfile),
                'keyfile': os.path.join(cwd, self.options.keyfile),
            }

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app,
                                       db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app, self.broker_api)
Example #3
0
class Flower(tornado.web.Application):
    def __init__(self, celery_app=None, events=None, state=None,
                 io_loop=None, options=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)
        self.ssl = None
        if self.options.certfile and self.options.keyfile:
            cwd = os.environ.get('PWD') or os.getcwd()
            self.ssl = {
                'certfile': os.path.join(cwd, self.options.certfile),
                'keyfile': os.path.join(cwd, self.options.keyfile),
            }

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app, self.broker_api)

    def start(self):
        self.events.start()
        if self.options.inspect:
            self.state.start()
        self.listen(self.options.port, address=self.options.address,
                    ssl_options=self.ssl)
        self.io_loop.start()

    def stop(self):
        self.events.stop()
Example #4
0
class Flower(tornado.web.Application):
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 options=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app,
                                       db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app, self.broker_api)

    def start(self):
        self.events.start()
        if self.options.inspect:
            self.state.start()
        self.listen(self.options.port, address=self.options.address)
        self.io_loop.start()

    def stop(self):
        self.events.stop()
Example #5
0
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, io_loop)
        self.state = State(celery_app)
Example #6
0
File: app.py Project: sklaus/flower
    def __init__(self, celery_app=None, events=None, state=None,
                 io_loop=None, options=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or {}
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)
        self.broker = getattr(self.options, 'broker', None)
        self.ssl = None
        if options and self.options.certfile and self.options.keyfile:
            cwd = os.environ.get('PWD') or os.getcwd()
            self.ssl = {
                'certfile': os.path.join(cwd, self.options.certfile),
                'keyfile': os.path.join(cwd, self.options.keyfile),
            }

        self.celery_app = celery_app or celery.Celery()
        db = options.db if options else None
        persistent = options.persistent if options else None
        max_tasks = options.max_tasks if options else None
        self.events = events or Events(celery_app, db=db,
                                       persistent=persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=max_tasks)
        self.state = State(celery_app, self.broker_api)
Example #7
0
    def __init__(self, celery_app=None, events=None, state=None, io_loop=None, options=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, "auth", [])
        self.basic_auth = getattr(self.options, "basic_auth", None)
        self.broker_api = getattr(self.options, "broker_api", None)
        self.ssl = None
        if self.options.certfile and self.options.keyfile:
            cwd = os.environ.get("PWD") or os.getcwd()
            self.ssl = {
                "certfile": os.path.join(cwd, self.options.certfile),
                "keyfile": os.path.join(cwd, self.options.keyfile),
            }

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(
            celery_app,
            db=options.db,
            persistent=options.persistent,
            io_loop=self.io_loop,
            max_tasks_in_memory=options.max_tasks,
        )
        self.state = State(celery_app, self.broker_api)
Example #8
0
File: app.py Project: Ezy2015/boom
class Flower(tornado.web.Application):
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 options=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or {}
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)
        self.ssl = None
        if options and self.options.certfile and self.options.keyfile:
            cwd = os.environ.get('PWD') or os.getcwd()
            self.ssl = {
                'certfile': os.path.join(cwd, self.options.certfile),
                'keyfile': os.path.join(cwd, self.options.keyfile),
            }

        self.celery_app = celery_app or celery.Celery()
        db = options.db if options else None
        persistent = options.persistent if options else None
        max_tasks = options.max_tasks if options else None
        self.events = events or Events(celery_app,
                                       db=db,
                                       persistent=persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=max_tasks)
        self.state = State(celery_app, self.broker_api)

    def start(self):
        self.events.start()
        if self.options.inspect:
            self.state.start()
        self.listen(self.options.port,
                    address=self.options.address,
                    ssl_options=self.ssl,
                    xheaders=self.options.xheaders)
        self.io_loop.start()

    def stop(self):
        self.events.stop()
Example #9
0
class Flower(tornado.web.Application):
    def __init__(self, celery_app=None, events=None, state=None,
                       io_loop=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, io_loop)
        self.state = State(celery_app)

    def start(self, port, inspect=True):
        self.events.start()
        if inspect:
            self.state.start()
        self.listen(port)
        self.io_loop.start()
Example #10
0
    def __init__(self, celery_app=None, events=None, state=None,
                       io_loop=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, io_loop)
        self.state = State(celery_app)
Example #11
0
 def get_app(self, celery_app=None, events=None, state=None):
     celery_app = celery_app or celery.Celery()
     events = events or Events(celery_app)
     state = state or State(celery_app)
     self.app = Flower(celery_app=celery_app,
                       events=events,
                       state=state,
                       handlers=handlers,
                       **APP_SETTINGS)
     return self.app
Example #12
0
class Flower(tornado.web.Application):
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, io_loop)
        self.state = State(celery_app)

    def start(self, port, address='', inspect=True):
        self.events.start()
        if inspect:
            self.state.start()
        self.listen(port, address=address)
        self.io_loop.start()
Example #13
0
    def __init__(self,
                 celery_app=None,
                 events=None,
                 state=None,
                 io_loop=None,
                 options=None,
                 **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app,
                                       db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app, self.broker_api)
Example #14
0
    def __init__(self, celery_app=None, events=None, state=None,
                 auth=None, io_loop=None, options={}, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.auth = auth or []
        self.options = options

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app)
Example #15
0
    def __init__(self, celery_app=None, events=None, state=None,
                 io_loop=None, options=None, **kwargs):
        kwargs.update(handlers=handlers)
        super(Flower, self).__init__(**kwargs)
        self.io_loop = io_loop or ioloop.IOLoop.instance()
        self.options = options or object()
        self.auth = getattr(self.options, 'auth', [])
        self.basic_auth = getattr(self.options, 'basic_auth', None)
        self.broker_api = getattr(self.options, 'broker_api', None)

        self.celery_app = celery_app or celery.Celery()
        self.events = events or Events(celery_app, db=options.db,
                                       persistent=options.persistent,
                                       io_loop=self.io_loop,
                                       max_tasks_in_memory=options.max_tasks)
        self.state = State(celery_app, self.broker_api)