예제 #1
0
 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))
예제 #2
0
 def find_app(self, app):
     from celery.app.utils import find_app
     return find_app(app, symbol_by_name=self.symbol_by_name)
예제 #3
0
파일: base.py 프로젝트: CheeseL0ver/celery
 def find_app(self, app):
     from celery.app.utils import find_app
     return find_app(app, symbol_by_name=self.symbol_by_name)
예제 #4
0
파일: celery.py 프로젝트: avikam/celery
 def factory():
     try:
         return find_app(value)
     except (ModuleNotFoundError, AttributeError) as e:
         self.fail(str(e))
예제 #5
0
파일: celery.py 프로젝트: zebpalmer/celery
 def convert(self, value, param, ctx):
     try:
         return find_app(value)
     except (ModuleNotFoundError, AttributeError) as e:
         self.fail(str(e))