Esempio n. 1
0
 def perform(self):
     """Runs the job calling all the job signals as appropriate"""
     self.run_event("job_prerun")
     try:
         if "job_wrapper" in self.events:
             result = with_nested_contexts(self.events["job_wrapper"], self.func, [self], self.kwargs)
         else:
             result = self.func(**self.kwargs)
         self.run_event("job_postrun", result=result)
         return True
     except Exception, exc:
         self.run_event("job_failure", exc=exc)
         return False
Esempio n. 2
0
 def perform(self):
     """Runs the job calling all the job signals as appropriate"""
     self.run_event('job_prerun')
     try:
         if 'job_wrapper' in self.events:
             result = with_nested_contexts(self.events['job_wrapper'],
                                           self.func, [self], self.kwargs)
         else:
             result = self.func(**self.kwargs)
         self.run_event('job_postrun', result=result)
         return True
     except Exception, exc:
         self.run_event('job_failure', exc=exc)
         return False
Esempio n. 3
0
 def _call_with_contexts(self, ctx_managers, func, kwargs):
     from retools.util import with_nested_contexts
     return with_nested_contexts(ctx_managers, func, [], kwargs)
Esempio n. 4
0
 def _call_with_contexts(self, ctx_managers, func, kwargs):
     from retools.util import with_nested_contexts
     return with_nested_contexts(ctx_managers, func, [], kwargs)