/usr/share/doc/virtualenvwrapper/html/scripts.html is in virtualenvwrapper 4.3.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Per-User Customization — virtualenvwrapper 4.3.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '4.3.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="virtualenvwrapper 4.3.1 documentation" href="index.html" />
<link rel="up" title="Customizing Virtualenvwrapper" href="hooks.html" />
<link rel="next" title="Extending Virtualenvwrapper" href="plugins.html" />
<link rel="prev" title="Customizing Virtualenvwrapper" href="hooks.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="plugins.html" title="Extending Virtualenvwrapper"
accesskey="N">next</a></li>
<li class="right" >
<a href="hooks.html" title="Customizing Virtualenvwrapper"
accesskey="P">previous</a> |</li>
<li><a href="index.html">virtualenvwrapper 4.3.1 documentation</a> »</li>
<li><a href="hooks.html" accesskey="U">Customizing Virtualenvwrapper</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="per-user-customization">
<span id="scripts"></span><h1>Per-User Customization<a class="headerlink" href="#per-user-customization" title="Permalink to this headline">¶</a></h1>
<p>The end-user customization scripts are either <em>sourced</em> (allowing them
to modify your shell environment) or <em>run</em> as an external program at
the appropriate trigger time.</p>
<p>The global scripts applied to all environments should be placed in the
directory named by <a class="reference internal" href="install.html#variable-virtualenvwrapper-hook-dir"><em>VIRTUALENVWRAPPER_HOOK_DIR</em></a>. The local scripts should be
placed in the <tt class="docutils literal"><span class="pre">bin</span></tt> directory of the virtualenv.</p>
<div class="section" id="get-env-details">
<span id="scripts-get-env-details"></span><h2>get_env_details<a class="headerlink" href="#get-env-details" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">both</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">env name</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/get_env_details</span></tt> is run when <tt class="docutils literal"><span class="pre">workon</span></tt> is run with no
arguments and a list of the virtual environments is printed. The hook
is run once for each environment, after the name is printed, and can
print additional information about that environment.</p>
</div>
<div class="section" id="initialize">
<span id="scripts-initialize"></span><h2>initialize<a class="headerlink" href="#initialize" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/initialize</span></tt> is sourced when <tt class="docutils literal"><span class="pre">virtualenvwrapper.sh</span></tt>
is loaded into your environment. Use it to adjust global settings
when virtualenvwrapper is enabled.</p>
</div>
<div class="section" id="premkvirtualenv">
<span id="scripts-premkvirtualenv"></span><h2>premkvirtualenv<a class="headerlink" href="#premkvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">name of new environment</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/premkvirtualenv</span></tt> 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 <tt class="docutils literal"><span class="pre">$WORKON_HOME</span></tt> and the name of the new environment is
passed as an argument to the script.</p>
</div>
<div class="section" id="postmkvirtualenv">
<span id="scripts-postmkvirtualenv"></span><h2>postmkvirtualenv<a class="headerlink" href="#postmkvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv</span></tt> is sourced after the new environment
is created and activated. If the <tt class="docutils literal"><span class="pre">-a</span></tt> <project_path> flag was used,
the link to the project directory is set up before this script is sourced.</p>
</div>
<div class="section" id="precpvirtualenv">
<span id="scripts-precpvirtualenv"></span><h2>precpvirtualenv<a class="headerlink" href="#precpvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">name of original environment, name of new environment</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/precpvirtualenv</span></tt> is run as an external program after
the source environment is duplicated and made relocatable, but before
the <tt class="docutils literal"><span class="pre">premkvirtualenv</span></tt> hook is run or the current environment is
switched to point to the new env. The current working directory for
the script is <tt class="docutils literal"><span class="pre">$WORKON_HOME</span></tt> and the names of the source and new
environments are passed as arguments to the script.</p>
</div>
<div class="section" id="postcpvirtualenv">
<span id="scripts-postcpvirtualenv"></span><h2>postcpvirtualenv<a class="headerlink" href="#postcpvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv</span></tt> is sourced after the new environment
is created and activated.</p>
</div>
<div class="section" id="preactivate">
<span id="scripts-preactivate"></span><h2>preactivate<a class="headerlink" href="#preactivate" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global, local</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">environment name</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The global <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/preactivate</span></tt> script is run before the new
environment is enabled. The environment name is passed as the first
argument.</p>
<p>The local <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV/bin/preactivate</span></tt> hook is run before the new
environment is enabled. The environment name is passed as the first
argument.</p>
</div>
<div class="section" id="postactivate">
<span id="scripts-postactivate"></span><h2>postactivate<a class="headerlink" href="#postactivate" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global, local</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The global <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/postactivate</span></tt> script is sourced after the
new environment is enabled. <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV</span></tt> refers to the new
environment at the time the script runs.</p>
<p>This example script adds a space between the virtual environment name
and your old PS1 by making use of <tt class="docutils literal"><span class="pre">_OLD_VIRTUAL_PS1</span></tt>.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">PS1</span><span class="o">=</span><span class="s">"(`basename </span><span class="se">\"</span><span class="s">$VIRTUAL_ENV</span><span class="se">\"</span><span class="s">`) $_OLD_VIRTUAL_PS1"</span>
</pre></div>
</div>
<p>The local <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV/bin/postactivate</span></tt> script is sourced after
the new environment is enabled. <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV</span></tt> refers to the new
environment at the time the script runs.</p>
<p>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.</p>
<div class="highlight-python"><div class="highlight"><pre>pymotw_root=/Users/dhellmann/Documents/PyMOTW
cd $pymotw_root
PATH=$pymotw_root/bin:$PATH
</pre></div>
</div>
</div>
<div class="section" id="predeactivate">
<span id="scripts-predeactivate"></span><h2>predeactivate<a class="headerlink" href="#predeactivate" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">local, global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The local <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV/bin/predeactivate</span></tt> script is sourced before the
current environment is deactivated, and can be used to disable or
clear settings in your environment. <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV</span></tt> refers to the old
environment at the time the script runs.</p>
<p>The global <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/predeactivate</span></tt> script is sourced before the
current environment is deactivated. <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV</span></tt> refers to the
old environment at the time the script runs.</p>
</div>
<div class="section" id="postdeactivate">
<span id="scripts-postdeactivate"></span><h2>postdeactivate<a class="headerlink" href="#postdeactivate" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">local, global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The <tt class="docutils literal"><span class="pre">$VIRTUAL_ENV/bin/postdeactivate</span></tt> script is sourced after the
current environment is deactivated, and can be used to disable or
clear settings in your environment. The path to the environment just
deactivated is available in <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_LAST_VIRTUALENV</span></tt>.</p>
</div>
<div class="section" id="prermvirtualenv">
<span id="scripts-prermvirtualenv"></span><h2>prermvirtualenv<a class="headerlink" href="#prermvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">environment name</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/prermvirtualenv</span></tt> 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.</p>
</div>
<div class="section" id="postrmvirtualenv">
<span id="scripts-postrmvirtualenv"></span><h2>postrmvirtualenv<a class="headerlink" href="#postrmvirtualenv" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">environment name</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The <tt class="docutils literal"><span class="pre">$VIRTUALENVWRAPPER_HOOK_DIR/postrmvirtualenv</span></tt> 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.</p>
</div>
<div class="section" id="premkproject">
<span id="scripts-premkproject"></span><h2>premkproject<a class="headerlink" href="#premkproject" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">name of new project</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">run</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$WORKON_HOME/premkproject</span></tt> is run as an external program after the
virtual environment is created and after the current environment is
switched to point to the new env, but before the new project directory
is created. The current working directory for the script is
<tt class="docutils literal"><span class="pre">$PROJECT_HOME</span></tt> and the name of the new project is passed as an
argument to the script.</p>
</div>
<div class="section" id="postmkproject">
<span id="scripts-postmkproject"></span><h2>postmkproject<a class="headerlink" href="#postmkproject" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Global/Local:</th><td class="field-body">global</td>
</tr>
<tr class="field-even field"><th class="field-name">Argument(s):</th><td class="field-body">none</td>
</tr>
<tr class="field-odd field"><th class="field-name">Sourced/Run:</th><td class="field-body">sourced</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">$WORKON_HOME/postmkproject</span></tt> is sourced after the new environment
and project directories are created and the virtualenv is activated.
The current working directory is the project directory.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Per-User Customization</a><ul>
<li><a class="reference internal" href="#get-env-details">get_env_details</a></li>
<li><a class="reference internal" href="#initialize">initialize</a></li>
<li><a class="reference internal" href="#premkvirtualenv">premkvirtualenv</a></li>
<li><a class="reference internal" href="#postmkvirtualenv">postmkvirtualenv</a></li>
<li><a class="reference internal" href="#precpvirtualenv">precpvirtualenv</a></li>
<li><a class="reference internal" href="#postcpvirtualenv">postcpvirtualenv</a></li>
<li><a class="reference internal" href="#preactivate">preactivate</a></li>
<li><a class="reference internal" href="#postactivate">postactivate</a></li>
<li><a class="reference internal" href="#predeactivate">predeactivate</a></li>
<li><a class="reference internal" href="#postdeactivate">postdeactivate</a></li>
<li><a class="reference internal" href="#prermvirtualenv">prermvirtualenv</a></li>
<li><a class="reference internal" href="#postrmvirtualenv">postrmvirtualenv</a></li>
<li><a class="reference internal" href="#premkproject">premkproject</a></li>
<li><a class="reference internal" href="#postmkproject">postmkproject</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="hooks.html"
title="previous chapter">Customizing Virtualenvwrapper</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="plugins.html"
title="next chapter">Extending Virtualenvwrapper</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/scripts.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="plugins.html" title="Extending Virtualenvwrapper"
>next</a></li>
<li class="right" >
<a href="hooks.html" title="Customizing Virtualenvwrapper"
>previous</a> |</li>
<li><a href="index.html">virtualenvwrapper 4.3.1 documentation</a> »</li>
<li><a href="hooks.html" >Customizing Virtualenvwrapper</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009-2014, Doug Hellmann.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
|