Пример #1
0
def main(db, feed_type, out):
    """Generate feeds for Symplectic Elements.

    The data is pulled from a database identified by DB, which should
    be a valid SQLAlchemy database connection string. For oracle use:

    oracle://<username>:<password>@<server>:1521/<sid>

    The feed will be printed to stdout if OUT is not specified.

    FEED_TYPE should be 'people' or 'articles'.
    """
    engine.configure(db)
    if feed_type == 'people':
        with person_feed(out) as f:
            for person in people():
                f(person)
    elif feed_type == 'articles':
        with article_feed(out) as f:
            for article in articles():
                f(article)
Пример #2
0
def app_init():
    engine.configure('sqlite://')
    metadata.bind = engine()
    metadata.create_all()
Пример #3
0
def load(db):
    engine.configure(db)
    with session() as s:
        pass