diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-15 13:30:57 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-15 13:31:52 +0200 |
commit | f328b015085be3eab7800e6f87cf1ae704486c0a (patch) | |
tree | d555964f532010a2db4c937ed1dc9a1c6ebb5e65 /src/ee/tools | |
parent | c4a1a452d344de0ee45e2fb2c8284c636eb05818 (diff) | |
download | ee-python-f328b015085be3eab7800e6f87cf1ae704486c0a.tar.gz ee-python-f328b015085be3eab7800e6f87cf1ae704486c0a.tar.bz2 ee-python-f328b015085be3eab7800e6f87cf1ae704486c0a.tar.xz ee-python-f328b015085be3eab7800e6f87cf1ae704486c0a.zip |
odoo: Don't generate any Ninja code unless actually enabled.
Diffstat (limited to 'src/ee/tools')
-rw-r--r-- | src/ee/tools/__init__.py | 3 | ||||
-rw-r--r-- | src/ee/tools/ninja.py | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ee/tools/__init__.py b/src/ee/tools/__init__.py index 1c4e769..00fee58 100644 --- a/src/ee/tools/__init__.py +++ b/src/ee/tools/__init__.py @@ -71,6 +71,9 @@ def process_default_argparse_group(args): def parse_bool(v): + if v is None: + return False + if isinstance(v, bool): return v diff --git a/src/ee/tools/ninja.py b/src/ee/tools/ninja.py index c669ad1..eff5a18 100644 --- a/src/ee/tools/ninja.py +++ b/src/ee/tools/ninja.py @@ -151,8 +151,12 @@ def generate(project: Project): f.write("\n") if len(hooks): for name, _ in hooks: - f.write("# Hook: {}\n".format(name)) fragment_name = hook_fragments[name] + + if fragment_name is None: + continue + + f.write("# Hook: {}\n".format(name)) f.write(fragment_name) if not fragment_name.endswith("\n"): f.write("\n") |