@@ -73,6 +73,10 @@ def run_global(script_name, *args):
7373 "This hook is run before every virtualenv is activated." ),
7474 ("postactivate" ,
7575 "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." ),
7680 ]
7781
7882
@@ -88,6 +92,10 @@ def run_global(script_name, *args):
8892 "This hook is run before this virtualenv is activated." ),
8993 ("postactivate" ,
9094 "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." ),
9199 ]
92100
93101
@@ -218,3 +226,11 @@ def post_deactivate_source(args):
218226[ -f "$WORKON_HOME/postdeactivate" ] && source "$WORKON_HOME/postdeactivate"
219227unset VIRTUALENVWRAPPER_LAST_VIRTUAL_ENV
220228""" % { '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