예제 #1
0
파일: app.py 프로젝트: anentropic/flower
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()
예제 #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)
예제 #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()
예제 #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()
예제 #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)
예제 #6
0
파일: app.py 프로젝트: 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)
예제 #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)
예제 #8
0
파일: app.py 프로젝트: 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()
예제 #9
0
파일: app.py 프로젝트: daevaorn/flower
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()
예제 #10
0
파일: app.py 프로젝트: daevaorn/flower
    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)
예제 #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
예제 #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()
예제 #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)
예제 #14
0
파일: app.py 프로젝트: anentropic/flower
    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)
예제 #15
0
파일: app.py 프로젝트: andresriancho/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 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)