Skip to content

Commit b660c5f

Browse files
committed
add feature list; clean up hook list; fix bug in warning message generation
1 parent 70a687f commit b660c5f

File tree

4 files changed

+49
-40
lines changed

4 files changed

+49
-40
lines changed

README

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ virtualenvwrapper
44

55
virtualenvwrapper is a set of extensions to Ian Bicking's `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.
66

7+
========
8+
Features
9+
========
10+
11+
1. Organizes all of your virtual environments in one place.
12+
2. Wrappers for creating and deleting environments, including user-configurable hooks.
13+
3. Use a single command to switch between environments.
14+
4. Tab completion for commands that take a virtual environment as argument.
15+
716
===========
817
Quick Setup
918
===========

docsource/hooks.rst

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,59 @@
22
Hook Scripts
33
============
44

5-
virtualenvwrapper adds several hook points you can use to change your settings when creating,
6-
deleting, or moving between environments. They are either *sourced* (allowing them to modify
7-
your shell environment) or run as an external program at the appropriate trigger time.
5+
virtualenvwrapper adds several hook points you can use to change your settings, shell environment, or other configuration values when creating, deleting, or moving between environments. They are either *sourced* (allowing them to modify your shell environment) or *run* as an external program at the appropriate trigger time.
86

9-
$VIRTUAL_ENV/bin/postactivate
10-
=============================
7+
Environment Hooks
8+
=================
119

12-
The ``postactivate`` script is sourced after the new environment is enabled. ``$VIRTUAL_ENV``
13-
refers to the new environment at the time the script runs.
10+
postactivate
11+
------------
1412

15-
This example script for the PyMOTW environment changes the current working directory and the
16-
PATH variable to refer to the source tree containing the PyMOTW source.
13+
The ``$VIRTUAL_ENV/bin/postactivate`` script is sourced after the new environment is enabled. ``$VIRTUAL_ENV`` refers to the new environment at the time the script runs.
14+
15+
This example script for the PyMOTW environment changes the current working directory and the PATH variable to refer to the source tree containing the PyMOTW source.
1716

1817
::
1918

2019
pymotw_root=/Users/dhellmann/Documents/PyMOTW
2120
cd $pymotw_root
2221
PATH=$pymotw_root/bin:$PATH
2322

24-
$VIRTUAL_ENV/bin/predeactivate
25-
==============================
23+
predeactivate
24+
-------------
25+
26+
The ``$VIRTUAL_ENV/bin/predeactivate`` script is sourced before the current environment is deactivated, and can be used to disable or clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old environment at the time the script runs.
2627

27-
The ``predeactivate`` script is source before the current environment is deactivated, and can
28-
be used to disable or clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old
29-
environment at the time the script runs.
28+
Global Hooks
29+
============
3030

31-
$WORKON_HOME/postactivate
32-
=============================
31+
postactivate
32+
------------
3333

34-
The global ``postactivate`` script is sourced after the new environment is enabled and the new
35-
environment's postactivate is sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new
36-
environment at the time the script runs.
34+
The global ``$WORKON_HOME/postactivate`` script is sourced after the new environment is enabled and the new environment's postactivate is sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new environment at the time the script runs.
3735

38-
This example script adds a space between the virtual environment name and your old PS1 by making
39-
use of ``_OLD_VIRTUAL_PS1``.
36+
This example script adds a space between the virtual environment name and your old PS1 by making use of ``_OLD_VIRTUAL_PS1``.
4037

4138
::
4239

4340
PS1="(`basename \"$VIRTUAL_ENV\"`) $_OLD_VIRTUAL_PS1"
4441

45-
$WORKON_HOME/premkvirtualenv
46-
=============================
42+
premkvirtualenv
43+
---------------
4744

48-
The ``premkvirtualenv`` script is run as an external program after the virtual environment is
49-
created but before the current environment is switched to point to the new env. The current
50-
working directory for the script is ``$WORKON_HOME`` and the name of the new environment is
51-
passed as an argument to the script.
45+
The ``$WORKON_HOME/premkvirtualenv`` script is run as an external program after the virtual environment is created but before the current environment is switched to point to the new env. The current working directory for the script is ``$WORKON_HOME`` and the name of the new environment is passed as an argument to the script.
5246

53-
$WORKON_HOME/postmkvirtualenv
54-
=============================
47+
postmkvirtualenv
48+
----------------
5549

56-
The ``postmkvirtualenv`` script is sourced after the new environment is created and
57-
activated.
50+
The ``$WORKON_HOME/postmkvirtualenv`` script is sourced after the new environment is created and activated.
5851

59-
$WORKON_HOME/prermvirtualenv
60-
============================
52+
prermvirtualenv
53+
---------------
6154

62-
The ``prermvirtualenv`` script is run as an external program before the environment is
63-
removed. The full path to the environment directory is passed as an argument to the script.
55+
The ``$WORKON_HOME/prermvirtualenv`` script is run as an external program before the environment is removed. The full path to the environment directory is passed as an argument to the script.
6456

65-
$WORKON_HOME/postrmvirtualenv
66-
=============================
57+
postrmvirtualenv
58+
----------------
6759

68-
The ``postrmvirtualenv`` script is run as an external program after the environment is
69-
removed. The full path to the environment directory is passed as an argument to the script.
60+
The ``$WORKON_HOME/postrmvirtualenv`` script is run as an external program after the environment is removed. The full path to the environment directory is passed as an argument to the script.

docsource/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ virtualenvwrapper
99

1010
virtualenvwrapper is a set of extensions to Ian Bicking's `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.
1111

12+
========
13+
Features
14+
========
15+
16+
1. Organizes all of your virtual environments in one place.
17+
2. Wrappers for creating and deleting environments, including user-configurable hooks.
18+
3. Use a single command to switch between environments.
19+
4. Tab completion for commands that take a virtual environment as argument.
20+
1221
===========
1322
Quick Setup
1423
===========

virtualenvwrapper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""virtualenvwrapper module
22
"""
33

4-
import warnings
4+
import os, warnings
55
docs_root = os.path.join(os.path.dirname(__file__), 'docs', 'index.html')
66
warnings.warn('Use virtualenvwrapper_bashrc to set up your shell environment. See %s for details.' % docs_root)

0 commit comments

Comments
 (0)