Skip to content

Commit a562d16

Browse files
committed
feat: using msg and commands elements in config.yaml warnings section
1 parent a9051e1 commit a562d16

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

config.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ ignored_commands:
4949
- "*XPL" # Defined in ``mapdl_grpc.py``
5050

5151
warnings:
52-
"This command must be run using :func:`non_interactive <ansys.mapdl.core.Mapdl.non_interactive>`\nPlease visit `Unsupported Interactive Commands <https://mapdl.docs.pyansys.com/version/stable/user_guide/mapdl.html#unsupported-interactive-commands>`_\nfor further information.":
53-
- "*CREATE"
54-
- "CFOPEN"
55-
- "CFCLOSE"
56-
- "*VWRITE"
57-
- "*MWRITE"
58-
- "LSWRITE"
59-
- "LSREAD"
52+
- msg: 'This command must be run using :func:`non_interactive <ansys.mapdl.core.Mapdl.non_interactive>
53+
54+
Please visit `Unsupported Interactive Commands <https://mapdl.docs.pyansys.com/version/stable/user_guide/mapdl.html#unsupported-interactive-commands>`_
55+
56+
for further information.'
57+
commands:
58+
- "*CREATE"
59+
- "CFOPEN"
60+
- "CFCLOSE"
61+
- "*VWRITE"
62+
- "*MWRITE"
63+
- "LSWRITE"
64+
- "LSREAD"
6065

6166

6267
specific_classes:

src/pyconverter/xml2py/utils/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ def get_warning_command_dict(yaml_path: Path) -> dict:
7575
"""
7676
warnings_ = get_config_data_value(yaml_path, "warnings")
7777
warning_command_dict = {}
78-
for warning_, command_list in warnings_.items():
79-
for command in command_list:
78+
for warning_ in warnings_:
79+
message = warning_["msg"]
80+
commands = warning_["commands"]
81+
for command in commands:
8082
try:
81-
warning_command_dict[command].append(warning_)
83+
warning_command_dict[command].append(message)
8284
except KeyError:
83-
warning_command_dict[command] = [warning_]
85+
warning_command_dict[command] = [message]
8486

8587
return warning_command_dict
8688

0 commit comments

Comments
 (0)