From 8a453a7bb59aa3dd6dc12ff244ab5ba64ff66fdf Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Mon, 18 Nov 2024 15:22:24 +0100 Subject: [PATCH] fix nested enums --- scripts/sipify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/sipify.py b/scripts/sipify.py index 78c37c9a10c9..82d8fc4813a2 100755 --- a/scripts/sipify.py +++ b/scripts/sipify.py @@ -2110,10 +2110,10 @@ def cpp_to_python_signature(cpp_function: str) -> str: value_comment_indented += f'\n\n Available as ``{enum_mk_base}.{compat_name}`` in older QGIS releases.\n' if CONTEXT.actual_class: CONTEXT.output_python.append( - f"{enum_mk_base}.{compat_name} = {CONTEXT.actual_class}.{enum_qualname}.{enum_member}\n") + f"{enum_mk_base}.{compat_name} = {'.'.join(CONTEXT.classname)}.{enum_qualname}.{enum_member}\n") if enum_old_name and compat_name != enum_member: CONTEXT.output_python.append( - f"{enum_mk_base}.{enum_old_name}.{compat_name} = {CONTEXT.actual_class}.{enum_qualname}.{enum_member}\n") + f"{enum_mk_base}.{enum_old_name}.{compat_name} = {'.'.join(CONTEXT.classname)}.{enum_qualname}.{enum_member}\n") CONTEXT.output_python.append( f"{enum_mk_base}.{compat_name}.is_monkey_patched = True\n") CONTEXT.output_python.append( @@ -2135,7 +2135,7 @@ def cpp_to_python_signature(cpp_function: str) -> str: if monkeypatch: CONTEXT.output_python.append( - f"{CONTEXT.actual_class}.{compat_name} = {CONTEXT.actual_class}.{enum_qualname}.{enum_member}\n") + f"{CONTEXT.actual_class}.{compat_name} = {'.'.join(CONTEXT.classname)}.{enum_qualname}.{enum_member}\n") CONTEXT.output_python.append( f"{CONTEXT.actual_class}.{compat_name}.is_monkey_patched = True\n") if CONTEXT.actual_class: @@ -2168,7 +2168,7 @@ def cpp_to_python_signature(cpp_function: str) -> str: enum_member_doc_string = "\n".join(enum_members_doc) if CONTEXT.actual_class: CONTEXT.output_python.append( - f'{CONTEXT.actual_class}.{enum_qualname}.__doc__ = """{CONTEXT.comment}\n\n{enum_member_doc_string}\n\n"""\n# --\n') + f'{".".join(CONTEXT.classname)}.{enum_qualname}.__doc__ = """{CONTEXT.comment}\n\n{enum_member_doc_string}\n\n"""\n# --\n') else: CONTEXT.output_python.append( f'{enum_qualname}.__doc__ = """{CONTEXT.comment}\n\n{enum_member_doc_string}\n\n"""\n# --\n')