示例#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)