Ignore:
Timestamp:
Nov 9, 2017 6:41:54 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
cee5c78
Parents:
749b715
git-author:
Piotr Rozyczko <rozyczko@…> (10/26/17 01:13:05)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 06:41:54)
Message:

Initial changes to make SasView? run with python3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r14fa542 rb3e8629  
    1212from sas.qtgui.Perspectives.Fitting.FittingOptions import FittingOptions 
    1313from sas.qtgui.Perspectives.Fitting.GPUOptions import GPUOptions 
    14 from sas.qtgui.Perspectives.Fitting import ModelUtilities 
     14#from sas.qtgui.Perspectives.Fitting import ModelUtilities 
    1515 
    1616class FittingWindow(QtGui.QTabWidget): 
     
    6464        # GPU Options 
    6565        self.gpu_options_widget = GPUOptions(self) 
    66  
    67         self.menu_manager = ModelUtilities.ModelManager() 
    68         # TODO: reuse these in FittingWidget properly 
    69         self.model_list_box = self.menu_manager.get_model_list() 
    70         self.model_dictionary = self.menu_manager.get_model_dictionary() 
    7166 
    7267        #self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) 
     
    124119        Create a list if none exists and append if there's already a list 
    125120        """ 
    126         if item_key in self.dataToFitTab.keys(): 
    127             self.dataToFitTab[item_key].append(tab_name) 
     121        item_key_str = str(item_key) 
     122        if item_key_str in list(self.dataToFitTab.keys()): 
     123            self.dataToFitTab[item_key_str].append(tab_name) 
    128124        else: 
    129             self.dataToFitTab[item_key] = [tab_name] 
     125            self.dataToFitTab[item_key_str] = [tab_name] 
    130126 
    131127        #print "CURRENT dict: ", self.dataToFitTab 
     
    173169        Given name of the fitting tab - close it 
    174170        """ 
    175         for tab_index in xrange(len(self.tabs)): 
     171        for tab_index in range(len(self.tabs)): 
    176172            if self.tabText(tab_index) == tab_name: 
    177173                self.tabCloses(tab_index) 
     
    185181            return 
    186182        for index_to_delete in index_list: 
    187             if index_to_delete in self.dataToFitTab.keys(): 
    188                 for tab_name in self.dataToFitTab[index_to_delete]: 
     183            index_to_delete_str = str(index_to_delete) 
     184            if index_to_delete_str in list(self.dataToFitTab.keys()): 
     185                for tab_name in self.dataToFitTab[index_to_delete_str]: 
    189186                    # delete tab #index after corresponding data got removed 
    190187                    self.closeTabByName(tab_name) 
    191                 self.dataToFitTab.pop(index_to_delete) 
     188                self.dataToFitTab.pop(index_to_delete_str) 
    192189 
    193190        #print "CURRENT dict: ", self.dataToFitTab 
     
    209206        if not isinstance(data_item, list): 
    210207            msg = "Incorrect type passed to the Fitting Perspective" 
    211             raise AttributeError, msg 
     208            raise AttributeError(msg) 
    212209 
    213210        if not isinstance(data_item[0], QtGui.QStandardItem): 
    214211            msg = "Incorrect type passed to the Fitting Perspective" 
    215             raise AttributeError, msg 
     212            raise AttributeError(msg) 
    216213 
    217214        items = [data_item] if is_batch else data_item 
     
    220217            # Find the first unassigned tab. 
    221218            # If none, open a new tab. 
    222             available_tabs = list(map(lambda tab: tab.acceptsData(), self.tabs)) 
     219            available_tabs = list([tab.acceptsData() for tab in self.tabs]) 
    223220 
    224221            if numpy.any(available_tabs): 
Note: See TracChangeset for help on using the changeset viewer.