From 18e84dffe6610c858caa7fe170456c78a4e102b2 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 12 Aug 2011 09:55:36 -0400 Subject: [PATCH] automatically write .workon when creating new env w/ mk --- .oh-my-zsh/tools/workon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.oh-my-zsh/tools/workon.py b/.oh-my-zsh/tools/workon.py index dad072d..116c93f 100755 --- a/.oh-my-zsh/tools/workon.py +++ b/.oh-my-zsh/tools/workon.py @@ -7,7 +7,7 @@ import sys def find_above(*names): """Attempt to locate a .workon file by searching parent dirs.""" - + path = '.' while os.path.split(os.path.abspath(path))[1]: @@ -19,11 +19,11 @@ def find_above(*names): if __name__ == '__main__': - + wo_file = find_above('.workon') if wo_file and not 'VIRTUAL_ENV' in os.environ.keys(): with open(wo_file) as f: - print('source {0}/bin/activate'.format(f.read())) - + print('source {0}/bin/activate'.format(f.readlines()[0])) + elif not wo_file and 'VIRTUAL_ENV' in os.environ.keys(): print('deactivate')