Skip to content

Commit

Permalink
BUGFIX: correct information when documentation is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
amilcarlucas committed Apr 26, 2024
1 parent 770ebb4 commit d6f59cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions MethodicConfigurator/frontend_tkinter_parameter_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def update_documentation_labels(self, current_file: str):
else:
frame_title = "Documentation"
self.documentation_frame.config(text=frame_title)
documentation = self.local_filesystem.file_documentation.get(current_file, None) if \
documentation = self.local_filesystem.file_documentation.get(current_file, {}) if \
self.local_filesystem.file_documentation else None

blog_text, blog_url = self.__get_documentation_text_and_url(documentation, 'blog_text', 'blog_url')
Expand All @@ -110,14 +110,14 @@ def update_documentation_labels(self, current_file: str):
self.__update_documentation_label('Mandatory:', mandatory_text, mandatory_url, False)

def __get_documentation_text_and_url(self, documentation, text_key, url_key):
if documentation:
text = documentation.get(text_key, f"No documentation available for {self.current_file} in the "
f"{self.local_filesystem.file_documentation_filename} file")
url = documentation.get(url_key, None)
else:
if documentation is None:
text = f"File '{self.local_filesystem.file_documentation_filename}' not found. " \
"No intermediate parameter file documentation available"
url = None
else:
text = documentation.get(text_key, f"No documentation available for {self.current_file} in the "
f"{self.local_filesystem.file_documentation_filename} file")
url = documentation.get(url_key, None)
return text, url

def __update_documentation_label(self, label_key, text, url, url_expected=True):
Expand Down

0 comments on commit d6f59cd

Please sign in to comment.