from rootio.radio import Station, Language from rootio.user import User, UserDetail, ADMIN, ACTIVE from rootio.utils import MALE from alembic import command from alembic.config import Config def _make_context(): from rootio.extensions import db import rootio.telephony as t import rootio.user as u import rootio.radio as r return dict(db=db, u=u.models, t=t.models, r=r.models) app = create_app() manager = Manager(app) manager.add_command("sh", Shell(make_context=_make_context)) alembic_config = Config(os.path.realpath(os.path.dirname(__name__)) + "/alembic.ini") def easy(): """ pre import some things """ from rootio.extensions import db import rootio.telephony as t import rootio.user as u import rootio.radio as r @manager.command
def create_app(self): """Create and return a testing flask app.""" app = create_app(TestConfig) return app
import subprocess import time from flask.ext.script import Manager from rootio import create_app from rootio.extensions import db from rootio.radio import Station, Language from rootio.user import User, UserDetail, ADMIN, ACTIVE from rootio.utils import MALE from alembic import command from alembic.config import Config app = create_app() manager = Manager(app) alembic_config = Config( os.path.realpath(os.path.dirname(__name__)) + "/alembic.ini") @manager.command def run(): """Run webserver for local development.""" app.run(debug=True, use_reloader=False) @manager.command def alembic(): """Run in local machine."""
def create_app(self): """Create and return a testing flask app.""" app = create_app(TestConfig) self.twill = Twill(app, port=3000) return app