@task
def virtualenv_activate(requirements_revision=None):
 assert (not is_old_env()), 'Active environment is old-style (directory, not symlink). Manual intervention required!'
 req_rev = (requirements_revision or latest_requirements_revision())
 assert virtualenv_verify(req_rev), ('Desired env revision %s invalid, cannot be made active' % req_rev)
 env_dir = ('env.%s' % req_rev)
 run(('echo "import sys; sys.setdefaultencoding(\'utf-8\')" > %s/viewfinder/lib/python2.7/sitecustomize.py' % env_dir))
 run(('ln -T -s -f ~/env.%s ~/env' % req_rev))
 fprint(('Environment at rev %s marked active.' % req_rev))

@ task def virtualenv_activate ( requirements_revision = None ) : assert ( not is_old_env ( ) ) , 'Active environment is old-style (directory, not symlink). Manual intervention required!' req_rev = ( requirements_revision or latest_requirements_revision ( ) ) assert virtualenv_verify ( req_rev ) , ( 'Desired env revision %s invalid, cannot be made active' % req_rev ) env_dir = ( 'env.%s' % req_rev ) run ( ( 'echo "import sys; sys.setdefaultencoding(\'utf-8\')" > %s/viewfinder/lib/python2.7/sitecustomize.py' % env_dir ) ) run ( ( 'ln -T -s -f ~/env.%s ~/env' % req_rev ) ) fprint ( ( 'Environment at rev %s marked active.' % req_rev ) )
make the virtual env at revision active .