Skip to content

Instantly share code, notes, and snippets.

@jineshpaloor
Created March 26, 2013 12:00
Show Gist options
  • Save jineshpaloor/5244883 to your computer and use it in GitHub Desktop.
Save jineshpaloor/5244883 to your computer and use it in GitHub Desktop.
#!/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