Example #1
0
                      metavar='QUALITY',
                      dest='DEEPZOOM_TILE_QUALITY',
                      type='int',
                      help='JPEG compression quality [75]')
    parser.add_option('-s',
                      '--size',
                      metavar='PIXELS',
                      dest='DEEPZOOM_TILE_SIZE',
                      type='int',
                      help='tile size [254]')

    (opts, args) = parser.parse_args()
    # Load config file if specified
    if opts.config is not None:
        app.config.from_pyfile(opts.config)
    # Overwrite only those settings specified on the command line
    for k in dir(opts):
        if not k.startswith('_') and getattr(opts, k) is None:
            delattr(opts, k)
    app.config.from_object(opts)
    # Set slide file
    try:
        app.config['DEEPZOOM_SLIDE'] = args[0]
    except IndexError:
        app.config['DEEPZOOM_SLIDE'] = 'D:/3969.svs'

    sch = Scheduler(360, clearSlides)
    sch.start()
    app.run(host=opts.host, port=opts.port, threaded=True)
    sch.stop()
Example #2
0
                Post=Post,
                Comment=Comment,
                Todolist=Todolist)


@app.cli.command()
def seed():
    superadmin = User(name='admin',
                      username='******',
                      email='*****@*****.**',
                      role_id=2,
                      confirmed=1,
                      locale='zh',
                      location='default')
    superadmin.password = '******'
    superadmin.avatar_hash = superadmin.gravatar_hash()
    db.session.add(superadmin)
    db.session.commit()


if __name__ == '__main__':
    scheduler = Scheduler(5, port)
    scheduler.start()
    app.run()
    scheduler.stop()

scheduler = Scheduler(5, port)
scheduler.start()
app.run()
scheduler.stop()