Commits

Doug Hellmann committed b987b03

update docs with examples

Comments (0)

Files changed (2)

docs/source/command_ref.rst

 All command line options are passed directly to ``virtualenv``.  The
 new environment is automatically activated after being initialized.
 
+::
+
+    $ workon
+    $ mkvirtualenv mynewenv
+    New python executable in mynewenv/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (mynewenv)$ workon
+    mynewenv
+    (mynewenv)$ 
+
 .. seealso::
 
    * :ref:`scripts-premkvirtualenv`
 
     rmvirtualenv ENVNAME
 
+You must use :ref:`command-deactivate` before removing the current
+environment.
+
+::
+
+    (mynewenv)$ deactivate
+    $ rmvirtualenv mynewenv
+    $ workon
+    $
+
 .. seealso::
 
    * :ref:`scripts-prermvirtualenv`
    The environment created by the copy operation is made `relocatable
    <http://virtualenv.openplans.org/#making-environments-relocatable>`__.
 
+::
+
+    $ workon 
+    $ mkvirtualenv source
+    New python executable in source/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (source)$ cpvirtualenv source dest
+    Making script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/easy_install relative
+    Making script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/easy_install-2.6 relative
+    Making script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/pip relative
+    Script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/postactivate cannot be made relative (it's not a normal script that starts with #!/Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/python)
+    Script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/postdeactivate cannot be made relative (it's not a normal script that starts with #!/Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/python)
+    Script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/preactivate cannot be made relative (it's not a normal script that starts with #!/Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/python)
+    Script /Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/predeactivate cannot be made relative (it's not a normal script that starts with #!/Users/dhellmann/Devel/virtualenvwrapper/tmp/dest/bin/python)
+    (dest)$ workon 
+    dest
+    source
+    (dest)$ 
+
 .. seealso::
 
    * :ref:`scripts-precpvirtualenv`
 If no ``environment_name`` is given the list of available environments
 is printed to stdout.
 
+::
+
+    $ workon 
+    $ mkvirtualenv env1
+      New python executable in env1/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env1)$ mkvirtualenv env2
+    New python executable in env2/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env2)$ workon 
+    env1
+    env2
+    (env2)$ workon env1
+    (env1)$ echo $VIRTUAL_ENV
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1
+    (env1)$ workon env2
+    (env2)$ echo $VIRTUAL_ENV
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env2
+    (env2)$ 
+
+
 .. seealso::
 
    * :ref:`scripts-predeactivate`
    * :ref:`scripts-preactivate`
    * :ref:`scripts-postactivate`
 
+.. _command-deactivate:
+
 deactivate
 ----------
 
     This command is actually part of virtualenv, but is wrapped to
     provide before and after hooks, just as workon does for activate.
 
+::
+
+    $ workon 
+    $ echo $VIRTUAL_ENV
+
+    $ mkvirtualenv env1
+    New python executable in env1/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env1)$ echo $VIRTUAL_ENV
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1
+    (env1)$ deactivate
+    $ echo $VIRTUAL_ENV
+
+    $ 
+
 .. seealso::
 
    * :ref:`scripts-predeactivate`
 
 ::
 
-  $ workon pymotw
-  $ echo $VIRTUAL_ENV
-  /Users/dhellmann/.virtualenvs/pymotw
-  $ cdvirtualenv
-  $ pwd
-  /Users/dhellmann/.virtualenvs/pymotw
-  $ cdvirtualenv bin
-  $ pwd
-  /Users/dhellmann/.virtualenvs/pymotw/bin
+    $ mkvirtualenv env1
+    New python executable in env1/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env1)$ echo $VIRTUAL_ENV
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1
+    (env1)$ cdvirtualenv
+    (env1)$ pwd
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1
+    (env1)$ cdvirtualenv bin
+    (env1)$ pwd
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1/bin
 
 cdsitepackages
 --------------
 
 ::
 
-  $ workon pymotw
-  $ echo $VIRTUAL_ENV
-  /Users/dhellmann/.virtualenvs/pymotw
-  $ cdsitepackages PyMOTW/bisect/
-  $ pwd
-  /Users/dhellmann/.virtualenvs/pymotw/lib/python2.6/site-packages/PyMOTW/bisect
+    $ mkvirtualenv env1
+    New python executable in env1/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env1)$ echo $VIRTUAL_ENV
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1
+    (env1)$ cdsitepackages PyMOTW/bisect/
+    (env1)$ pwd
+    /Users/dhellmann/Devel/virtualenvwrapper/tmp/env1/lib/python2.6/site-packages/PyMOTW/bisect
 
 lssitepackages
 --------------
 
     lssitepackages
 
+::
+
+    $ mkvirtualenv env1
+    New python executable in env1/bin/python
+    Installing distribute.............................................
+    ..................................................................
+    ..................................................................
+    done.
+    (env1)$ $ workon env1
+    (env1)$ lssitepackages 
+    distribute-0.6.10-py2.6.egg     pip-0.6.3-py2.6.egg
+    easy-install.pth                setuptools.pth
+
 ===============
 Path Management
 ===============

docs/source/history.rst

   - Made deactivation more robust, especially under ksh.
   - Use Python's ``tempfile`` module for creating temporary filenames
     safely and portably.
+  - Fix a problem with ``virtualenvwrapper_show_workon_options`` that
+    caused it to show ``*`` as the name of a virtualenv when no
+    environments had yet been created.
 
 2.0.2
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.