Skip to content

Commit

Permalink
Add notification on tools in design view when the main program file c…
Browse files Browse the repository at this point in the history
…an not be found
  • Loading branch information
ptsavol committed Dec 3, 2024
1 parent 72a7ce2 commit d903f0c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spine_items/tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,15 @@ def _check_notifications(self):
file_paths = self._find_input_files(resources)
file_paths = flatten_file_path_duplicates(file_paths, self._logger)
self._input_files_not_found = [k for k, v in file_paths.items() if v is None]
# Check that main program file exists. If not, log a message with an anchor to find it
if len(self.specification().includes) > 0:
filename = self.specification().includes[0]
full_path = os.path.join(self.specification().path, filename)
if not os.path.isfile(full_path):
self.add_notification(
f"Tool spec <b>{self.specification().name}</b> won't work because "
f"main program file <b>{full_path}</b> doesn't exist."
)
if self._input_files_not_found:
self.add_notification(
f"File(s) {', '.join(self._input_files_not_found)} needed to execute this Tool are not provided"
Expand Down

0 comments on commit d903f0c

Please sign in to comment.