diff --git a/.vscode/launch.json b/.vscode/launch.json index 7006e560a..dde0b63eb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,10 +11,10 @@ "type": "python", "python": "/dls_sw/prod/tools/RHEL7-x86_64/defaults/bin/dls-python", "request": "launch", - "program": "dls_builder_conversion/builder2ibek.support.py", + "program": "builder2ibek.support.py", "console": "integratedTerminal", "args": [ - "/dls_sw/prod/R3.14.12.7/support/ADSimDetector/2-9dls1/", + "/dls_sw/prod/R3.14.12.7/support/pmac/2-5-22/", ], "justMyCode": false }, diff --git a/builder2ibek.support.py b/builder2ibek.support.py index cfb91ad10..fa4aae9b4 100755 --- a/builder2ibek.support.py +++ b/builder2ibek.support.py @@ -254,7 +254,7 @@ def _extract_substitutions(self, name): missing = set(database["args"].keys()) - set(self.def_args[name]) if len(missing) > 0: missed = ", ".join(missing) - database["warning"] = "MACROS missing from args: " + missed + database["warning"] = "Database Args missing: " + missed return databases def _make_init_script( @@ -273,15 +273,22 @@ def _make_init_script( func_text = inspect.getsource(func) print_strings = func_text.split("print")[1:] + command_args = [] + commands = "" for print_string in print_strings: matches = extract_printed_strings_re.findall(print_string) if matches: + command_args += macros_re.findall(matches[0][1]) line = macros_re.sub(macro_to_jinja_re, matches[0][1]) commands += line + "\n" if commands: script_item["value"] = PreservedScalarString(commands) script.append(script_item) + missing = set(command_args) - set(self.def_args[name]) + if len(missing) > 0: + missed = ", ".join(missing) + script_item["warning"] = "function Args missing: " + missed def _call_initialise(self, builder_object, name): """