@@ -73,6 +73,10 @@ def run_global(script_name, *args):
73
73
"This hook is run before every virtualenv is activated." ),
74
74
("postactivate" ,
75
75
"This hook is run after every virtualenv is activated." ),
76
+
77
+ # get_env_details
78
+ ("get_env_details" ,
79
+ "This hook is run when the list of virtualenvs is printed so each name can include details." ),
76
80
]
77
81
78
82
@@ -88,6 +92,10 @@ def run_global(script_name, *args):
88
92
"This hook is run before this virtualenv is activated." ),
89
93
("postactivate" ,
90
94
"This hook is run after this virtualenv is activated." ),
95
+
96
+ # get_env_details
97
+ ("get_env_details" ,
98
+ "This hook is run when the list of virtualenvs is printed so each name can include details." ),
91
99
]
92
100
93
101
@@ -218,3 +226,11 @@ def post_deactivate_source(args):
218
226
[ -f "$WORKON_HOME/postdeactivate" ] && source "$WORKON_HOME/postdeactivate"
219
227
unset VIRTUALENVWRAPPER_LAST_VIRTUAL_ENV
220
228
""" % { 'env_name' :args [0 ] }
229
+
230
+
231
+ def get_env_details (args ):
232
+ log .debug ('get_env_details' )
233
+ run_global ('get_env_details' , * args )
234
+ script_path = os .path .expandvars (os .path .join ('$WORKON_HOME' , args [0 ], 'bin' , 'get_env_details' ))
235
+ run_script (script_path , * args )
236
+ return
0 commit comments