Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ansys/fluent/core/services/datamodel_tui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Wrappers over TUI-based datamodel grpc service of Fluent."""

import keyword
import types
from typing import Any, Iterable, List, Tuple, Union

import grpc
Expand Down Expand Up @@ -210,6 +211,15 @@ def __dir__(self) -> Iterable[str]:
for x in PyMenu(self.service, self.path).get_child_names()
]

def __getattribute__(self, name):
attr = super().__getattribute__(name)
if type(attr) == types.MethodType:
path = self.path + [name]
# if menus are inserted at runtime in Fluent
if PyMenu(self.service, path).get_child_names():
return TUIMenuGeneric(path, self.service)
return attr


class TUIMenuGeneric(TUIMenu):
"""Generic menu class for when the explicit menu classes aren't
Expand Down