#!/usr/bin/env python # -*- coding: utf-8 -*- """C-2a-4a 补丁: 1. gate-lock.vue L126 .reward-text on-dark 文字 rgba(143,197,232,0.5) -> rgba(251,146,60,0.5) 2. 执行首跑中断后未完成的两个文件(FamilyRelationGraph / DimensionArticles) """ import io import sys ORANGE = '$brand-primary' ORANGE_LIGHT = '$brand-primary-light' RESIDUAL_RE = __import__('re').compile( r'(? %s x%d' % (old, new, n)) for old, new, expect in script: n = src.count(old) if n != expect: raise RuntimeError('%s: 脚本区 %s hit=%d(要求 %d)' % (page, old, n, expect)) src = src.replace(old, new) print(' [script] %-44s -> %s x%d' % (old, new, n)) io.open(page, 'w', encoding='utf-8', newline='').write(src) residual = RESIDUAL_RE.findall(src) + RESIDUAL_RGBA.findall(src) if residual: raise RuntimeError('%s: 终检残留 %s' % (page, residual)) print('C-2a-4a 补丁完毕') if __name__ == '__main__': sys.exit(main())