run_migration.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Citation-Fetcher 作者: andrewhead 项目源码 文件源码
def configure_parser(parser):

    parser.description = "Run a migration script. These can only be run forward, not in reverse."

    # Inspect the local directory for which migration modules the user can run.
    local_files = os.listdir(
        os.path.dirname(
            inspect.getfile(
                inspect.currentframe()
            )))
    migration_files = [f for f in local_files if re.match('^\d{4}.*\.py$', f)]
    migration_names = [m.rstrip('.py') for m in migration_files]

    parser.add_argument(
        'migration_name',
        choices=migration_names,
        help="The name of the migration script you want to run."
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号