예제 #1
0
파일: queue.py 프로젝트: rhelmer/retools
 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
예제 #2
0
파일: queue.py 프로젝트: 0x1997/retools
 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
예제 #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)
예제 #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)