18 lines
731 B
Python
18 lines
731 B
Python
#!/usr/bin/python
|
|
|
|
|
|
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('<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>', '<script src="http://cdn.bootcss.com/ace/1.1.3/ace.js"></script>').replace('<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>', '<script src="http://cdn.bootcss.com/ace/1.1.3/mode-javascript.js"></script>')
|
|
with open(root + '/' + fn, 'w') as f:
|
|
f.write(content)
|
|
|
|
iter(os.getcwd())
|