def convert(self, value, param, ctx): try: return find_app(value) except ModuleNotFoundError as e: if e.name != value: exc = traceback.format_exc() self.fail(UNABLE_TO_LOAD_APP_ERROR_OCCURRED.format(value, exc)) self.fail(UNABLE_TO_LOAD_APP_MODULE_NOT_FOUND.format(e.name)) except AttributeError as e: attribute_name = e.args[0].capitalize() self.fail(UNABLE_TO_LOAD_APP_APP_MISSING.format(attribute_name)) except Exception: exc = traceback.format_exc() self.fail(UNABLE_TO_LOAD_APP_ERROR_OCCURRED.format(value, exc))
def find_app(self, app): from celery.app.utils import find_app return find_app(app, symbol_by_name=self.symbol_by_name)
def find_app(self, app): from celery.app.utils import find_app return find_app(app, symbol_by_name=self.symbol_by_name)
def factory(): try: return find_app(value) except (ModuleNotFoundError, AttributeError) as e: self.fail(str(e))
def convert(self, value, param, ctx): try: return find_app(value) except (ModuleNotFoundError, AttributeError) as e: self.fail(str(e))