diff options
Diffstat (limited to 'compile.py')
-rw-r--r-- | compile.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -6,7 +6,7 @@ import datetime | |||
6 | 6 | ||
7 | # It removes script and style tags and replaces with the file content. | 7 | # It removes script and style tags and replaces with the file content. |
8 | 8 | ||
9 | f = open('src/index.html') | 9 | f = open('src/index.html', "r", encoding="utf-8") |
10 | page = f.read() | 10 | page = f.read() |
11 | f.close() | 11 | f.close() |
12 | 12 | ||
@@ -18,7 +18,7 @@ scripts = scriptsFinder.findall(page) | |||
18 | 18 | ||
19 | for script in scripts: | 19 | for script in scripts: |
20 | filename = os.path.join("src", script) | 20 | filename = os.path.join("src", script) |
21 | s = open(filename) | 21 | s = open(filename, "r", encoding="utf-8") |
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 |
@@ -32,7 +32,7 @@ styles = stylesFinder.findall(page) | |||
32 | 32 | ||
33 | for style in styles: | 33 | for style in styles: |
34 | filename = os.path.join("src", style) | 34 | filename = os.path.join("src", style) |
35 | s = open(filename) | 35 | s = open(filename, "r", encoding="utf-8") |
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 |
@@ -41,7 +41,7 @@ for style in styles: | |||
41 | 41 | ||
42 | # Write the standalone file | 42 | # Write the standalone file |
43 | 43 | ||
44 | f = open('bip39-standalone.html', 'w') | 44 | f = open('bip39-standalone.html', 'w', encoding="utf-8") |
45 | f.write(page) | 45 | f.write(page) |
46 | f.close() | 46 | f.close() |
47 | 47 | ||