def get_app(): mapper = Mapper() Index.setup_routes(mapper) db = BookmarkDB('sqlite:///:memory:') return Application(mapper, bdb=db), db
from __future__ import absolute_import import logging from routes import Mapper from corker.app import Application from yourls.data import BookmarkDB from yourls.app import Index import config log = logging.getLogger(__name__) mapper = Mapper() Index.setup_routes(mapper) db = BookmarkDB(config.DB_URL) app_pre = Application(mapper, bdb=db) try: from raven import Client from raven.middleware import Sentry client = Client(config.SENTRY_URL) app = Sentry(app_pre, client=client) client.captureMessage('spawn yourls') except Exception: log.warning("No Raven for Sentry") app = app_pre