Fixed indentation (w). Probably fixed redactions sometimes displaying viewing user's name in place of actor's name. Fixed room history never loading sometimes (but not missing chunks in the middle yet).
This commit is contained in:
@@ -2,31 +2,31 @@ import json
|
||||
import yaml
|
||||
|
||||
with open("moment.flatpak.base.yaml") as f:
|
||||
base = yaml.load(f, Loader=yaml.FullLoader)
|
||||
base = yaml.load(f, Loader=yaml.FullLoader)
|
||||
|
||||
with open("flatpak-pip.json") as f:
|
||||
modules = json.load(f)["modules"]
|
||||
modules = json.load(f)["modules"]
|
||||
|
||||
# set some modules in front as dependencies and dropping matrix-nio
|
||||
# which is declared separately
|
||||
front = []
|
||||
back = []
|
||||
for m in modules:
|
||||
n = m["name"]
|
||||
if n.startswith("python3-") and \
|
||||
n[len("python3-"):] in ["cffi", "importlib-metadata", "multidict", "pytest-runner", "setuptools-scm"]:
|
||||
front.append(m)
|
||||
else:
|
||||
back.append(m)
|
||||
n = m["name"]
|
||||
if n.startswith("python3-") and \
|
||||
n[len("python3-"):] in ["cffi", "importlib-metadata", "multidict", "pytest-runner", "setuptools-scm"]:
|
||||
front.append(m)
|
||||
else:
|
||||
back.append(m)
|
||||
|
||||
# replace placeholder with modules
|
||||
phold = None
|
||||
for i in range(len(base["modules"])):
|
||||
if base["modules"][i]["name"] == "PLACEHOLDER PYTHON DEPENDENCIES":
|
||||
phold = i
|
||||
break
|
||||
if base["modules"][i]["name"] == "PLACEHOLDER PYTHON DEPENDENCIES":
|
||||
phold = i
|
||||
break
|
||||
|
||||
base["modules"] = base["modules"][:i] + front + back + base["modules"][i+1:]
|
||||
|
||||
with open("moment.flatpak.yaml", "w") as f:
|
||||
f.write(yaml.dump(base, sort_keys=False, indent=2))
|
||||
f.write(yaml.dump(base, sort_keys=False, indent=2))
|
||||
|
@@ -4,29 +4,29 @@ import html
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
root = Path(__file__).resolve().parent.parent
|
||||
title_pattern = re.compile(r"## (\d+\.\d+\.\d+) \((\d{4}-\d\d-\d\d)\)")
|
||||
release_lines = [" <releases>"]
|
||||
|
||||
for line in (root / "docs" / "CHANGELOG.md").read_text().splitlines():
|
||||
match = title_pattern.match(line)
|
||||
match = title_pattern.match(line)
|
||||
|
||||
if match:
|
||||
args = (html.escape(match.group(1)), html.escape(match.group(2)))
|
||||
release_lines.append(' <release version="%s" date="%s"/>' % args)
|
||||
if match:
|
||||
args = (html.escape(match.group(1)), html.escape(match.group(2)))
|
||||
release_lines.append(' <release version="%s" date="%s"/>' % args)
|
||||
|
||||
appdata = root / "packaging" / "moment.metainfo.xml"
|
||||
appdata = root / "packaging" / "moment.metainfo.xml"
|
||||
in_releases = False
|
||||
final_lines = []
|
||||
|
||||
for line in appdata.read_text().splitlines():
|
||||
if line == " <releases>":
|
||||
in_releases = True
|
||||
final_lines += release_lines
|
||||
elif line == " </releases>":
|
||||
in_releases = False
|
||||
if line == " <releases>":
|
||||
in_releases = True
|
||||
final_lines += release_lines
|
||||
elif line == " </releases>":
|
||||
in_releases = False
|
||||
|
||||
if not in_releases:
|
||||
final_lines.append(line)
|
||||
if not in_releases:
|
||||
final_lines.append(line)
|
||||
|
||||
appdata.write_text("\n".join(final_lines))
|
||||
|
Reference in New Issue
Block a user