@@ -24,8 +24,8 @@ Syntax::
2424
2525.. seealso ::
2626
27- * :ref: `hooks- scripts-premkvirtualenv `
28- * :ref: `hooks- scripts-postmkvirtualenv `
27+ * :ref: `scripts-premkvirtualenv `
28+ * :ref: `scripts-postmkvirtualenv `
2929
3030rmvirtualenv
3131------------
@@ -38,8 +38,8 @@ Syntax::
3838
3939.. seealso ::
4040
41- * :ref: `hooks- scripts-prermvirtualenv `
42- * :ref: `hooks- scripts-postrmvirtualenv `
41+ * :ref: `scripts-prermvirtualenv `
42+ * :ref: `scripts-postrmvirtualenv `
4343
4444cpvirtualenv
4545------------
@@ -55,6 +55,10 @@ Syntax::
5555 The environment created by the copy operation is made `relocatable
5656 <http://virtualenv.openplans.org/#making-environments-relocatable> `__.
5757
58+ ==================================
59+ Controlling the Active Environment
60+ ==================================
61+
5862workon
5963------
6064
@@ -69,10 +73,10 @@ is printed to stdout.
6973
7074.. seealso ::
7175
72- * :ref: `hooks- scripts-predeactivate `
73- * :ref: `hooks- scripts-postdeactivate `
74- * :ref: `hooks- scripts-preactivate `
75- * :ref: `hooks- scripts-postactivate `
76+ * :ref: `scripts-predeactivate `
77+ * :ref: `scripts-postdeactivate `
78+ * :ref: `scripts-preactivate `
79+ * :ref: `scripts-postactivate `
7680
7781deactivate
7882----------
@@ -91,8 +95,8 @@ Syntax::
9195
9296.. seealso ::
9397
94- * :ref: `hooks- scripts-predeactivate `
95- * :ref: `hooks- scripts-postdeactivate `
98+ * :ref: `scripts-predeactivate `
99+ * :ref: `scripts-postdeactivate `
96100
97101==================================
98102Quickly Navigating to a virtualenv
@@ -104,6 +108,12 @@ currently-active virtualenv.
104108cdvirtualenv
105109------------
106110
111+ Change the current working directory to ``$VIRTUAL_ENV ``.
112+
113+ Syntax::
114+
115+ cdvirtualenv [subdir]
116+
107117Calling ``cdvirtualenv `` changes the current working directory to the
108118top of the virtualenv (``$VIRTUAL_ENV ``). An optional argument is
109119appended to the path, allowing navigation directly into a
@@ -124,6 +134,13 @@ subdirectory.
124134cdsitepackages
125135--------------
126136
137+ Change the current working directory to the ``site-packages `` for
138+ ``$VIRTUAL_ENV ``.
139+
140+ Syntax::
141+
142+ cdsitepackages [subdir]
143+
127144Because the exact path to the site-packages directory in the
128145virtualenv depends on the version of Python, ``cdsitepackages `` is
129146provided as a shortcut for ``cdvirtualenv
@@ -132,29 +149,28 @@ allowed, to specify a directory hierarchy within the ``site-packages``
132149directory to change into.
133150
134151::
152+
135153 $ workon pymotw
136154 $ echo $VIRTUAL_ENV
137155 /Users/dhellmann/.virtualenvs/pymotw
138156 $ cdsitepackages PyMOTW/bisect/
139157 $ pwd
140158 /Users/dhellmann/.virtualenvs/pymotw/lib/python2.6/site-packages/PyMOTW/bisect
141159
160+ lssitepackages
161+ --------------
162+
163+ Calling ``lssitepackages `` shows the content of the ``site-packages ``
164+ directory of the currently-active virtualenv.
165+
166+ Syntax::
167+
168+ lssitepackages
169+
142170===============
143171Path Management
144172===============
145173
146- Sometimes it is desirable to share installed packages that are not in
147- the system ``site-pacakges `` directory and which you do not want to
148- install in each virtualenv. In this case, you *could * symlink the
149- source into the environment ``site-packages `` directory, but it is
150- also easy to add extra directories to the PYTHONPATH by including them
151- in a .pth file inside ``site-packages `` using ``add2virtualenv ``.
152-
153- 1. Check out the source for a big project, such as Django.
154- 2. Run: ``add2virtualenv path_to_source ``.
155- 3. Run: ``add2virtualenv ``.
156- 4. A usage message and list of current "extra" paths is printed.
157-
158174add2virtualenv
159175--------------
160176
@@ -165,17 +181,20 @@ Syntax::
165181
166182 add2virtualenv directory1 directory2 ...
167183
168- Path management for packages outside of the virtual env. Based on a
169- contribution from James Bennett and Jannis Leidel.
170-
171- This will be done by placing the directory names in a path file named
172- ``virtualenv_path_extensions.pth `` inside the virtualenv's
173- site-packages directory; if this file does not exist, it will be
174- created first.
184+ Sometimes it is desirable to share installed packages that are not in
185+ the system ``site-pacakges `` directory and which should not be
186+ installed in each virtualenv. One possible solution is to symlink the
187+ source into the environment ``site-packages `` directory, but it is
188+ also easy to add extra directories to the PYTHONPATH by including them
189+ in a ``.pth `` file inside ``site-packages `` using ``add2virtualenv ``.
175190
191+ 1. Check out the source for a big project, such as Django.
192+ 2. Run: ``add2virtualenv path_to_source ``.
193+ 3. Run: ``add2virtualenv ``.
194+ 4. A usage message and list of current "extra" paths is printed.
176195
177- lssitepackages
178- --------------
196+ The directory names are added to a path file named
197+ ``virtualenv_path_extensions.pth `` inside the site-packages directory
198+ for the environment.
179199
180- Calling ``lssitepackages `` shows the content of the ``site-packages ``
181- directory of the currently-active virtualenv.
200+ *Based on a contribution from James Bennett and Jannis Leidel. *
0 commit comments