From 9a6f016f458b6b2d0a2b2a0b700c4518d3c85f5b Mon Sep 17 00:00:00 2001 From: Jie Liang Date: Wed, 26 Jun 2019 11:16:11 -0500 Subject: [PATCH] Delete change_cdn.py --- change_cdn.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 change_cdn.py diff --git a/change_cdn.py b/change_cdn.py deleted file mode 100755 index 9842e4c7..00000000 --- a/change_cdn.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python -# coding:utf-8 - - -import os - - -def iter(path): - for root, dirs, files in os.walk(path): - for fn in files: - if fn.endswith(".html"): - with open(root + '/' + fn, 'r') as f: - content = f.read() - content = content.replace('', '').replace('', '') - insert_pos = content.find("", content.find("Generated using GitBook")) + 6 - content = content[:insert_pos] + '''
  • ''' + content[insert_pos:] - content.replace(r'.*?', "《The Swift Programming Language》完整中文版") - with open(root + '/' + fn, 'w') as f: - f.write(content) - -iter(os.getcwd())