slowminify.py 文件源码

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

项目:site 作者: alphageek-xyz 项目源码 文件源码
def _minify(self, extension):
        for root, dirs, files in os.walk(settings.STATIC_ROOT):
            for f in files:
                path = os.path.join(root, f)
                if path.endswith(extension):
                    if getattr(self, 'dry_run', False):
                        print('[dry run] skipping minifying ' + path + '...')
                        continue
                    mini = getoutput('yui-compressor ' + path)
                    print('minifying "' + path + '" ... ', end='')
                    with open(path, 'w') as p:
                        p.write(mini)
                    print('done')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号