示例#1
0
def main(argv):
    args = docopt(__doc__, argv=argv[1:])

    if args['www']:
        app = create_instance()
        app.run(debug=args['--debug'],
                port=int(args['--port']),
                host=args['--host'])
    if args['bots']:
        start_manager()
    elif args['init']:
        app = create_instance()
        with app.app_context():
            # Let SQLAlchemy create any missing tables.
            db.create_all()
示例#2
0
def main(argv):
    args = docopt(__doc__, argv=argv[1:])

    if args['www']:
        app = create_instance()
        app.run(
            debug=args['--debug'],
            port=int(args['--port']),
            host=args['--host']
        )
    elif args['init']:
        app = create_instance()
        with app.app_context():
            # Let SQLAlchemy create any missing tables.
            db.create_all()
示例#3
0
def main(argv):
    args = docopt(__doc__, argv=argv[1:])

    if args['www']:
        app = create_instance()
        app.run(
            debug=args['--debug'],
            port=int(args['--port']),
            host=args['--host']
        )
示例#4
0
def send_mail(*args, **kwargs):
    """
    Sends an email using Flask-Mail and Notifico's configuration
    settings.
    """
    # TODO: Allow bulk sending using flask.mail.Connection.
    celery_app = create_instance()
    with celery_app.app_context():
        m = Message(*args, **kwargs)
        mail.send(m)
示例#5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility kludge to start celery within a Flask application
context, so we can use Flask's configuration for everything.
"""
from notifico import create_instance, celery

if __name__ == '__main__':
    app = create_instance()
    with app.app_context():
        celery.start()