Revision: 28756 http://sourceforge.net/p/bibdesk/svn/28756 Author: hofman Date: 2024-02-17 17:17:37 +0000 (Sat, 17 Feb 2024) Log Message: ----------- use format strings
Modified Paths: -------------- trunk/bibdesk/build_release.py Modified: trunk/bibdesk/build_release.py =================================================================== --- trunk/bibdesk/build_release.py 2024-02-17 10:30:14 UTC (rev 28755) +++ trunk/bibdesk/build_release.py 2024-02-17 17:17:37 UTC (rev 28756) @@ -82,12 +82,12 @@ APPCAST_URL = "https://bibdesk.sourceforge.io/bibdesk.xml" # create a private temporary directory -BUILD_ROOT = os.path.join("/tmp", "BibDesk-%s" % (getuser())) +BUILD_ROOT = os.path.join("/tmp", f"BibDesk-(getuser())") try: # should already exist after the first run os.mkdir(BUILD_ROOT) except Exception as e: - assert os.path.isdir(BUILD_ROOT), "%s does not exist" % (BUILD_ROOT) + assert os.path.isdir(BUILD_ROOT), f"(BUILD_ROOT) does not exist" # derived paths SYMROOT = os.path.join(BUILD_ROOT, "Products") @@ -139,7 +139,7 @@ plistlib.dump(infoPlist, plistFile) with open(HELP_VERSION_PATH, "w", encoding="utf-8") as helpVersionFile: helpVersionFile.write("@set VERSION " + newVersion) - print("version string updated to %s" % (newVersion)) + print(f"version string updated to (newVersion)") def read_versions(): @@ -162,7 +162,7 @@ x = Popen(buildCmd, cwd=SOURCE_DIR) print(" ".join(buildCmd)) rc = x.wait() - print("xcodebuild clean exited with status %s" % (rc)) + print(f"xcodebuild clean exited with status (rc)") buildCmd = ["/usr/bin/xcodebuild", "-configuration", "Release", "-target", "BibDesk", "-scheme", "BibDesk", "-destination", "generic/platform=macOS", "-derivedDataPath", DERIVED_DATA_DIR, "SYMROOT=" + SYMROOT, "CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO"] print(" ".join(buildCmd)) @@ -178,7 +178,7 @@ print(" ".join(sign_cmd)) x = Popen(sign_cmd, cwd=SOURCE_DIR) rc = x.wait() - print("codesign_bibdesk.sh exited with status %s" % (rc)) + print(f"codesign_bibdesk.sh exited with status (rc)") assert rc == 0, "code signing failed" def notarize_archive(archive_path, password): @@ -187,7 +187,7 @@ print(" ".join(notarize_cmd)) x = Popen(notarize_cmd, cwd=SOURCE_DIR) rc = x.wait() - print("notarytool exited with status %s" % (rc)) + print(f"notarytool exited with status (rc)") assert rc == 0, "notarization failed" def create_dmg_of_application(new_version_number, create_new): @@ -215,11 +215,11 @@ dst_volume_name = "/Volumes/BibDesk" # see if this file already exists and bail - assert not os.path.exists(final_dmg_name), "%s exists" % (final_dmg_name) + assert not os.path.exists(final_dmg_name), f"(final_dmg_name) exists" # see if a volume is already mounted or a # previous cp operation was botched - assert not os.path.exists(dst_volume_name), "%s exists" % (dst_volume_name) + assert not os.path.exists(dst_volume_name), f"(dst_volume_name) exists" # stored zipped in svn, so unzip if needed # pass o to overwrite, or unzip waits for stdin @@ -229,7 +229,7 @@ print(" ".join(cmd)) x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) rc = x.wait() - assert rc == 0, "failed to unzip %s" % (zip_dmg_name) + assert rc == 0, f"failed to unzip (zip_dmg_name)" # mount image cmd = ["/usr/bin/hdiutil", "attach", "-nobrowse", "-noautoopen", temp_dmg_path] @@ -236,7 +236,7 @@ print(" ".join(cmd)) x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) rc = x.wait() - assert rc == 0, "failed to mount %s" % (temp_dmg_path) + assert rc == 0, f"failed to mount (temp_dmg_path)" # use cp to copy all files cmd = ["/bin/cp", "-R", BUILT_APP, dst_volume_name] @@ -243,7 +243,7 @@ print(" ".join(cmd)) x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) rc = x.wait() - assert rc == 0, "failed to copy %s" % (BUILT_APP) + assert rc == 0, f"failed to copy (BUILT_APP)" # tell finder to set the icon position cmd = ["/usr/bin/osascript", "-e", """tell application "Finder" to set the position of application file "BibDesk.app" of disk named "BibDesk" to {204, 148}"""] @@ -259,7 +259,7 @@ x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) rc = x.wait() while rc != 0: - assert n_tries < 12, "failed to eject %s" % (dst_volume_name) + assert n_tries < 12,f "failed to eject (dst_volume_name)" n_tries += 1 sleep(5) x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) @@ -272,7 +272,7 @@ size = x.communicate()[0].decode("ascii").split(None, 1)[0] cmd = ["/usr/bin/hdiutil", "resize", "-size", size + "b", temp_dmg_path] x = Popen(cmd, stdout=DEVNULL, stderr=DEVNULL) - assert rc == 0, "failed to resize %s" % (temp_dmg_path) + assert rc == 0, f"failed to resize (temp_dmg_path)" # convert image to read only and compress cmd = ["/usr/bin/hdiutil", "convert", temp_dmg_path, "-format", "UDZO", "-imagekey", "zlib-level=9", "-o", final_dmg_name] @@ -428,7 +428,7 @@ def write_appcast_and_release_notes(newVersion, newVersionString, minimumSystemVersion, archive_path, outputPath): - print("create Sparkle appcast for %s" % (archive_path)) + print(f"create Sparkle appcast for (archive_path)") signatureAndSize = signature_and_size(archive_path) download_url = "https://sourceforge.net/projects/bibdesk/files/BibDesk/BibDesk-" + newVersionString + "/" + os.path.basename(archive_path) + "/download" @@ -589,7 +589,7 @@ # probably already exists os.mkdirs(out) except Exception as e: - assert os.path.isdir(out), "%s does not exist" % (out) + assert os.path.isdir(out), f"(out) does not exist" if not test: write_appcast_and_release_notes(new_version, new_version_string, minimum_system_version, archive_path, out) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit