Browse Source

Removing useless files

Mike Smith 10 years ago
parent
commit
92518ac92e

+ 0 - 18
frameworks/Python/falcon/setup.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY2_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/falcon/setup_py3.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY3_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/falcon/setup_pypy.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PYPY_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 35
frameworks/Python/flask/setup_nginxuwsgi.py

@@ -1,35 +0,0 @@
-import multiprocessing
-import os
-import subprocess
-
-
-CWD = os.path.abspath(os.path.dirname(__file__))
-bin_dir = os.path.expandvars('$PY2_ROOT/bin')
-NCPU = multiprocessing.cpu_count()
-NGINX_COMMAND = 'sudo /usr/local/nginx/sbin/nginx -c ' + CWD + '/nginx.conf'
-
-
-def start(args, logfile, errfile):
-    try:
-        subprocess.call(
-            NGINX_COMMAND,
-            shell=True, stdout=logfile, stderr=errfile)
-
-        # Run in the background, but keep stdout/stderr for easy debugging
-        subprocess.Popen(
-            "{0}/uwsgi --ini uwsgi.ini --processes {1} --wsgi app:app".format(bin_dir, NCPU*3),
-            shell=True, cwd=CWD, stderr=errfile, stdout=logfile)
-
-        return 0
-    except subprocess.CalledProcessError:
-        return 1
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        NGINX_COMMAND + ' -s stop',
-        shell=True, stdout=logfile, stderr=errfile)
-
-    subprocess.call(bin_dir + '/uwsgi --stop /tmp/uwsgi.pid',
-                    shell=True, stderr=errfile, stdout=logfile)
-    return 0

+ 0 - 24
frameworks/Python/flask/setup_py2.py

@@ -1,24 +0,0 @@
-from __future__ import print_function
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-import multiprocessing
-
-def start(args, logfile, errfile):
-    print("Envoronment variables:")
-    for k, v in os.environ.items():
-        print('%s=%s' % (k, v))
-    print("Cores:", multiprocessing.cpu_count())
-    subprocess.Popen(
-        "$PY2_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/flask/setup_py3.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY3_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/flask/setup_pypy.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PYPY_GUNICORN app:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/pyramid/setup_py2.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY2_GUNICORN wsgi:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 18
frameworks/Python/pyramid/setup_py3.py

@@ -1,18 +0,0 @@
-import os
-import subprocess
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY3_GUNICORN wsgi:app -c gunicorn_conf.py",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        "kill `cat gunicorn.pid`",
-        cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
-    return 0

+ 0 - 26
frameworks/Python/tornado/setup.py

@@ -1,26 +0,0 @@
-from os.path import expanduser
-from os import kill
-import subprocess
-import sys
-import time
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY2 server.py --port=8080 --mongo=%s --logging=error" % (args.database_host,),
-        shell=True, cwd='tornado', stderr=errfile, stdout=logfile)
-    return 0
-
-def stop(logfile, errfile):
-    for line in subprocess.check_output(["ps", "aux"]).splitlines():
-        if 'server.py --port=8080' in line:
-            pid = int(line.split(None,2)[1])
-            kill(pid, 9)
-    return 0
-
-if __name__ == '__main__':
-    class DummyArg:
-        database_host = 'localhost'
-    start(DummyArg(), sys.stderr, sys.stderr)
-    time.sleep(1)
-    stop(sys.stderr, sys.stderr)

+ 0 - 25
frameworks/Python/tornado/setup_pg.py

@@ -1,25 +0,0 @@
-import os
-import subprocess
-import sys
-import time
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen('$PY2 server.py --port=8080 --postgres=%s --logging=error' % (args.database_host,),
-        shell=True, cwd='tornado', stderr=errfile, stdout=logfile)
-    return 0
-
-
-def stop(logfile, errfile):
-    for line in subprocess.check_output(['ps', 'aux']).splitlines():
-        if 'server.py --port=8080' in line:
-            pid = int(line.split(None, 2)[1])
-            os.kill(pid, 9)
-    return 0
-
-if __name__ == '__main__':
-    class DummyArg:
-        database_host = 'localhost'
-    start(DummyArg(), sys.stderr, sys.stderr)
-    time.sleep(1)
-    stop(sys.stderr, sys.stderr)

+ 0 - 30
frameworks/Python/tornado/setup_py3.py

@@ -1,30 +0,0 @@
-import os
-import subprocess
-import sys
-import time
-
-CWD = os.path.dirname(__file__)
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen(
-        "$PY3 server.py --port=8080 --mongo=%s --logging=error" % (args.database_host,),
-        shell=True, cwd=CWD, stderr=errfile, stdout=logfile)
-    return 0
-
-
-def stop(logfile, errfile):
-    subprocess.call(
-        'pgrep -f server.py',
-        shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call(
-        'pkill -f server.py',
-        shell=True, stderr=errfile, stdout=logfile)
-
-
-if __name__ == '__main__':
-    class DummyArg:
-        database_host = 'localhost'
-    start(DummyArg(), sys.stderr, sys.stderr)
-    time.sleep(1)
-    stop(sys.stderr, sys.stderr)