fromrhodecode.lib.utilsimportBasePasterCommand,Command__all__=['CeleryDaemonCommand','CeleryBeatCommand','CAMQPAdminCommand','CeleryEventCommand']classCeleryDaemonCommand(BasePasterCommand):"""Start the celery worker Starts the celery worker that uses a paste.deploy configuration file. """usage='CONFIG_FILE [celeryd options...]'summary=__doc__.splitlines()[0]description="".join(__doc__.splitlines()[2:])parser=Command.standard_parser(quiet=True)defupdate_parser(self):fromcelery.binimportcelerydforxinceleryd.WorkerCommand().get_options():self.parser.add_option(x)defcommand(self):fromcelery.binimportcelerydreturnceleryd.WorkerCommand().run(**vars(self.options))classCeleryBeatCommand(BasePasterCommand):"""Start the celery beat server Starts the celery beat server using a paste.deploy configuration file. """usage='CONFIG_FILE [celerybeat options...]'summary=__doc__.splitlines()[0]description="".join(__doc__.splitlines()[2:])parser=Command.standard_parser(quiet=True)defupdate_parser(self):fromcelery.binimportcelerybeatforxincelerybeat.BeatCommand().get_options():self.parser.add_option(x)defcommand(self):fromcelery.binimportcelerybeatreturncelerybeat.BeatCommand(**vars(self.options))classCAMQPAdminCommand(BasePasterCommand):"""CAMQP Admin CAMQP celery admin tool. """usage='CONFIG_FILE [camqadm options...]'summary=__doc__.splitlines()[0]description="".join(__doc__.splitlines()[2:])parser=Command.standard_parser(quiet=True)defupdate_parser(self):fromcelery.binimportcamqadmforxincamqadm.OPTION_LIST:self.parser.add_option(x)defcommand(self):fromcelery.binimportcamqadmreturncamqadm.camqadm(*self.args,**vars(self.options))classCeleryEventCommand(BasePasterCommand):"""Celery event commandd. Capture celery events. """usage='CONFIG_FILE [celeryev options...]'summary=__doc__.splitlines()[0]description="".join(__doc__.splitlines()[2:])parser=Command.standard_parser(quiet=True)defupdate_parser(self):fromcelery.binimportceleryevforxinceleryev.OPTION_LIST:self.parser.add_option(x)defcommand(self):fromcelery.binimportceleryevreturnceleryev.run_celeryev(**vars(self.options))