Update Appdata XML and add screenshot (#2229)

This commit is contained in:
Veronica Berglyd Olsen
2025-02-05 16:31:56 +01:00
committed by GitHub
parent 85b953bbec
commit 589bc7c313
4 changed files with 33 additions and 25 deletions
+3 -6
View File
@@ -27,8 +27,8 @@ import subprocess
import sys
from utils.common import (
ROOT_DIR, SETUP_DIR, copyPackageFiles, copySourceCode, extractVersion,
makeCheckSum, readFile, toUpload, writeFile
ROOT_DIR, SETUP_DIR, appdataXml, copyPackageFiles, copySourceCode,
extractVersion, makeCheckSum, toUpload, writeFile
)
@@ -113,10 +113,7 @@ def appImage(args: argparse.Namespace) -> None:
# Write Metadata
# ==============
appDescription = readFile(SETUP_DIR / "description_short.txt")
appdataXML = readFile(SETUP_DIR / "novelwriter.appdata.xml")
appdataXML = appdataXML.format(description=appDescription)
writeFile(imgDir / "novelwriter.appdata.xml", appdataXML)
writeFile(imgDir / "novelwriter.appdata.xml", appdataXml())
print("Wrote: novelwriter.appdata.xml")
writeFile(imgDir / "entrypoint.sh", (
+9
View File
@@ -172,6 +172,15 @@ def checkAssetsExist() -> bool:
return hasSample and hasManual and hasQmData
def appdataXml() -> str:
"""Generate the appdata XML content."""
raw = readFile(SETUP_DIR / "description_short.txt")
desc = " ".join(raw.strip().splitlines()).strip()
xml = readFile(SETUP_DIR / "novelwriter.appdata.xml")
xml = xml.format(description=desc)
return xml
def readFile(file: Path) -> str:
"""Read an entire file and return as a string."""
return file.read_text(encoding="utf-8")