Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna-Shalamitskaya-EPAM committed Dec 5, 2024
1 parent 9db2999 commit 1f83c14
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from typing import Dict, List, Optional

from esmf_aspect_meta_model_python.base.base import Base
from esmf_aspect_meta_model_python.base.is_described import IsDescribed
from esmf_aspect_meta_model_python.loader.meta_model_base_attributes import MetaModelBaseAttributes


Expand Down Expand Up @@ -95,7 +96,11 @@ def _prepare_attr_message(name, value):
for k, v in value.items():
message += f"\n\t\t{k.upper()}: {v}"
else:
message += repr(value) if isinstance(value, BaseImpl) else str(value)
if isinstance(value, BaseImpl):
message += repr(value)
else:
value_str = str(value)
message += value_str.replace("\t", "\t\t")

return message

Expand All @@ -114,7 +119,10 @@ def _prepare_list_attr_message(name, value):
"""Prepare a message for the list data type attribute value."""
message = f"{name}:"
for elem in value:
message += f"\n\t\t{elem.name}"
if isinstance(elem, IsDescribed):
message += f"\n\t\t{elem.name}"
else:
message += f"\n\t\t{elem}"

return message

Expand Down

0 comments on commit 1f83c14

Please sign in to comment.