Created
March 26, 2013 12:00
-
-
Save jineshpaloor/5244883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fileinput | |
import glob | |
import sys | |
html_file_tpl = '/home/jinesh/Downloads/JSCover-0.2.6/output/javascript/testrunners/*.html' | |
searchExp = '/static/' | |
replaceExp = '../../' | |
def replace_static(html_file): | |
for line in fileinput.input(html_file, inplace=1): | |
if searchExp in line: | |
line = line.replace(searchExp,replaceExp) | |
sys.stdout.write(line) | |
def main(): | |
html_files = glob.glob(html_file_tpl) | |
for html_file in html_files: | |
replace_static(html_file) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment