예제 #1
0
파일: deploy.py 프로젝트: timship/commander
 def wrapper(*args, **kwargs):
     logging.info('Running %s' % getattr(f, '__name__', repr(f)))
     start = time.time()
     res = f(Context(), *args, **kwargs)
     end = time.time()
     finished = 'Finished %s (%0.3fs)' % (getattr(f, '__name__',
                                                  repr(f)), end - start)
     notify(finished)
     logging.info(finished)
     return res
예제 #2
0
파일: deploy.py 프로젝트: goosemo/commander
 def wrapper(*args, **kwargs):
     logging.info('Running %s' % getattr(f, '__name__', repr(f)))
     start = time.time()
     res = f(Context(), *args, **kwargs)
     end = time.time()
     finished = 'Finished %s (%0.3fs)' % (getattr(f, '__name__', repr(f)),
                                          end - start)
     notify(finished)
     logging.info(finished)
     return res
예제 #3
0
파일: deploy.py 프로젝트: timship/commander
 def inner_wrapper(*args, **kwargs):
     logging.info('Running %s' % getattr(f, '__name__', repr(f)))
     t = ThreadPool(remote_limit)
     for host in hosts:
         ctx = Context(remote_kwargs=remote_kwargs)
         ctx.set_host(host)
         t.add_func(f, ctx, *args, **kwargs)
     start = time.time()
     t.run_all()
     end = time.time()
     finished = ('Finished %s (%0.3fs)' %
                 (getattr(f, '__name__', repr(f)), end - start))
     notify(finished)
     logging.info(finished)
예제 #4
0
파일: deploy.py 프로젝트: goosemo/commander
 def inner_wrapper(*args, **kwargs):
     logging.info('Running %s' % getattr(f, '__name__', repr(f)))
     t = ThreadPool(remote_limit)
     for host in hosts:
         ctx = Context(remote_kwargs=remote_kwargs)
         ctx.set_host(host)
         t.add_func(f, ctx, *args, **kwargs)
     start = time.time()
     t.run_all()
     end = time.time()
     finished = ('Finished %s (%0.3fs)' %
                 (getattr(f, '__name__', repr(f)), end - start))
     notify(finished)
     logging.info(finished)