ReliaQualAssociates / ramstk

Reliability, Availability, Maintainability, Safety (RAMS) analysis program.
https://www.reliaqual.com/rtk/
BSD 3-Clause "New" or "Revised" License
44 stars 15 forks source link

Handle AttributeError in Failure Definition _on_revision_select() Method #85

Closed weibullguy closed 6 years ago

weibullguy commented 6 years ago

Expected Behavior

When a Revision is selected and the associated Failure Definitions are loaded in the List View, if a definition in the Failure Definition (treelib) tree doesn't have a data package, it will raise an AttributeError when RTK attempts to add it to the rtk.TreeView model. This AttributeError should be handled, a debug log entry made, and a dialog raised to warn the user there was problem.

Actual Behavior

Currently the _on_revision_select() method simply prints "FIXME: Handle AttributeError in gtk.gui.listviews.FailureDefinition._on_select_revision" to the terminal. This is a place holder and not helpful to the user.

Steps to Reproduce the Problem

  1. Launch RTK.
  2. Open an RTK Program database.
  3. Select the Revision tab in the Module Book.
  4. Select a Revision line in the Module Book.
  5. If there is a failure definition in the failure definition tree with no data package, the error will be printed to the terminal.

Operating Environment

Execute something such as the following to get the required run-time package versions for the list above. You will need a copy of the requirements.txt file in the repository.

`for file in $(cat requirements.txt | cut -d '=' -f1);
    do version=$(pip show $file | grep Version: | cut -d ':' -f2-);
    echo $file ==$version;
 done`
weibullguy commented 6 years ago

Fixed in commit eed2c43cf390246e2ea0b2673ff770494a12e1d9