Skip to content

Commit

Permalink
added missing addCategories call
Browse files Browse the repository at this point in the history
  • Loading branch information
rozyczko committed Oct 25, 2023
1 parent 4ab3543 commit 2f89163
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/sas/qtgui/MainWindow/GuiManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def __init__(self, parent=None):
# Add signal callbacks
self.addCallbacks()

# Assure categories are present
self.addCategories()

# Create the data manager
# TODO: pull out all required methods from DataManager and reimplement
self._data_manager = DataManager()
Expand Down Expand Up @@ -233,6 +236,21 @@ def closeAllPerspectives(self):
self.loadedPerspectives = {}
self._current_perspective = None

@staticmethod
def addCategories():
"""
Make sure categories.json exists and if not compile it and install in ~/.sasview
"""
try:
from sas.sascalc.fit.models import ModelManager
from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller
model_list = ModelManager().cat_model_list()
CategoryInstaller.check_install(model_list=model_list)
except Exception:
import traceback
logger.error("%s: could not load SasView models")
logger.error(traceback.format_exc())

def updatePlotItems(self, graphs):
"""
Wrapper for adding/removing actions in the windows menu
Expand Down

0 comments on commit 2f89163

Please sign in to comment.