core.py 文件源码

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

项目:python-boilerplate 作者: fabiommendes 项目源码 文件源码
def rm(path, verbose=True):
    """
    Remove file or directory in path.
    """

    if os.path.exists(path):
        if verbose:
            print('removing', path, end=' ')

        if os.path.isdir(path):
            for base, files, dirs in os.walk(path):
                dirs_and_files = dirs + files
                for path in dirs_and_files:
                    path = os.path.join(base, path)
                    rm(path, verbose=False)
        else:
            os.unlink(path)

        if verbose:
            print('...done!')

# @task
# def lint(ctx):
#     """
#     Run the linter
#     """
#     print('not ready...')
#
#
# @task
# def diagnose(ctx):
#     print('not ready...')
#
#
# @task
# def publish(ctx):
#     print('not ready...')
#
#
# @task
# def release(ctx):
#     print('not ready...')
#
#
# @task
# def release_check(ctx):
#     print('not ready...')
#
#
# @task
# def http_serve(ctx):
#     print('not ready...')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号