16
16
17
17
エンドユーザのカスタマイズスクリプトは *読み込み * (シェル環境を変更できる) されるか、適切な条件で外部プログラムのように *実行 * されるかのどちらかです。
18
18
19
+ ..
20
+ The global scripts applied to all environments should be placed in the
21
+ directory named by :ref:`VIRTUALENVWRAPPER_HOOK_DIR
22
+ <variable-VIRTUALENVWRAPPER_HOOK_DIR>`. The local scripts should be
23
+ placed in the ``bin`` directory of the virtualenv.
24
+
25
+ 全ての環境に適用されるグローバルスクリプトは、 :ref: `VIRTUALENVWRAPPER_HOOK_DIR <variable-VIRTUALENVWRAPPER_HOOK_DIR >` で指定したディレクトリに置きます。ローカルスクリプトは virtualenv の ``bin `` ディレクトリに置きます。
26
+
19
27
.. _scripts-get_env_details :
20
28
21
29
get_env_details
@@ -30,12 +38,12 @@ get_env_details
30
38
:読み込み/実行: 実行
31
39
32
40
..
33
- ``$WORKON_HOME /get_env_details`` is run when ``workon`` is run with no
41
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /get_env_details`` is run when ``workon`` is run with no
34
42
arguments and a list of the virtual environments is printed. The hook
35
43
is run once for each environment, after the name is printed, and can
36
44
print additional information about that environment.
37
45
38
- ``$WORKON_HOME /get_env_details `` は ``workon `` が引数無しで実行されるときに実行されます。そして、仮想環境のリストを表示します。仮想環境の名前が表示された後で、そのフックは環境毎に一度実行されて、その環境に関する追加情報を表示します。
46
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /get_env_details `` は ``workon `` が引数無しで実行されるときに実行されます。そして、仮想環境のリストを表示します。仮想環境の名前が表示された後で、そのフックは環境毎に一度実行されて、その環境に関する追加情報を表示します。
39
47
40
48
.. _scripts-initialize :
41
49
@@ -51,11 +59,11 @@ initialize
51
59
:読み込み/実行: 読み込み
52
60
53
61
..
54
- ``$WORKON_HOME /initialize`` is sourced when ``virtualenvwrapper.sh``
62
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /initialize`` is sourced when ``virtualenvwrapper.sh``
55
63
is loaded into your environment. Use it to adjust global settings
56
64
when virtualenvwrapper is enabled.
57
65
58
- あなたの環境に ``virtualenvwrapper.sh `` を読み込むときに ``$WORKON_HOME /initialize `` が読み込まれます。virtualenvwrapper が有効になるときにグローバルな設定を調整するために使用してください。
66
+ あなたの環境に ``virtualenvwrapper.sh `` を読み込むときに ``$VIRTUALENVWRAPPER_HOOK_DIR /initialize `` が読み込まれます。virtualenvwrapper が有効になるときにグローバルな設定を調整するために使用してください。
59
67
60
68
.. _scripts-premkvirtualenv :
61
69
@@ -71,13 +79,13 @@ premkvirtualenv
71
79
:読み込み/実行: 実行
72
80
73
81
..
74
- ``$WORKON_HOME /premkvirtualenv`` is run as an external program after
82
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /premkvirtualenv`` is run as an external program after
75
83
the virtual environment is created but before the current environment
76
84
is switched to point to the new env. The current working directory for
77
85
the script is ``$WORKON_HOME`` and the name of the new environment is
78
86
passed as an argument to the script.
79
87
80
- ``$WORKON_HOME /premkvirtualenv `` は仮想環境が作成された後で外部プログラムのように実行されますが、カレントの環境が新しい環境へ切り替わる前に実行されます。そのスクリプトのカレントワークディレクトリは ``$WORKON_HOME `` で、そのスクリプトへの引数として新しい環境の名前が渡されます。
88
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /premkvirtualenv `` は仮想環境が作成された後で外部プログラムのように実行されますが、カレントの環境が新しい環境へ切り替わる前に実行されます。そのスクリプトのカレントワークディレクトリは ``$WORKON_HOME `` で、そのスクリプトへの引数として新しい環境の名前が渡されます。
81
89
82
90
.. _scripts-postmkvirtualenv :
83
91
@@ -93,10 +101,11 @@ postmkvirtualenv
93
101
:読み込み/実行: 読み込み
94
102
95
103
..
96
- ``$WORKON_HOME/postmkvirtualenv`` is sourced after the new environment
97
- is created and activated.
104
+ ``$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv`` is sourced after the new environment
105
+ is created and activated. If the ``-a`` <project_path> flag was used,
106
+ the link to the project directory is set up before this script is sourced.
98
107
99
- ``$WORKON_HOME /postmkvirtualenv `` は新しい環境が作成されてアクティブ化された後で読み込まれます 。
108
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /postmkvirtualenv `` は、新しい環境が作成されてアクティブ化された後で読み込まれます。 `` -a `` <project_path> フラグを指定された場合、このスクリプトを読み込む前にプロジェクトディレクトリへのリンクを設定します 。
100
109
101
110
.. _scripts-precpvirtualenv :
102
111
@@ -112,14 +121,14 @@ precpvirtualenv
112
121
:読み込み/実行: 実行
113
122
114
123
..
115
- ``$WORKON_HOME /precpvirtualenv`` is run as an external program after
124
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /precpvirtualenv`` is run as an external program after
116
125
the source environment is duplicated and made relocatable, but before
117
126
the ``premkvirtualenv`` hook is run or the current environment is
118
127
switched to point to the new env. The current working directory for
119
128
the script is ``$WORKON_HOME`` and the names of the source and new
120
129
environments are passed as arguments to the script.
121
130
122
- ``$WORKON_HOME /precpvirtualenv `` は元の環境が複製されて再配置可能になるときに外部プログラムのように実行されますが、 ``premkvirtualenv `` フックが実行される前、もしくはカレントの環境が新しい環境へ切り替わる前に実行されます。そのスクリプトのカレントワークディレクトリは ``$WORKON_HOME `` で、そのスクリプトへの引数として元の環境名と新しい環境名が渡されます。
131
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /precpvirtualenv `` は元の環境が複製されて再配置可能になるときに外部プログラムのように実行されますが、 ``premkvirtualenv `` フックが実行される前、もしくはカレントの環境が新しい環境へ切り替わる前に実行されます。そのスクリプトのカレントワークディレクトリは ``$WORKON_HOME `` で、そのスクリプトへの引数として元の環境名と新しい環境名が渡されます。
123
132
124
133
.. _scripts-postcpvirtualenv :
125
134
@@ -135,10 +144,10 @@ postcpvirtualenv
135
144
:読み込み/実行: 読み込み
136
145
137
146
..
138
- ``$WORKON_HOME/postmkvirtualenv `` is sourced after the new environment
147
+ ``$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv `` is sourced after the new environment
139
148
is created and activated.
140
149
141
- ``$WORKON_HOME/postmkvirtualenv `` は新しい環境が作成されてアクティブ化された後で読み込まれます。
150
+ ``$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv `` は新しい環境が作成されてアクティブ化された後で読み込まれます。
142
151
143
152
.. _scripts-preactivate :
144
153
@@ -154,11 +163,11 @@ preactivate
154
163
:読み込み/実行: 実行
155
164
156
165
..
157
- The global ``$WORKON_HOME /preactivate`` script is run before the new
166
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /preactivate`` script is run before the new
158
167
environment is enabled. The environment name is passed as the first
159
168
argument.
160
169
161
- グローバルの ``$WORKON_HOME /preactivate `` スクリプトは新しい仮想環境が有効になる前に実行されます。その環境名は1番目の引数として渡されます。
170
+ グローバルの ``$VIRTUALENVWRAPPER_HOOK_DIR /preactivate `` スクリプトは新しい仮想環境が有効になる前に実行されます。その環境名は1番目の引数として渡されます。
162
171
163
172
..
164
173
The local ``$VIRTUAL_ENV/bin/preactivate`` hook is run before the new
@@ -181,11 +190,11 @@ postactivate
181
190
:読み込み/実行: 読み込み
182
191
183
192
..
184
- The global ``$WORKON_HOME /postactivate`` script is sourced after the
193
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /postactivate`` script is sourced after the
185
194
new environment is enabled. ``$VIRTUAL_ENV`` refers to the new
186
195
environment at the time the script runs.
187
196
188
- グローバルの ``$WORKON_HOME /postactivate `` スクリプトは新しい仮想環境が有効になった後で読み込まれます。 ``$VIRTUAL_ENV `` はそのスクリプトが実行されるときに新しい環境を参照します。
197
+ グローバルの ``$VIRTUALENVWRAPPER_HOOK_DIR /postactivate `` スクリプトは新しい仮想環境が有効になった後で読み込まれます。 ``$VIRTUAL_ENV `` はそのスクリプトが実行されるときに新しい環境を参照します。
189
198
190
199
..
191
200
This example script adds a space between the virtual environment name
@@ -239,11 +248,11 @@ predeactivate
239
248
ローカルの ``$VIRTUAL_ENV/bin/predeactivate `` スクリプトはカレントの仮想環境が非アクティブ化される前に読み込まれます。そして、あなたの環境の設定をクリアしたり、無効にするために使用されます。 ``$VIRTUAL_ENV `` はそのスクリプトが実行されるときに古い環境を参照します。
240
249
241
250
..
242
- The global ``$WORKON_HOME /predeactivate`` script is sourced before the
251
+ The global ``$VIRTUALENVWRAPPER_HOOK_DIR /predeactivate`` script is sourced before the
243
252
current environment is deactivated. ``$VIRTUAL_ENV`` refers to the
244
253
old environment at the time the script runs.
245
254
246
- グローバルの ``$WORKON_HOME /predeactivate `` スクリプトはカレントの仮想環境が非アクティブ化される前に読み込まれます。 ``$VIRTUAL_ENV `` はそのスクリプトが実行されるときに古い環境を参照します。
255
+ グローバルの ``$VIRTUALENVWRAPPER_HOOK_DIR /predeactivate `` スクリプトはカレントの仮想環境が非アクティブ化される前に読み込まれます。 ``$VIRTUAL_ENV `` はそのスクリプトが実行されるときに古い環境を参照します。
247
256
248
257
.. _scripts-postdeactivate :
249
258
@@ -280,11 +289,11 @@ prermvirtualenv
280
289
:読み込み/実行: 実行
281
290
282
291
..
283
- The ``$WORKON_HOME /prermvirtualenv`` script is run as an external
292
+ The ``$VIRTUALENVWRAPPER_HOOK_DIR /prermvirtualenv`` script is run as an external
284
293
program before the environment is removed. The full path to the
285
294
environment directory is passed as an argument to the script.
286
295
287
- ``$WORKON_HOME /prermvirtualenv `` スクリプトは仮想環境が削除される前に外部コマンドのように実行されます。そのスクリプトへの引数としてその環境のディレクトリに対するフルパスが渡されます。
296
+ ``$VIRTUALENVWRAPPER_HOOK_DIR /prermvirtualenv `` スクリプトは仮想環境が削除される前に外部コマンドのように実行されます。そのスクリプトへの引数としてその環境のディレクトリに対するフルパスが渡されます。
288
297
289
298
.. _scripts-postrmvirtualenv :
290
299
@@ -300,8 +309,53 @@ postrmvirtualenv
300
309
:読み込み/実行: 実行
301
310
302
311
..
303
- The ``$WORKON_HOME /postrmvirtualenv`` script is run as an external
312
+ The ``$VIRTUALENVWRAPPER_HOOK_DIR /postrmvirtualenv`` script is run as an external
304
313
program after the environment is removed. The full path to the
305
314
environment directory is passed as an argument to the script.
306
315
307
- ``$WORKON_HOME/postrmvirtualenv `` スクリプトは仮想環境が削除された後で外部コマンドのように実行されます。そのスクリプトへの引数としてその環境のディレクトリに対するフルパスが渡されます。
316
+ ``$VIRTUALENVWRAPPER_HOOK_DIR/postrmvirtualenv `` スクリプトは仮想環境が削除された後で外部コマンドのように実行されます。そのスクリプトへの引数としてその環境のディレクトリに対するフルパスが渡されます。
317
+
318
+ .. _scripts-premkproject :
319
+
320
+ premkproject
321
+ ===============
322
+
323
+ .. :Global/Local: global
324
+ :Argument(s): name of new project
325
+ :Sourced/Run: run
326
+
327
+ :グローバル/ローカル: グローバル
328
+ :引数: 新しいプロジェクト名
329
+ :読み込み/実行: 実行
330
+
331
+ ..
332
+ ``$WORKON_HOME/premkproject`` is run as an external program after the
333
+ virtual environment is created and after the current environment is
334
+ switched to point to the new env, but before the new project directory
335
+ is created. The current working directory for the script is
336
+ ``$PROJECT_HOME`` and the name of the new project is passed as an
337
+ argument to the script.
338
+
339
+ ``$WORKON_HOME/premkproject `` は、仮想環境が作成されてカレントの環境が新しい環境を指すように切り替わった後で、外部プログラムとして実行されます。
340
+ 但し、そのタイミングは新しいプロジェクトディレクトリが作成される前です。
341
+ このスクリプトのカレントのワークディレクトリは ``$PROJECT_HOME `` となり、新しいプロジェクト名がこのスクリプトの引数として渡されます。
342
+
343
+ .. _scripts-postmkproject :
344
+
345
+ postmkproject
346
+ ================
347
+
348
+ .. :Global/Local: global
349
+ :Argument(s): none
350
+ :Sourced/Run: sourced
351
+
352
+ :グローバル/ローカル: グローバル
353
+ :引数: 無し
354
+ :読み込み/実行: 読み込み
355
+
356
+ ..
357
+ ``$WORKON_HOME/postmkproject`` is sourced after the new environment
358
+ and project directories are created and the virtualenv is activated.
359
+ The current working directory is the project directory.
360
+
361
+ ``$WORKON_HOME/postmkproject `` は、新しい環境とプロジェクトディレクトリが作成されて virtualenv がアクティブ化された後で読み込まれます。カレントのワークディレクトリはプロジェクトディレクトリです。
0 commit comments