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()
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)
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()
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()
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 __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)
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)
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()
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()
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
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()
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 __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)