diff --git a/scripts/gen_actor_source.py b/scripts/gen_actor_source.py index 9fb111823b1a0636ed1ccf992c772e120470c933..8e0ffaf5d98424ccfd0c310fcbf77c195ad00683 100755 --- a/scripts/gen_actor_source.py +++ b/scripts/gen_actor_source.py @@ -56,7 +56,7 @@ and '|' is 'or'): class Method := name: class Name returnType: class BaseType | None - async: bool + async_: bool arguments: (class Argument)* class BaseType := @@ -754,9 +754,9 @@ class Method: else: self.return_type = None if "async" in json_node: - self.async = bool(json_node["async"]) + self.async_ = bool(json_node["async"]) else: - self.async = self.return_type is None + self.async_ = self.return_type is None self.arguments = [] if "arguments" in json_node: for arg in json_node["arguments"]: @@ -1966,7 +1966,7 @@ private: method_index = self._module.methods.index(method) switch_body += "case 0x%04x: {\n" % method_index switch_body += " /* %s */\n" % method.name.get_ascii_value() - if method.async: + if method.async_: switch_body += " Q_EMIT asyncRun(index, args);\n" switch_body += " return ES_Async;\n" else: @@ -2057,7 +2057,7 @@ private: for method in self._module.methods: assert isinstance(method, Method) method_index = self._module.methods.index(method) - if method.async: + if method.async_: switch_body += "case 0x%04x: {\n" % method_index switch_body += " /* %s */\n" % method.name.get_ascii_value() args = [] @@ -2193,7 +2193,7 @@ private: """ body = "module_ = new %s(this);\n" % self._module.get_module_cpp_class_name() methods = self._module.methods - async_methods = list(filter(lambda method: method.async, methods)) + async_methods = list(filter(lambda method: method.async_, methods)) if self._module.settings: body += self._module.settings.get_settings_page_creation("settingsPage_").strip() + "\n\n" if async_methods: @@ -2495,7 +2495,7 @@ class AsyncThreadCppClass(CppClassBase): :return: implementation of void run() """ switch_body = "" - methods = filter(lambda module_method: module_method.async, self._module.methods) + methods = filter(lambda module_method: module_method.async_, self._module.methods) for method in methods: assert isinstance(method, Method) method_index = self._module.methods.index(method)