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
24 changes: 9 additions & 15 deletions src/ansys/fluent/core/solver/flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,21 +359,15 @@ class BooleanList(SettingsBase[BoolListType], Property):
_state_type = BoolListType


def _command_query_name_filter(self, is_command: bool = True, prefix: str = "") -> list:
def _command_query_name_filter(parent, list_attr: str, prefix: str) -> list:
"""Auto completer info of commands and queries."""
ret = []
names = self.command_names if is_command else self.query_names
names = getattr(parent, list_attr)
for name in names:
if name.startswith(prefix):
name_attr = getattr(self, name)
if name_attr.is_active():
ret.append(
[
name,
(Command if is_command else Query).__name__,
name_attr.__doc__,
]
)
child = getattr(parent, name)
if child.is_active():
ret.append([name, child.__class__.__bases__[0].__name__, child.__doc__])
return ret


Expand Down Expand Up @@ -492,8 +486,8 @@ def get_completer_info(self, prefix="") -> List[List[str]]:
child.__doc__,
]
)
command_info = _command_query_name_filter(self, prefix=prefix)
query_info = _command_query_name_filter(self, is_command=False, prefix=prefix)
command_info = _command_query_name_filter(self, "command_names", prefix)
query_info = _command_query_name_filter(self, "query_names", prefix)
for items in [command_info, query_info]:
ret.extend(items)
return ret
Expand Down Expand Up @@ -764,8 +758,8 @@ def get_completer_info(self, prefix="") -> List[List[str]]:
Name, type and docstring of all children.
"""
ret = []
command_info = _command_query_name_filter(self, prefix=prefix)
query_info = _command_query_name_filter(self, is_command=False, prefix=prefix)
command_info = _command_query_name_filter(self, "command_names", prefix)
query_info = _command_query_name_filter(self, "query_names", prefix)
for items in [command_info, query_info]:
ret.extend(items)
return ret
Expand Down