From 1057801208e8e2ec75852fcf32f5a0417c617239 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 2 Sep 2012 21:14:32 -0400 Subject: [PATCH] [Fix #218] Add support for pythonz --- modules/python/README.md | 26 +++++++++++++++++++++++++- modules/python/init.zsh | 17 +++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/modules/python/README.md b/modules/python/README.md index 6681a58..d17c4ef 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -1,7 +1,20 @@ Python ====== -Enables local Python package installation. +Enables local Python and local Python package installation. + +Local Python Installation +------------------------- + +[pythonz][6] builds and installs multiple Python versions locally in the home +directory. + +This module prepends the pythonz directory to the path variable to enable the +execution of `pythonz`. + +### Usage + +Install Python versions with `pythonz install` into *~/.pythonz/pythons*. Local Package Installation -------------------------- @@ -36,6 +49,16 @@ Aliases - `py` is short for `python`. +### Pythonz + + - `pyz` is short for `pythonz`. + - `pyzc` removes stale source folders and archives. + - `pyzi` installs Python versions. + - `pyzl` lists installed Python versions. + - `pyzL` lists available Python versions. + - `pyzu` updates itself to the latest version. + - `pyzx` uninstalls Python versions. + Authors ------- @@ -49,4 +72,5 @@ Authors [3]: http://pypi.python.org/pypi/virtualenv [4]: http://www.doughellmann.com/docs/virtualenvwrapper/#introduction [5]: https://github.com/sorin-ionescu/oh-my-zsh/issues +[6]: http://saghul.github.com/pythonz/ diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a542a8f..5a92216 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -27,8 +27,25 @@ if [[ -n "$WORKON_HOME" ]] && (( $+commands[virtualenvwrapper.sh] )); then source "$commands[virtualenvwrapper.sh]" fi +# Load pythonz into the shell session. +if [[ -s $HOME/.pythonz/bin/pythonz ]]; then + path=($HOME/.pythonz/bin $path) +fi + # # Aliases # alias py='python' + +# pythonz +if (( $+commands[pythonz] )); then + alias pyz='pythonz' + alias pyzc='pythonz cleanup' + alias pyzi='pythonz install' + alias pyzl='pythonz list' + alias pyzL='pythonz list -a' + alias pyzu='pythonz update' + alias pyzx='pythonz uninstall' +fi +