Python flask_script 模块,Command() 实例源码

我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用flask_script.Command()

项目:MATL-Online    作者:suever    | 项目源码 | 文件源码
def refresh_releases():
    """Command for updating all release information."""
    matl.refresh_releases()
项目:MATL-Online    作者:suever    | 项目源码 | 文件源码
def get_options(self):
        """Command line options."""
        return (
            Option('-f', '--fix-imports',
                   action='store_true', dest='fix_imports', default=False,
                   help='Fix imports using isort, before linting'),
        )
项目:MATL-Online    作者:suever    | 项目源码 | 文件源码
def run(port=5000, host='127.0.0.1'):
    """Command for creating an eventlet instance."""
    socketio.run(app, host=host, port=int(port), use_reloader=True)
项目:grove    作者:jaredthecoder    | 项目源码 | 文件源码
def get_options(self):
        """Command line options."""
        return (
            Option('-f', '--fix-imports', action='store_true',
                   dest='fix_imports', default=False,
                   help='Fix imports using isort, before linting'),
        )
项目:flask-pw    作者:klen    | 项目源码 | 文件源码
def manager(self):
        """Integrate a Flask-Script."""
        from flask_script import Manager, Command

        manager = Manager(usage="Migrate database.")
        manager.add_command('create', Command(self.cmd_create))
        manager.add_command('migrate', Command(self.cmd_migrate))
        manager.add_command('rollback', Command(self.cmd_rollback))
        manager.add_command('list', Command(self.cmd_list))
        manager.add_command('merge', Command(self.cmd_merge))

        return manager
项目:cookiecutter-flask-seed-minimal    作者:hypebeast    | 项目源码 | 文件源码
def get_options(self):
        """Command line options."""
        return (
            Option('-f', '--fix-imports', action='store_true', dest='fix_imports', default=False,
                   help='Fix imports using isort, before linting'),
        )