Skip to content

Commit 017f94a

Browse files
authored
Merge branch 'main' into dependabot/github_actions/peaceiris/actions-gh-pages-4
2 parents bf0aa7d + e57f274 commit 017f94a

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/mxmake/helpgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def print_help(makefile: pathlib.Path):
4444
)
4545
sys.stdout.write("\n\nTARGETS\n\n")
4646
for target in domain.targets:
47-
sys.stdout.write(f"{idnt*lvl}{target.name}\n")
47+
sys.stdout.write(f"{idnt * lvl}{target.name}\n")
4848
if help_domain:
4949
lvl += 1
5050
found = True
@@ -65,7 +65,7 @@ def print_help(makefile: pathlib.Path):
6565
for setting in domain.settings:
6666
fqn_setting = f"{domain.fqn}.{setting.name}"
6767
sys.stdout.write(
68-
f"{idnt*lvl}{setting.name}={parser.settings.get(fqn_setting) or '<not set>'}\n"
68+
f"{idnt * lvl}{setting.name}={parser.settings.get(fqn_setting) or '<not set>'}\n"
6969
)
7070
sys.stdout.write(
7171
"\n".join(

src/mxmake/templates.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ def template_variables(self) -> typing.Dict[str, typing.Any]:
353353
if domain.fqn == "applications.plone":
354354
template = dict(
355355
name="plone-site",
356-
settings=dict(distribution="volto", extension_ids="plone.volto:default"),
356+
settings=dict(
357+
distribution="volto", extension_ids="plone.volto:default"
358+
),
357359
)
358360
mxmake_templates.append(template)
359361
return dict(mxmake_templates=mxmake_templates, mxmake_env=mxmake_env)
@@ -514,15 +516,17 @@ def template_variables(self):
514516
site.setdefault("setup_content", False)
515517
site.setdefault("default_language", "en")
516518
site.setdefault("portal_timezone", "UTC")
517-
site.setdefault("extension_ids", "")
518519
site.update(**self.settings)
519520
if "distribution" in site:
520521
vars["distribution"] = site.pop("distribution")
521522

522523
# handle extension ids
523-
site["extension_ids"] = [
524-
eid.strip() for eid in site["extension_ids"].split("\n") if eid.strip()
525-
]
524+
if site.get("extension_ids", None) is not None:
525+
site["extension_ids"] = [
526+
eid.strip() for eid in site["extension_ids"].split("\n") if eid.strip()
527+
]
528+
else:
529+
site["extension_ids"] = []
526530
return vars
527531

528532

src/mxmake/tests/test_hook.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ class TestHook(unittest.TestCase):
1010
def test_Hook(self, tempdir):
1111
mxini = tempdir / "mx.ini"
1212
with mxini.open("w") as fd:
13-
fd.write(
14-
"[settings]\n" "mxmake-templates = run-tests run-coverage inexistent"
15-
)
13+
fd.write("[settings]\nmxmake-templates = run-tests run-coverage inexistent")
1614

1715
hook_ = hook.Hook()
1816
configuration = mxdev.Configuration(mxini, hooks=[hook_])

src/mxmake/tests/test_templates.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ def test_MxIni(self, tempdir):
820820
# VAR = value
821821
822822
[mxmake-plone-site]
823-
distribution = default
823+
distribution = volto
824+
extension_ids = plone.volto:default
824825
825826
[mxmake-run-coverage]
826827
environment = env
@@ -850,7 +851,7 @@ def test_PloneSite_all_defaults(self, tempdir):
850851
{
851852
"site": {
852853
"default_language": "en",
853-
"extension_ids": ["plone.volto:default"],
854+
"extension_ids": [],
854855
"portal_timezone": "UTC",
855856
"setup_content": False,
856857
"site_id": "Plone",
@@ -902,9 +903,6 @@ def asbool(value: str | bool | None) -> bool:
902903
"setup_content": "False",
903904
"default_language": "en",
904905
"portal_timezone": "UTC",
905-
"extension_ids": [
906-
"plone.volto:default",
907-
],
908906
"profile_id": _DEFAULT_PROFILE,
909907
}
910908
config["setup_content"] = asbool(config["setup_content"])

0 commit comments

Comments
 (0)