serious hacking to deal with existing FK data in Note.
[oweals/karmaworld.git] / fabfile.py
index 6cc63738bcb7eeb3e372040d14846e6914bf5c1e..e5999760cd4c79399e3065f85e2f2fe818d2d06c 100644 (file)
@@ -32,7 +32,8 @@ def virtenv_path():
         return env['env_root']
 
     # Not memoized. Try to find a single unique virtual environment.
-    outp = run("find -L {0} -path '*/bin/activate' | grep -v '/local/'".format(env.proj_root))
+    with settings(warn_only=True):
+        outp = run("find -L {0} -path '*/bin/activate' | grep -v '/local/'".format(env.proj_root))
     if not len(outp) or len(outp.splitlines()) != 1:
         # Cannot find any virtualenv or found multiple virtualenvs. 
         if len(outp) and default_venv not in outp:
@@ -72,7 +73,7 @@ def collect_static():
        Collect static files (if AWS config. present, push to S3)
        """
 
-       virtenv_exec('%s/manage.py collectstatic --noinput' % env.code_root )   
+       virtenv_exec('{0}/manage.py collectstatic --noinput'.format(env.code_root))
 
 ####### Run Dev Server
 @task
@@ -81,7 +82,7 @@ def dev_server():
        Runs the built-in django webserver
        """
 
-       virtenv_exec('%s/manage.py runserver' % env.code_root)  
+       virtenv_exec('{0}/manage.py runserver'.format(env.code_root))
 
 ####### Create Virtual Environment
 
@@ -121,8 +122,7 @@ def restart_supervisord():
     """
     Restarts supervisord, also making sure to load in new config data.
     """
-    virtenv_exec('supervisorctl -c {0} update'.format(env.supervisor_conf))
-    virtenv_exec('supervisorctl -c {0} restart all'.format(env.supervisor_conf))
+    virtenv_exec('supervisorctl -c {0} update; supervisorctl -c {0} restart all'.format(env.supervisor_conf))
 
 
 def supervisorctl(action, process):
@@ -135,7 +135,7 @@ def supervisorctl(action, process):
 
 
 @task
-def start_celeryd():
+def start_celery():
     """
     Starts the celeryd process
     """
@@ -143,7 +143,7 @@ def start_celeryd():
 
 
 @task
-def stop_celeryd():
+def stop_celery():
     """
     Stops the celeryd process
     """
@@ -190,7 +190,7 @@ def update_reqs():
 ####### Pull new code
 @task
 def update_code():
-    virtenv_exec('cd %s; git pull' % env.proj_root )
+    virtenv_exec('cd {0}; git pull'.format(env.code_root))
 
 def backup():
     """
@@ -250,38 +250,6 @@ def import_usde():
     virtenv_exec('{0}/manage.py import_usde_csv {1}'.format(env.code_root, env.usde_csv))
     virtenv_exec('{0}/manage.py sanitize_usde_schools'.format(env.code_root))
 
-@task
-def install_pdf2htmlEX():
-    """
-    # Some things we need:
-    sudo apt-get install cmake libpng-dev libjpeg-dev libgtk2.0-dev pkg-config libfontconfig1-dev autoconf libtool
-
-    # Ubuntu 12.04 comes with a version of poppler that is too
-    # old, so compile our own
-    wget http://poppler.freedesktop.org/poppler-0.24.4.tar.xz
-    tar xf poppler-0.24.4.tar.gz
-    ./configure --prefix=/usr --enable-xpdf-headers
-    make
-    sudo make install
-
-    # Ubuntu 12.04 comes with a version of fontforge that is too
-    # old, so compile our own
-    git clone https://github.com/fontforge/fontforge.git
-    ./autogen.sh
-    ./configure --prefix=/usr
-    make
-    sudo make install
-
-    # Compile pdf2htmlEX
-    wget https://github.com/coolwanglu/pdf2htmlEX/archive/v0.10.tar.gz
-    tar xf x0.10.tar.gz
-    cd pdf2htmlEX
-    cmake .
-    make
-    sudo make install
-    """
-    print "not implemented yet!"
-
 @task
 def first_deploy():
     """