Exemple #1
0
from emerald import help, db_create, db_migrate
from emerald import db_upgrade, db_downgrade, db_version
from emerald import install_package
from emerald import add_controller, add_model
from emerald import run_tornado, run_gunicorn, run_testrun

if len(sys.argv) > 1:
    sysinput = sys.argv[1].lower()

    if sysinput == '--help' or sysinput == '-h':
        help()

    elif sysinput == '--add' or sysinput == '-a':
        if sys.argv[2]:
            install_package(sys.argv[2])
        else:
            print "You need to specify a valid package name"
            sys.exit()

    elif sysinput == '--create' or sysinput == '-c':
        if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
            db_create()
        else:
            print '\nPrevious database version found. Please use -m or --migrate option\n'
            sys.exit()

    elif sysinput == '--migrate' or sysinput == '-m':
        db_migrate()

    elif sysinput == '--initiate' or sysinput == '-i':
Exemple #2
0
from emerald import help
from emerald import add_model
from emerald import install_package
from emerald import add_controller



if len(sys.argv) > 1:
    sysinput = sys.argv[1].lower()

    if sysinput == '--help' or sysinput == '-h':
        help()

    elif sysinput == '--add' or sysinput == '-a':
        if len(sys.argv) > 3:
            install_package(sys.argv[2], sys.argv[3])
        else:
            print "You need to specify a valid package name"
            sys.exit()

    elif sysinput == '--initiate' or sysinput == '-i':
        if len(sys.argv) > 2 and not sys.argv[2].isdigit():
            add_controller(sys.argv[2])
        else:
            print 'Controller name can not be a number'
            sys.exit()

    elif sysinput == '--new' or sysinput == '-n':
        if len(sys.argv) > 2:
            model_name = sys.argv[2].title()
            raw_component = sys.argv[3:]
Exemple #3
0
from emerald import help, db_create, db_migrate 
from emerald import db_upgrade, db_downgrade, db_version
from emerald import install_package
from emerald import add_controller, add_model
from emerald import run_tornado, run_gunicorn, run_testrun

if len(sys.argv) > 1:
    sysinput = sys.argv[1].lower()

    if sysinput == '--help' or sysinput == '-h':
        help()

    elif sysinput == '--add' or sysinput == '-a':
        if sys.argv[2]:
            install_package(sys.argv[2])
        else:
            print "You need to specify a valid package name"
            sys.exit()

    elif sysinput == '--create' or sysinput == '-c':
        if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
            db_create()
        else:
            print '\nPrevious database version found. Please use -m or --migrate option\n'
            sys.exit()

    elif sysinput == '--migrate' or sysinput == '-m':
        db_migrate()

    elif sysinput == '--initiate' or sysinput == '-i':