diff options
Diffstat (limited to 'compile.py')
-rw-r--r-- | compile.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -13,7 +13,7 @@ f.close() | |||
13 | 13 | ||
14 | # Script tags | 14 | # Script tags |
15 | 15 | ||
16 | scriptsFinder = re.compile("""<script src="/(.*)"></script>""") | 16 | scriptsFinder = re.compile("""<script src="(.*)"></script>""") |
17 | scripts = scriptsFinder.findall(page) | 17 | scripts = scriptsFinder.findall(page) |
18 | 18 | ||
19 | for script in scripts: | 19 | for script in scripts: |
@@ -21,13 +21,13 @@ for script in scripts: | |||
21 | s = open(filename) | 21 | s = open(filename) |
22 | scriptContent = "<script>%s</script>" % s.read() | 22 | scriptContent = "<script>%s</script>" % s.read() |
23 | s.close() | 23 | s.close() |
24 | scriptTag = """<script src="/%s"></script>""" % script | 24 | scriptTag = """<script src="%s"></script>""" % script |
25 | page = page.replace(scriptTag, scriptContent) | 25 | page = page.replace(scriptTag, scriptContent) |
26 | 26 | ||
27 | 27 | ||
28 | # Style tags | 28 | # Style tags |
29 | 29 | ||
30 | stylesFinder = re.compile("""<link rel="stylesheet" href="/(.*)">""") | 30 | stylesFinder = re.compile("""<link rel="stylesheet" href="(.*)">""") |
31 | styles = stylesFinder.findall(page) | 31 | styles = stylesFinder.findall(page) |
32 | 32 | ||
33 | for style in styles: | 33 | for style in styles: |
@@ -35,7 +35,7 @@ for style in styles: | |||
35 | s = open(filename) | 35 | s = open(filename) |
36 | styleContent = "<style>%s</style>" % s.read() | 36 | styleContent = "<style>%s</style>" % s.read() |
37 | s.close() | 37 | s.close() |
38 | styleTag = """<link rel="stylesheet" href="/%s">""" % style | 38 | styleTag = """<link rel="stylesheet" href="%s">""" % style |
39 | page = page.replace(styleTag, styleContent) | 39 | page = page.replace(styleTag, styleContent) |
40 | 40 | ||
41 | 41 | ||