Skip to content

Commit 849182f

Browse files
committed
make format
1 parent 26a636c commit 849182f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/mxmake/helpgen.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
from .topics import set_domain_runtime_depends
66

77
import os
8+
import pathlib
89
import sys
910
import textwrap
1011

1112

12-
def print_help(makefile: "pathlib.Path"):
13+
def print_help(makefile: pathlib.Path):
1314
"""Parse the Makefile and print the help."""
1415

1516
parser = MakefileParser(makefile)
@@ -30,9 +31,7 @@ def print_help(makefile: "pathlib.Path"):
3031
if help_domain and domain.name != help_domain:
3132
continue
3233
topic = get_topic(domain.topic)
33-
sys.stdout.write(
34-
f"DOMAIN '{domain.name}' (topic {topic.title})\n"
35-
)
34+
sys.stdout.write(f"DOMAIN '{domain.name}' (topic {topic.title})\n")
3635
sys.stdout.write(
3736
"\n".join(
3837
textwrap.wrap(
@@ -62,7 +61,7 @@ def print_help(makefile: "pathlib.Path"):
6261
sys.stdout.write("\n\n")
6362
lvl -= 1
6463
if help_domain:
65-
sys.stdout.write(f"ARGUMENTS\n\n")
64+
sys.stdout.write("ARGUMENTS\n\n")
6665
for setting in domain.settings:
6766
fqn_setting = f"{domain.fqn}.{setting.name}"
6867
sys.stdout.write(
@@ -82,12 +81,11 @@ def print_help(makefile: "pathlib.Path"):
8281
else:
8382
sys.stdout.write("\n\n")
8483

85-
8684
if not help_domain:
8785
sys.stdout.write("")
8886
sys.stdout.write(
8987
"Need detailed help by domain containing all information?\nRun:\n\n make help HELP_DOMAIN=<domain>\n"
9088
)
9189
elif not found:
9290
sys.stdout.write("No help found for requested domain st\n")
93-
sys.exit(1)
91+
sys.exit(1)

src/mxmake/templates.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -546,21 +546,18 @@ def target_folder(self) -> Path:
546546
def template_variables(self):
547547
targets = []
548548
for folder, proxy in self.settings.items():
549-
for item in [item.strip() for item in proxy.split('\n') if item.strip()]:
550-
topic_name, domain_names = item.split(':')
549+
for item in [item.strip() for item in proxy.split("\n") if item.strip()]:
550+
topic_name, domain_names = item.split(":")
551551
topic = get_topic(topic_name.strip())
552-
domain_names = domain_names.split(',')
552+
domain_names = domain_names.split(",")
553553
domains = []
554554
for domain_name in domain_names:
555-
if domain_name == '*':
555+
if domain_name == "*":
556556
domains = topic.domains
557557
break
558558
else:
559559
domains.append(topic.domain(domain_name.strip()))
560560
for domain in domains:
561561
for target in domain.targets:
562-
targets.append(dict(
563-
name=target.name,
564-
folder=folder
565-
))
562+
targets.append(dict(name=target.name, folder=folder))
566563
return dict(targets=targets)

src/mxmake/tests/test_templates.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -965,28 +965,33 @@ def test_ProxyMk(self, tempdir):
965965
factory = templates.template.lookup("proxy")
966966
template = factory(configuration, templates.get_template_environment())
967967

968-
self.assertEqual(template.description, "Contains proxy targets for Makefiles of source folders")
968+
self.assertEqual(
969+
template.description,
970+
"Contains proxy targets for Makefiles of source folders",
971+
)
969972
self.assertEqual(template.target_folder, utils.mxmake_files())
970973
self.assertEqual(template.target_name, "proxy.mk")
971974
self.assertEqual(template.template_name, "proxy.mk")
972975
self.assertEqual(
973976
template.template_variables,
974-
{'targets': [
975-
{'name': 'plone-site-create', 'folder': 'folder'},
976-
{'name': 'plone-site-purge', 'folder': 'folder'},
977-
{'name': 'plone-site-recreate', 'folder': 'folder'},
978-
{'name': 'gettext-create', 'folder': 'folder'},
979-
{'name': 'gettext-update', 'folder': 'folder'},
980-
{'name': 'gettext-compile', 'folder': 'folder'},
981-
{'name': 'lingua-extract', 'folder': 'folder'},
982-
{'name': 'lingua', 'folder': 'folder'}
983-
]}
977+
{
978+
"targets": [
979+
{"name": "plone-site-create", "folder": "folder"},
980+
{"name": "plone-site-purge", "folder": "folder"},
981+
{"name": "plone-site-recreate", "folder": "folder"},
982+
{"name": "gettext-create", "folder": "folder"},
983+
{"name": "gettext-update", "folder": "folder"},
984+
{"name": "gettext-compile", "folder": "folder"},
985+
{"name": "lingua-extract", "folder": "folder"},
986+
{"name": "lingua", "folder": "folder"},
987+
]
988+
},
984989
)
985990

986991
template.write()
987992
with (tempdir / "proxy.mk").open() as f:
988993
self.checkOutput(
989-
'''
994+
"""
990995
##############################################################################
991996
# proxy targets
992997
##############################################################################
@@ -1023,6 +1028,6 @@ def test_ProxyMk(self, tempdir):
10231028
folder-lingua:
10241029
$(MAKE) -C "./folder/" lingua
10251030
1026-
''',
1031+
""",
10271032
f.read(),
10281033
)

0 commit comments

Comments
 (0)