def create_virtualenv(root):
 run_command(['virtualenv', '--python=/usr/bin/python2.7', '--quiet', root.path], added_env=dict(PYTHONDONTWRITEBYTECODE='1'))
 for module_name in virtualenv.REQUIRED_MODULES:
  py_base = root.descendant(['lib', 'python2.7', module_name])
  py = py_base.siblingExtension('.py')
  if (py.exists() and py.islink()):
   pyc = py_base.siblingExtension('.pyc')
   py_target = py.realpath()
   pyc_target = FilePath(py_target.splitext()[0]).siblingExtension('.pyc')
   if pyc.exists():
    pyc.remove()
   if pyc_target.exists():
    pyc_target.linkTo(pyc)
 return VirtualEnv(root=root)

def create_virtualenv ( root ) : run_command ( [ 'virtualenv' , '--python=/usr/bin/python2.7' , '--quiet' , root . path ] , added_env = dict ( PYTHONDONTWRITEBYTECODE = '1' ) ) for module_name in virtualenv . REQUIRED_MODULES : py_base = root . descendant ( [ 'lib' , 'python2.7' , module_name ] ) py = py_base . siblingExtension ( '.py' ) if ( py . exists ( ) and py . islink ( ) ) : pyc = py_base . siblingExtension ( '.pyc' ) py_target = py . realpath ( ) pyc_target = FilePath ( py_target . splitext ( ) [ 0 ] ) . siblingExtension ( '.pyc' ) if pyc . exists ( ) : pyc . remove ( ) if pyc_target . exists ( ) : pyc_target . linkTo ( pyc ) return VirtualEnv ( root = root )
create a virtualenv in root .