Skip to content

Instantly share code, notes, and snippets.

@vad
Created February 9, 2011 17:33
Show Gist options
  • Save vad/818865 to your computer and use it in GitHub Desktop.
Save vad/818865 to your computer and use it in GitHub Desktop.
from fabric.api import *
class RunAggregator(object):
def __init__(self):
self.commands = []
def __enter__(self):
return self.commands.append
def __exit__(self, exc_type, exc_value, traceback):
run(' && '.join(self.commands))
def test():
with RunAggregator() as run:
run('test1')
run('test2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment