Ignore:
Timestamp:
Oct 20, 2016 3:54:06 PM (8 years ago)
Author:
krzywon
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
880e845, cf1910f
Parents:
8b645cc
Message:

Fixes #738: No errors are thrown on loading projects with fits, plus linting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitpanel.py

    re6de6b8 rc8e1996  
    187187        """ 
    188188 
    189         # get number of pages 
    190         nop = self.GetPageCount() 
    191189        # use while-loop, for-loop will not do the job well. 
    192         while (nop > 0): 
     190        while (self.GetPageCount() > 0): 
    193191            # delete the first page until no page exists 
    194192            page = self.GetPage(0) 
     
    197195            self._close_helper(selected_page=page) 
    198196            self.DeletePage(0) 
    199             nop = self.GetPageCount() 
    200197        # Clear list of names 
    201198        self.fit_page_name = {} 
     
    240237        # close all panels only when svs file opened 
    241238        self.close_all() 
    242         self._manager.mypanels = [] 
    243239        self.sim_page = None 
    244240        self.batch_page = None 
     
    248244        close page and remove all references to the closed page 
    249245        """ 
    250         nbr_page = self.GetPageCount() 
    251246        selected_page = self.GetPage(self.GetSelection()) 
    252         if nbr_page == 1: 
     247        if self.GetPageCount() == 1: 
    253248            if selected_page.get_data() is not None: 
    254249                if event is not None: 
     
    293288        copy a dictionary of model into its own dictionary 
    294289 
    295         :param m_dict: dictionnary made of model name as key and model class 
     290        :param dict: dictionnary made of model name as key and model class 
    296291            as value 
    297292        """ 
     
    320315        if caption == "Const & Simul Fit": 
    321316            self.sim_page = SimultaneousFitPage(self, page_finder=page_finder, 
    322                                                  id= wx.ID_ANY, batch_on=False) 
     317                                                 id=wx.ID_ANY, batch_on=False) 
    323318            self.sim_page.window_caption = caption 
    324319            self.sim_page.window_name = caption 
     
    397392            raise ValueError, "Fitpanel delete_data expect list of id" 
    398393        else: 
    399             n = self.GetPageCount() 
    400394            for page in self.opened_pages.values(): 
    401395                pos = self.GetPageIndex(page) 
     
    441435        if data_1d_list and data_2d_list: 
    442436            # need to warning the user that this batch is a special case 
    443             from sas.sasgui.perspectives.fitting.fitting_widgets import BatchDataDialog 
     437            from sas.sasgui.perspectives.fitting.fitting_widgets import \ 
     438                BatchDataDialog 
    444439            dlg = BatchDataDialog(self) 
    445440            if dlg.ShowModal() == wx.ID_OK: 
     
    461456                page = self.add_empty_page() 
    462457            if data_1d_list and not data_2d_list: 
    463                 #only on type of data 
     458                # only on type of data 
    464459                page.fill_data_combobox(data_1d_list) 
    465460            elif not data_1d_list and data_2d_list: 
     
    477472        Add a fitting page on the notebook contained by fitpanel 
    478473 
    479         :param data: data to fit 
     474        :param data_list: data to fit 
    480475 
    481476        :return panel : page just added for further used. 
Note: See TracChangeset for help on using the changeset viewer.