Compare commits

...

6 Commits

Author SHA1 Message Date
33ebafbf96 Merge pull request 'fix/xmllist-updates' (#4983) from fix/xmllist-updates into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4983
2025-04-25 12:48:00 +00:00
Darragh Elliott
88eb4f3dfa fix: do not regenerate localmenus every time
All checks were successful
continuous-integration/drone/pr Build is passing
2025-04-25 13:40:30 +01:00
Darragh Elliott
6431434609 fix: match xmllist lines properly 2025-04-25 13:18:54 +01:00
Darragh Elliott
0d9b516ca2 fix: disable full builds
All checks were successful
continuous-integration/drone/pr Build is passing
Should no longer be needed, as we know update by xmllist correctly
2025-04-25 12:28:14 +01:00
Darragh Elliott
bafcb245f3 chore: run formatters 2025-04-25 12:24:18 +01:00
Darragh Elliott
8178e1ba52 fix: incorrect paths for xmllists 2025-04-25 12:23:59 +01:00
5 changed files with 22 additions and 12 deletions

View File

@ -29,6 +29,6 @@ RUN pip install -r /website-source/requirements.txt
COPY . /website-source/
WORKDIR /website-source
ENTRYPOINT [ "bash", "./entrypoint.sh", "--full" ]
ENTRYPOINT [ "bash", "./entrypoint.sh" ]

View File

@ -11,7 +11,10 @@ from urllib.parse import urlparse
logger = logging.getLogger(__name__)
raw_url = urlparse("https://git.fsfe.org/FSFE/activities/raw/branch/master/activities.csv")
raw_url = urlparse(
"https://git.fsfe.org/FSFE/activities/raw/branch/master/activities.csv"
)
def create_activities_file():
git_token = os.environ.get("GIT_TOKEN")
@ -41,7 +44,7 @@ def create_activities_file():
if event:
activities += f' data-event="{event}"'
activities += '>'
activities += ">"
activities += f"{tag} ({description})"
activities += "</option>\n"

View File

@ -8,7 +8,7 @@ from pathlib import Path
import lxml.etree as etree
from build.lib.misc import get_basepath
from build.lib.misc import get_basepath, update_if_changed
logger = logging.getLogger(__name__)
@ -71,7 +71,10 @@ def _write_localmenus(
),
).text = localmenu.text
page.getroottree().write(file, xml_declaration=True, encoding="utf-8")
update_if_changed(
file,
etree.tostring(page, encoding="utf-8").decode("utf-8"),
)
def update_localmenus(languages: list[str], pool: multiprocessing.Pool) -> None:

View File

@ -127,7 +127,7 @@ def _check_xmllist_deps(file: Path) -> None:
xmls = set()
with file.open(mode="r") as fileobj:
for line in fileobj:
for newfile in Path("").glob(line + ".??.xml"):
for newfile in Path("").glob(line.strip() + ".??.xml"):
xmls.add(newfile)
touch_if_newer_dep(file, list(xmls))

View File

@ -36,7 +36,11 @@ def _process_dir(languages: list[str], target: Path, dir: Path) -> None:
else basename.with_suffix(".en.xhtml")
),
processor,
target_file.with_suffix("").with_suffix(".xmllist"),
(
source_file.parent.joinpath(
"." + basename.name
).with_suffix(".xmllist")
),
Path(f"global/data/texts/.texts.{lang}.xml"),
Path(f"global/data/topbanner/.topbanner.{lang}.xml"),
Path("global/data/texts/texts.en.xml"),