diff options
| -rw-r--r-- | BuildTools/SCons/Tools/WindowsBundle.py | 8 | ||||
| -rw-r--r-- | BuildTools/SCons/Tools/wix.py | 5 | ||||
| -rw-r--r-- | Swift/QtUI/SConscript | 12 |
3 files changed, 19 insertions, 6 deletions
diff --git a/BuildTools/SCons/Tools/WindowsBundle.py b/BuildTools/SCons/Tools/WindowsBundle.py index 4d73fa3..9781deb 100644 --- a/BuildTools/SCons/Tools/WindowsBundle.py +++ b/BuildTools/SCons/Tools/WindowsBundle.py | |||
| @@ -33,9 +33,13 @@ def generate(env) : | |||
| 33 | 33 | ||
| 34 | mappings = [] | 34 | mappings = [] |
| 35 | 35 | ||
| 36 | p = re.compile(r'"([^\"]*)" "([^\"]*)"') | 36 | regex = re.compile(r'"([^\"]*)" "([^\"]*)"') |
| 37 | |||
| 38 | if SCons.Util.PY3: | ||
| 39 | matches = re.findall(regex, stdout.decode('utf8')) | ||
| 40 | else: | ||
| 41 | matches = re.findall(regex, stdout) | ||
| 37 | 42 | ||
| 38 | matches = re.findall(p, stdout) | ||
| 39 | for match in matches: | 43 | for match in matches: |
| 40 | mappings.append(match) | 44 | mappings.append(match) |
| 41 | return mappings | 45 | return mappings |
diff --git a/BuildTools/SCons/Tools/wix.py b/BuildTools/SCons/Tools/wix.py index 889afe4..986ea23 100644 --- a/BuildTools/SCons/Tools/wix.py +++ b/BuildTools/SCons/Tools/wix.py | |||
| @@ -15,7 +15,10 @@ def generate(env) : | |||
| 15 | 15 | ||
| 16 | def WiX_IncludeScanner(source, env, path, arg): | 16 | def WiX_IncludeScanner(source, env, path, arg): |
| 17 | wixIncludeRegexp = re.compile(r'^\s*\<\?include (\S+.wxs)\s*\?\>\S*', re.M) | 17 | wixIncludeRegexp = re.compile(r'^\s*\<\?include (\S+.wxs)\s*\?\>\S*', re.M) |
| 18 | contents = source.get_contents() | 18 | if SCons.Util.PY3: |
| 19 | contents = source.get_contents().decode("utf8") | ||
| 20 | else: | ||
| 21 | contents = source.get_contents() | ||
| 19 | includes = wixIncludeRegexp.findall(contents) | 22 | includes = wixIncludeRegexp.findall(contents) |
| 20 | return [ "" + include for include in includes ] | 23 | return [ "" + include for include in includes ] |
| 21 | 24 | ||
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 584cfea..96979c0 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | import os, datetime, re, time | 1 | import os, datetime, re, time |
| 2 | import Version | 2 | import Version |
| 3 | import SCons.Util | ||
| 3 | 4 | ||
| 4 | def generateQRCTheme(dir, prefix) : | 5 | def generateQRCTheme(dir, prefix) : |
| 5 | sourceDir = dir.abspath | 6 | sourceDir = dir.abspath |
| @@ -475,11 +476,16 @@ if env["PLATFORM"] == "win32" : | |||
| 475 | #myenv.Nsis("../Packaging/nsis/swift.nsi") | 476 | #myenv.Nsis("../Packaging/nsis/swift.nsi") |
| 476 | if env["SCONS_STAGE"] == "build" and env.get("wix_bindir", None): | 477 | if env["SCONS_STAGE"] == "build" and env.get("wix_bindir", None): |
| 477 | def convertToRTF(env, target, source) : | 478 | def convertToRTF(env, target, source) : |
| 478 | infile = open(source[0].abspath, 'r') | 479 | if SCons.Util.PY3: |
| 479 | outfile = open(target[0].abspath, 'w') | 480 | infile = open(source[0].abspath, 'r', encoding="utf8") |
| 481 | outfile = open(target[0].abspath, 'w', encoding="utf8") | ||
| 482 | else: | ||
| 483 | infile = open(source[0].abspath, 'r') | ||
| 484 | outfile = open(target[0].abspath, 'w') | ||
| 480 | outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\fs16\\f0\\pard\n') | 485 | outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\fs16\\f0\\pard\n') |
| 481 | for line in infile: | 486 | for line in infile: |
| 482 | for char in line.decode("utf-8") : | 487 | line = line if SCons.Util.PY3 else line.decode("utf-8") |
| 488 | for char in line : | ||
| 483 | if ord(char) > 127 : | 489 | if ord(char) > 127 : |
| 484 | # FIXME: This is incorrect, because it only works for latin1. | 490 | # FIXME: This is incorrect, because it only works for latin1. |
| 485 | # The correct way is \u<decimal utf16 point>? , but this is more | 491 | # The correct way is \u<decimal utf16 point>? , but this is more |
Swift