cat.py 文件源码

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

项目:cat 作者: neo1218 项目源码 文件源码
def upgrade(theme):
    """
    upgrade the theme
    """
    run_in_root(os.getcwd())
    theme_path = os.path.join(os.getcwd(), 'theme/%s' % theme)
    templates_path = os.path.join(theme_path, 'templates')
    templates_target_path = os.path.join(os.getcwd(), 'templates')
    static_path = os.path.join(theme_path, 'static')
    static_target_path = os.path.join(os.getcwd(), 'static')

    shutil.rmtree(templates_target_path)
    shutil.rmtree(static_target_path)
    shutil.copytree(templates_path, templates_target_path)
    shutil.copytree(static_path, static_target_path)

    logger.info('''
        \033[33m{info}\033[0m
        ==> upgrade the theme!
        '''
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号