diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-05-05 11:58:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-05-06 20:42:22 +0200 |
| commit | 6cb1beea8357e5a0669166d50ba106fb8cac7064 (patch) | |
| tree | df84d7a9c93f0f8e7492e1d1106d1c1ed6af4fc8 | |
| parent | 330da8967d8ae6366f1992f691e1f472351cfa67 (diff) | |
Remove use of f-strings in wscripts
Various Linux build environments have a python that is too old.
| -rw-r--r-- | platform/windows/wscript | 30 | ||||
| -rw-r--r-- | src/tools/wscript | 30 |
2 files changed, 30 insertions, 30 deletions
diff --git a/platform/windows/wscript b/platform/windows/wscript index 9ddffca45..2f0bf2c22 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -21,7 +21,7 @@ def verifier_name(variant): return 'Verifier' def tool_name(variant, debug, tool): - name = f'DCP-o-matic 2 {tool}' + name = 'DCP-o-matic 2 %s' % tool if debug: name += ' debug' return name @@ -32,7 +32,7 @@ def start_menu_shortcut(file, link, target, variant, debug=False): folder = start_menu_shortcut_folder(variant) if debug: folder += ' debug' - print(f'CreateShortCut "$SMPROGRAMS\\{folder}\\{link}.lnk" "$INSTDIR\\{target}"', file=file) + print('CreateShortCut "$SMPROGRAMS\\%s\\%s.lnk" "$INSTDIR\\%s"' % (folder, link, target), file=file) def write_installer(bits, dcpomatic_version, debug, disk, variant): @@ -72,11 +72,11 @@ def write_installer(bits, dcpomatic_version, debug, disk, variant): if bits == 64: print('!include "x64.nsh"', file=f) - print(f'Name "{short_name_with_debug}"', file=f) + print('Name "%s"' % short_name_with_debug, file=f) print('RequestExecutionLevel admin', file=f) print('Unicode true', file=f) - outfile = f'{short_name_with_debug} {dcpomatic_version} {bits}-bit Installer.exe' + outfile = '%s %s %d-bit Installer.exe' % (short_name_with_debug, dcpomatic_version, bits) print('outFile "%s"' % outfile, file=f) print(""" @@ -91,7 +91,7 @@ def write_installer(bits, dcpomatic_version, debug, disk, variant): else: program_files = "$PROGRAMFILES" - print(f'InstallDir "%s\\{long_name_with_debug}"' % program_files, file=f) + print('InstallDir "%s\\%s"' % (program_files, long_name_with_debug), file=f) print(""" !insertmacro MUI_PAGE_WELCOME @@ -404,12 +404,12 @@ File "%cdist_deps%/share/libdcp/ratings" SectionEnd """, file=f) - print(f'Section "{long_name_with_debug}" SEC_MASTER', file=f) + print('Section "%s" SEC_MASTER' % long_name_with_debug, file=f) print('SetOutPath "$INSTDIR\\bin"', file=f) print("SetShellVarContext all", file=f) - print(f'CreateDirectory "$SMPROGRAMS\\{long_name_with_debug}"', file=f) + print('CreateDirectory "$SMPROGRAMS\\%s"' % long_name_with_debug, file=f) print('File "%binaries%/src/tools/dcpomatic2.exe"', file=f) for s, l in tools: @@ -422,19 +422,19 @@ File "%binaries%/src/tools/dcpomatic2_disk_writer.exe.manifest" """, file=f) suffix = '_debug.bat' if debug else '.exe' - start_menu_shortcut(f, long_name_with_debug, f'bin\\dcpomatic2{suffix}', variant, debug=True) + start_menu_shortcut(f, long_name_with_debug, 'bin\\dcpomatic2%s' % suffix, variant, debug=True) for s, l in tools: - start_menu_shortcut(f, tool_name(variant, debug, l), f'bin\\dcpomatic2_{s}{suffix}', variant, debug=True) - start_menu_shortcut(f, f'Uninstall {long_name_with_debug}', 'Uninstall.exe', variant, debug=True) - print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "DisplayName" "{long_name_with_debug} (remove only)"', file=f) - print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f) + start_menu_shortcut(f, tool_name(variant, debug, l), 'bin\\dcpomatic2_%s%s' % (s, suffix), variant, debug=True) + start_menu_shortcut(f, 'Uninstall %s' % long_name_with_debug, 'Uninstall.exe', variant, debug=True) + print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s" "DisplayName" "%s (remove only)"' % (long_name_with_debug, long_name_with_debug), file=f) + print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s" "UninstallString" "$INSTDIR\\Uninstall.exe"' % long_name_with_debug, file=f) print("SectionEnd", file=f) - print(f'Section "{long_name_with_debug} desktop shortcuts" SEC_MASTER_DESKTOP', file=f) - print(f'CreateShortCut "$DESKTOP\\{long_name_with_debug}.lnk" "$INSTDIR\\bin\\dcpomatic2{suffix}" ""', file=f) + print('Section "%s desktop shortcuts" SEC_MASTER_DESKTOP' % long_name_with_debug, file=f) + print('CreateShortCut "$DESKTOP\\%s.lnk" "$INSTDIR\\bin\\dcpomatic2%s" ""' % (long_name_with_debug, suffix), file=f) for s, l in tools: - print(f'CreateShortCut "$DESKTOP\\{tool_name(variant, debug, l)}.lnk" "$INSTDIR\\bin\\dcpomatic2_{s}{suffix}" ""', file=f) + print('CreateShortCut "$DESKTOP\\%s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s%s" ""' % (tool_name(variant, debug, l), s, suffix), file=f) print("SectionEnd", file=f) diff --git a/src/tools/wscript b/src/tools/wscript index 5375ae430..7d03bab62 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -38,7 +38,7 @@ def description(tool, variant): def make_rc(tool, icon, variant): - filename = f'build/src/tools/{tool}.rc' + filename = 'build/src/tools/%s.rc' % tool with open(filename, 'w') as rc: if tool == 'dcpomatic_disk_writer': print('#include "winuser.h"', file=rc) @@ -58,8 +58,8 @@ def make_rc(tool, icon, variant): </trustInfo> </assembly>""", file=manifest) else: - print(f""" -id ICON "../../graphics/windows/{icon}" + print(""" +id ICON "../../graphics/windows/%s" #include "wx-3.1/wx/msw/wx.rc" VS_VERSION_INFO VERSIONINFO FILEVERSION 0,0,0,2 @@ -73,20 +73,20 @@ VS_VERSION_INFO VERSIONINFO FILEOS 0x4L FILETYPE 0x1L FILESUBTYPE 0x0L -{{ + { BLOCK "StringFileInfo" - {{ + { BLOCK "040904b0" - {{ - VALUE "FileDescription", "{description(tool, variant)}\\0" - }} - }} + { + VALUE "FileDescription", "%s\\0" + } + } BLOCK "VarFileInfo" - {{ + { VALUE "Translation", 0x409, 1200 - }} -}} - """, file=rc) + } + } + """ % (icon, description(tool, variant)), file=rc) return filename def configure(conf): @@ -125,7 +125,7 @@ def build(bld): obj.use = ['libdcpomatic2'] obj.source = '%s.cc' % t if (bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32) and t == 'dcpomatic_disk_writer': - obj.source += f' ../../{make_rc(t, None, bld.env.VARIANT)}' + obj.source += ' ../../%s' % (make_rc(t, None, bld.env.VARIANT)) # Prevent a console window opening when we start dcpomatic2_disk_writer obj.env.append_value('LINKFLAGS', '-Wl,-subsystem,windows') obj.target = t.replace('dcpomatic', 'dcpomatic2') @@ -162,7 +162,7 @@ def build(bld): obj.use = ['libdcpomatic2', 'libdcpomatic2-wx'] obj.source = '%s.cc' % t if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32: - obj.source += f' ../../{make_rc(t, t.replace("dcpomatic", "dcpomatic2") + ".ico", bld.env.VARIANT)}' + obj.source += ' ../../%s' % make_rc(t, t.replace("dcpomatic", "dcpomatic2") + ".ico", bld.env.VARIANT) obj.target = t.replace('dcpomatic', 'dcpomatic2') i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld) |
