Beispiel #1
0
def test(module="",verbose=0):
    verbose = int(verbose)
    if verbose == 1:
        grep_filter = ""
    else:
        grep_filter = "| grep '\(Assertion\)\|\(\.\.\.\.\)\|\(Ran\)'"
    with cd("project"):
        run("python manage.py test %s 2>&1 %s " % (module, grep_filter))
Beispiel #2
0
def configure_mysql():
    sudo("apt-get install mysql-server python-mysqldb")
    with cd("project"):
        run("rm -rf local*")
        run("./django-create-local-settings")
        run("./django-add-db")
        run("./mysql-create-djangouser")
        run("python manage.py syncdb")
Beispiel #3
0
def install_jsonrpc():
    try:
        import jsonrpc
        print "jsonrpc is installed."
    except ImportError, e:
        if e.message == "No module named jsonrpc":
            with cd('lib/django-json-rpc'):
                sudo("python setup.py install")
Beispiel #4
0
def configure_mysql():
    sudo("apt-get install mysql-server python-mysqldb")
    with cd("project"):
        run("rm -rf local*")
        run("./django-create-local-settings")
        run("./django-add-db")
        run("./mysql-create-djangouser")
        run("python manage.py syncdb")
Beispiel #5
0
def install_tastypie():
    try:
        import tastypie
        print "tastypie is installed - version %s." % str(tastypie.__version__)
    except ImportError, e:
        sudo("pip install mimeparse")
        with cd('lib/django-tastypie'):
            sudo("python setup.py install")
Beispiel #6
0
def install_jsonrpc():
    try:
        import jsonrpc
        print "jsonrpc is installed."
    except ImportError, e:
        if e.message == "No module named jsonrpc":
            with cd('lib/django-json-rpc'):
                sudo("python setup.py install")
Beispiel #7
0
def install_tastypie():
    try:
        import tastypie
        print "tastypie is installed - version %s." % str(tastypie.__version__)
    except ImportError, e:
        sudo("pip install mimeparse")
        with cd('lib/django-tastypie'):
            sudo("python setup.py install")
Beispiel #8
0
def test(module="", verbose=0):
    verbose = int(verbose)
    if verbose == 1:
        grep_filter = ""
    else:
        grep_filter = "| grep '\(Assertion\)\|\(\.\.\.\.\)\|\(Ran\)'"
    with cd("project"):
        run("python manage.py test %s 2>&1 %s " % (module, grep_filter))
Beispiel #9
0
def install_django():
    try:
        import django
        print "django is installed - version %s." % str(django.VERSION)

    except ImportError, e:
        if e.message == "No module named django":
            with cd('lib/Django-1.3.1'):
                sudo("python setup.py install")
Beispiel #10
0
def install_django():
    try:
        import django
        print "django is installed - version %s." % str(django.VERSION)

    except ImportError, e:
        if e.message == "No module named django":
            with cd('lib/Django-1.3.1'):
                sudo("python setup.py install")
Beispiel #11
0
def db_flush():
    import project.settings as settings
    dbconfig = settings.DATABASES['default']
    dbengine = dbconfig['ENGINE'].split(".")[-1]

    if dbengine == 'sqlite3':
        dbfile = settings.DATABASES['default']['NAME'].split("/")
        dbfile = dbfile[1]
        with cd("project"):
            run("rm " + dbfile + " -rf")
    elif dbengine == 'mysql':
        cmd = "mysqldump -u%s -p%s --add-drop-table --no-data %s | grep ^DROP | mysql -u%s -p%s %s"
        cmd %= (dbconfig['USER'], dbconfig['PASSWORD'], dbconfig['NAME'],
                dbconfig['USER'], dbconfig['PASSWORD'], dbconfig['NAME'])
        run(cmd)

    with cd("project"):
        run("echo 'no' | python manage.py syncdb")
    load_superuser()
Beispiel #12
0
def db_flush():
    import project.settings as settings 
    dbconfig = settings.DATABASES['default']
    dbengine = dbconfig['ENGINE'].split(".")[-1]

    if dbengine == 'sqlite3':
        dbfile = settings.DATABASES['default']['NAME'].split("/")
        dbfile = dbfile[1]
        with cd("project"):
            run("rm "+dbfile+" -rf")
    elif dbengine == 'mysql':
        cmd = "mysqldump -u%s -p%s --add-drop-table --no-data %s | grep ^DROP | mysql -u%s -p%s %s"
        cmd %= (dbconfig['USER'], dbconfig['PASSWORD'], dbconfig['NAME'],
                dbconfig['USER'], dbconfig['PASSWORD'], dbconfig['NAME'])
        run(cmd)

    with cd("project"):
        run("echo 'no' | python manage.py syncdb")
    load_superuser()
Beispiel #13
0
def install_nodejs():
    NODE_VERSION = "v0.6.5"

    with settings(warn_only=True):
        result = run("node --version")
        
    if result.failed:
        with cd("lib/node"):
            run("git checkout %s" % NODE_VERSION)
            sudo("apt-get install libssl-dev openssl")
            run("./configure")
            run("make")
            sudo("make install")
    else:
        print "Node.js already installed"

    install_npm()
Beispiel #14
0
def install_nodejs():
    NODE_VERSION = "v0.6.5"

    with settings(warn_only=True):
        result = run("node --version")

    if result.failed:
        with cd("lib/node"):
            run("git checkout %s" % NODE_VERSION)
            sudo("apt-get install libssl-dev openssl")
            run("./configure")
            run("make")
            sudo("make install")
    else:
        print "Node.js already installed"

    install_npm()
Beispiel #15
0
def install_klooff_lib():
    with cd("lib/klooff"):
        sudo("python setup.py install")
Beispiel #16
0
def test():
    with cd("project"):
        run("python manage.py test")
Beispiel #17
0
def run_development():
    with cd("project"):
        run("python manage.py runserver 0.0.0.0:8000")
Beispiel #18
0
def test():
    with cd("project"):
        run("python manage.py test")
Beispiel #19
0
def run_development():
    with cd("project"):
        run("python manage.py runserver 0.0.0.0:8000") 
Beispiel #20
0
def load_superuser():
    with cd("project"):
        run("python manage.py loaddata superuser")
Beispiel #21
0
def load_superuser():
    with cd("project"):
        run("python manage.py loaddata superuser")
Beispiel #22
0
def install_klooff_lib():
    with cd("lib/klooff"):
        sudo("python setup.py install")