Commits

Rod Morison  committed c43841b Draft

remove v2 files

  • Participants
  • Parent commits 75dcfc1
  • Branches v1_legacy

Comments (0)

Files changed (3)

File fabfile.py

-
-from fabric.api import *
-
-@task
-def local():
-    """Use localhost as target"""
-    env.hosts = ['localhost']
-
-#
-# installers2 inclusions
-#
-from installers2.virtualenv import setup_virtualenvwrapper
-

File installers2/__init__.py

Empty file removed.

File installers2/virtualenv.py

-"""
-Install and setup python virtualenv and virtualenvwrapper
-"""
-
-from os import getenv
-from textwrap import dedent
-from fabric.api import *
-
-from utils.path import path
-
-@task
-def setup_virtualenvwrapper(user=None, env_dir='pyves', proj_dir='projects', 
-                            rcfile='.virtualenvrc'):
-    """Install virtualenv and virtualenvwrapper for a user"""
-    sudo("pip install --upgrade virtualenv virtualenvwrapper")
-    home = path(run("echo ~%s" % (user or '')))
-    env_dir = path(env_dir)
-    proj_dir = path(proj_dir)
-    if not env_dir.isabs():
-        env_dir = home / env_dir
-    if not proj_dir.isabs():
-        proj_dir = home / proj_dir
-    with settings(env_dir=env_dir, proj_dir=proj_dir, rcfile=rcfile,
-                  virtualenvrc_file=home/'.virtualenvrc', bashrc_file=home/'.bashrc'):
-        sudo("test -e %(proj_dir)s || mkdir -p %(proj_dir)s" % env, user=user)
-        env['virtualenvrc'] = dedent("""
-                                     export WORKON_HOME="%(env_dir)s"
-                                     export PROJECT_HOME="%(proj_dir)s"
-                                     source /usr/local/bin/virtualenvwrapper.sh
-                                     """ % env)
-        env['bashrc'] = dedent("""
-                               source $HOME/%(rcfile)s
-                               """ % env)
-        sudo("echo '%(virtualenvrc)s' >%(virtualenvrc_file)s"
-             " && source %(virtualenvrc_file)s" % env, user=user)
-        sudo("grep '%(rcfile)s' %(bashrc_file)s" 
-             " || echo '%(bashrc)s' >>%(bashrc_file)s" % env, user=user)