Created
May 17, 2018 20:00
-
-
Save hartym/38150bc043eb8b124c62d1baa34a53c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
import bonobo | |
def get_graph(**options): | |
graph = bonobo.Graph([1,2,3], bonobo.PrettyPrinter()) | |
return graph | |
@contextmanager | |
def get_services(**options): | |
try: | |
s = 'ftp' | |
yield {'ftp': s} | |
finally: | |
print('closing {}'.format(s)) | |
if __name__ == '__main__': | |
with bonobo.parse_args() as options: | |
with get_services(**options) as services: | |
bonobo.run(get_graph(**options), services=services) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment