Changes in / [ae2a197:225aca8] in sasview


Ignore:
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sasview/sasview.py

    r199bb42b r199bb42b  
    9191APP_NAME = 'SasView' 
    9292 
    93 class SasViewApp(gui_manager.ViewApp): 
    94     """ 
    95     """ 
    96    
    97  
    9893class SasView(): 
    9994    """ 
     
    10499        """ 
    105100        #from gui_manager import ViewApp 
    106         self.gui = SasViewApp(0) 
     101        self.gui = gui_manager.SasViewApp(0) 
    107102        # Set the application manager for the GUI 
    108103        self.gui.set_manager(self) 
     
    126121        try: 
    127122            import sas.perspectives.pr as module 
    128             pr_plug = module.Plugin(standalone=False) 
     123            pr_plug = module.Plugin() 
    129124            self.gui.add_perspective(pr_plug) 
    130125        except: 
     
    135130        try: 
    136131            import sas.perspectives.invariant as module 
    137             invariant_plug = module.Plugin(standalone=False) 
     132            invariant_plug = module.Plugin() 
    138133            self.gui.add_perspective(invariant_plug) 
    139134        except: 
     
    145140        try: 
    146141            import sas.perspectives.calculator as module 
    147             calculator_plug = module.Plugin(standalone=False) 
     142            calculator_plug = module.Plugin() 
    148143            self.gui.add_perspective(calculator_plug) 
    149144        except: 
  • src/sas/guiframe/gui_manager.py

    r957af0d r957af0d  
    235235        Initialize the Frame object 
    236236        """ 
    237  
    238237        PARENT_FRAME.__init__(self, parent=parent, title=title, pos=pos, size=size) 
    239238        # title 
     
    364363                    frame.SetIcon(icon) 
    365364                except: 
    366                     pass 
     365                    logging.error("ViewerFrame.put_icon: could not set icon") 
    367366 
    368367    def get_client_size(self): 
     
    752751            self._toolbar.Realize() 
    753752 
    754  
    755753    def build_gui(self): 
    756754        """ 
     
    778776        # Append item from plugin under menu file if necessary 
    779777        self._populate_file_menu() 
    780  
    781778 
    782779        if not wx.VERSION_STRING >= '3.0.0.0': 
     
    822819        # Load panels 
    823820        self._load_panels() 
    824         self.set_default_perspective() 
    825821 
    826822    def SetStatusText(self, *args, **kwds): 
     
    931927                        if hasattr(module, "PLUGIN_ID"): 
    932928                            try: 
    933                                 plug = module.Plugin() 
    934                                 if plug.set_default_perspective(): 
    935                                     self._current_perspective = plug 
    936                                 plugins.append(plug) 
    937  
     929                                plugins.append(module.Plugin()) 
    938930                                msg = "Found plug-in: %s" % module.PLUGIN_ID 
    939931                                logging.info(msg) 
     
    15111503                for item in plugin.populate_file_menu(): 
    15121504                    m_name, m_hint, m_handler = item 
    1513                     id = wx.NewId() 
    1514                     self._file_menu.Append(id, m_name, m_hint) 
    1515                     wx.EVT_MENU(self, id, m_handler) 
     1505                    wx_id = wx.NewId() 
     1506                    self._file_menu.Append(wx_id, m_name, m_hint) 
     1507                    wx.EVT_MENU(self, wx_id, m_handler) 
    15161508                self._file_menu.AppendSeparator() 
    15171509 
    15181510        style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 
    15191511        if OPEN_SAVE_MENU: 
    1520             id = wx.NewId() 
     1512            wx_id = wx.NewId() 
    15211513            hint_load_file = "read all analysis states saved previously" 
    1522             self._save_appl_menu = self._file_menu.Append(id, '&Open Project', hint_load_file) 
    1523             wx.EVT_MENU(self, id, self._on_open_state_project) 
     1514            self._save_appl_menu = self._file_menu.Append(wx_id, '&Open Project', hint_load_file) 
     1515            wx.EVT_MENU(self, wx_id, self._on_open_state_project) 
    15241516 
    15251517        if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 
     
    15271519            hint_load_file = "Read a status files and load" 
    15281520            hint_load_file += " them into the analysis" 
    1529             id = wx.NewId() 
    1530             self._save_appl_menu = self._file_menu.Append(id, 
     1521            wx_id = wx.NewId() 
     1522            self._save_appl_menu = self._file_menu.Append(wx_id, 
    15311523                                                          '&Open Analysis', hint_load_file) 
    1532             wx.EVT_MENU(self, id, self._on_open_state_application) 
     1524            wx.EVT_MENU(self, wx_id, self._on_open_state_application) 
    15331525        if OPEN_SAVE_MENU: 
    15341526            self._file_menu.AppendSeparator() 
    1535             id = wx.NewId() 
    1536             self._file_menu.Append(id, '&Save Project', 
     1527            wx_id = wx.NewId() 
     1528            self._file_menu.Append(wx_id, '&Save Project', 
    15371529                                   'Save the state of the whole analysis') 
    1538             wx.EVT_MENU(self, id, self._on_save_project) 
     1530            wx.EVT_MENU(self, wx_id, self._on_save_project) 
    15391531        if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 
    1540             id = wx.NewId() 
    1541             self._save_appl_menu = self._file_menu.Append(id, \ 
     1532            wx_id = wx.NewId() 
     1533            self._save_appl_menu = self._file_menu.Append(wx_id, \ 
    15421534                '&Save Analysis', 'Save state of the current active analysis panel') 
    1543             wx.EVT_MENU(self, id, self._on_save_application) 
     1535            wx.EVT_MENU(self, wx_id, self._on_save_application) 
    15441536        if not sys.platform == 'darwin': 
    15451537            self._file_menu.AppendSeparator() 
    1546             id = wx.NewId() 
    1547             self._file_menu.Append(id, '&Quit', 'Exit') 
    1548             wx.EVT_MENU(self, id, self.Close) 
     1538            wx_id = wx.NewId() 
     1539            self._file_menu.Append(wx_id, '&Quit', 'Exit') 
     1540            wx.EVT_MENU(self, wx_id, self.Close) 
    15491541 
    15501542    def _add_menu_file(self): 
     
    17171709        """ 
    17181710        """ 
    1719         message = "" 
    17201711        log_msg = '' 
    1721         output = [] 
    1722         error_message = "" 
    17231712        basename = os.path.basename(path) 
    1724         root, extension = os.path.splitext(basename) 
     1713        _, extension = os.path.splitext(basename) 
    17251714        if extension.lower() not in EXTENSIONS: 
    17261715            log_msg = "File Loader cannot " 
     
    22242213            if hasattr(item, "post_init"): 
    22252214                item.post_init() 
    2226  
    2227     def set_default_perspective(self): 
    2228         """ 
    2229         Choose among the plugin the first plug-in that has 
    2230         "set_default_perspective" method and its return value is True will be 
    2231         as a default perspective when the welcome page is closed 
    2232         """ 
    2233         for item in self.plugins: 
    2234             if hasattr(item, "set_default_perspective"): 
    2235                 if item.set_default_perspective(): 
    2236                     item.on_perspective(event=None) 
    2237                     return 
    22382215 
    22392216    def set_perspective(self, panels): 
     
    24142391            total_plot_list.append(theory_data) 
    24152392        for new_plot in total_plot_list: 
    2416             id = new_plot.id 
    24172393            for group_id in new_plot.list_group_id: 
    2418                 wx.PostEvent(self, NewPlotEvent(id=id, 
     2394                wx.PostEvent(self, NewPlotEvent(id=new_plot.id, 
    24192395                                                group_id=group_id, 
    24202396                                                action='remove')) 
    24212397                #remove res plot: Todo: improve 
    2422                 wx.CallAfter(self._remove_res_plot, id) 
     2398                wx.CallAfter(self._remove_res_plot, new_plot.id) 
    24232399        self._data_manager.delete_data(data_id=data_id, 
    24242400                                       theory_id=theory_id) 
     
    24552431            ext_num = dlg.GetFilterIndex() 
    24562432            if ext_num == 0: 
    2457                 format = '.txt' 
     2433                ext_format = '.txt' 
    24582434            else: 
    2459                 format = '.xml' 
    2460             path = os.path.splitext(path)[0] + format 
     2435                ext_format = '.xml' 
     2436            path = os.path.splitext(path)[0] + ext_format 
    24612437            mypath = os.path.basename(path) 
    24622438 
    24632439            #Instantiate a loader 
    24642440            loader = Loader() 
    2465             format = ".txt" 
    2466             if os.path.splitext(mypath)[1].lower() == format: 
     2441            ext_format = ".txt" 
     2442            if os.path.splitext(mypath)[1].lower() == ext_format: 
    24672443                # Make sure the ext included in the file name 
    24682444                # especially on MAC 
    2469                 fName = os.path.splitext(path)[0] + format 
     2445                fName = os.path.splitext(path)[0] + ext_format 
    24702446                self._onsaveTXT(data, fName) 
    2471             format = ".xml" 
    2472             if os.path.splitext(mypath)[1].lower() == format: 
     2447            ext_format = ".xml" 
     2448            if os.path.splitext(mypath)[1].lower() == ext_format: 
    24732449                # Make sure the ext included in the file name 
    24742450                # especially on MAC 
    2475                 fName = os.path.splitext(path)[0] + format 
    2476                 loader.save(fName, data, format) 
     2451                fName = os.path.splitext(path)[0] + ext_format 
     2452                loader.save(fName, data, ext_format) 
    24772453            try: 
    24782454                self._default_save_location = os.path.dirname(path) 
     
    25982574            ext_num = dlg.GetFilterIndex() 
    25992575            if ext_num == 0: 
    2600                 format = '.dat' 
     2576                ext_format = '.dat' 
    26012577            else: 
    2602                 format = '' 
    2603             path = os.path.splitext(path)[0] + format 
     2578                ext_format = '' 
     2579            path = os.path.splitext(path)[0] + ext_format 
    26042580            mypath = os.path.basename(path) 
    26052581 
     
    26072583            loader = Loader() 
    26082584 
    2609             format = ".dat" 
    2610             if os.path.splitext(mypath)[1].lower() == format: 
     2585            ext_format = ".dat" 
     2586            if os.path.splitext(mypath)[1].lower() == ext_format: 
    26112587                # Make sure the ext included in the file name 
    26122588                # especially on MAC 
    2613                 fileName = os.path.splitext(path)[0] + format 
    2614                 loader.save(fileName, data, format) 
     2589                fileName = os.path.splitext(path)[0] + ext_format 
     2590                loader.save(fileName, data, ext_format) 
    26152591            try: 
    26162592                self._default_save_location = os.path.dirname(path) 
     
    32063182 
    32073183 
    3208 class ViewApp(wx.App): 
     3184class SasViewApp(wx.App): 
    32093185    """ 
    3210     Toy application to test this Frame 
     3186    SasView application 
    32113187    """ 
    32123188    def OnInit(self): 
     
    32943270            if len(os.listdir(model_folder)) > 0: 
    32953271                try: 
    3296                     for file in os.listdir(model_folder): 
    3297                         file_path = os.path.join(model_folder, file) 
     3272                    for filename in os.listdir(model_folder): 
     3273                        file_path = os.path.join(model_folder, filename) 
    32983274                        if os.path.isfile(file_path): 
    32993275                            os.remove(file_path) 
     
    33143290        """ 
    33153291        #try to load file at the start 
    3316         try: 
    3317             self.open_file() 
    3318         except: 
    3319             raise 
     3292        self.open_file() 
    33203293        self.frame.build_gui() 
    33213294 
  • src/sas/guiframe/local_perspectives/data_loader/data_loader.py

    rf76bf17 rf21d496  
    4141class Plugin(PluginBase): 
    4242 
    43     def __init__(self, standalone=False): 
    44         PluginBase.__init__(self, name="DataLoader", standalone=standalone) 
     43    def __init__(self): 
     44        PluginBase.__init__(self, name="DataLoader") 
    4545        # Default location 
    4646        self._default_save_location = DEFAULT_OPEN_FOLDER 
  • src/sas/guiframe/local_perspectives/plotting/plotting.py

    rc039589 rf21d496  
    3636    """ 
    3737 
    38     def __init__(self, standalone=False): 
    39         PluginBase.__init__(self, name="Plotting", standalone=standalone) 
     38    def __init__(self): 
     39        PluginBase.__init__(self, name="Plotting") 
    4040 
    4141        ## Plot panels 
  • src/sas/guiframe/plugin_base.py

    r373d4ee rf21d496  
    3434    """ 
    3535 
    36     def __init__(self, name="Test_plugin", standalone=True): 
     36    def __init__(self, name="Test_plugin"): 
    3737        """ 
    3838        Abstract class for gui_manager Plugins. 
     
    4242        ## Plug-in name. It will appear on the application menu. 
    4343        self.sub_menu = name 
    44         #standalone flag 
    45         self.standalone = standalone 
    4644        ## Reference to the parent window. Filled by get_panels() below. 
    4745        self.parent = None 
     
    263261        pass 
    264262 
    265     def set_default_perspective(self): 
    266         """ 
    267        Call back method that True to notify the parent that the current plug-in 
    268        can be set as default  perspective. 
    269        when returning False, the plug-in is not candidate for an automatic 
    270        default perspective setting 
    271         """ 
    272         if self.standalone: 
    273             return True 
    274         return False 
    275  
    276263    def set_state(self, state=None, datainfo=None):     
    277264        """ 
  • src/sas/perspectives/calculator/calculator.py

    r49ab5d7 rf21d496  
    3333    for calculator perspective 
    3434    """ 
    35     def __init__(self, standalone=True): 
    36         PluginBase.__init__(self, name="Calculator", standalone=standalone) 
     35    def __init__(self): 
     36        PluginBase.__init__(self, name="Calculator") 
    3737        # Log startup 
    3838        logging.info("Calculator plug-in started") 
  • src/sas/perspectives/fitting/fitpage.py

    r098f3d2 r098f3d2  
    268268        weighting_box.Add(sizer_weighting) 
    269269 
    270         sizer_fit = wx.GridSizer(2, 5, 2, 6) 
    271  
    272270        # combobox for smear2d accuracy selection 
    273271        self.smear_accuracy = wx.ComboBox(self, -1, size=(50, -1), 
     
    282280 
    283281        #Fit button 
    284         self.btFit = wx.Button(self, wx.NewId(), 'Fit', size=(88, 25)) 
     282        self.btFit = wx.Button(self, wx.NewId(), 'Fit') 
    285283        self.default_bt_colour = self.btFit.GetDefaultAttributes() 
    286284        self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId()) 
     
    288286 
    289287        #General Help button 
    290         self.btFitHelp = wx.Button(self, -1, 'HELP') 
    291         self.btFitHelp.SetToolTipString("General Fitting Help.") 
     288        self.btFitHelp = wx.Button(self, -1, 'Help') 
     289        self.btFitHelp.SetToolTipString("General fitting help.") 
    292290        self.btFitHelp.Bind(wx.EVT_BUTTON, self._onFitHelp) 
    293291         
     
    303301        self.btSmearHelp = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT,\ 
    304302                                     size=size_q) 
    305         self.btSmearHelp.SetToolTipString("Resolution Smearing Help.") 
     303        self.btSmearHelp.SetToolTipString("Resolution smearing help.") 
    306304        self.btSmearHelp.Bind(wx.EVT_BUTTON, self._onSmearHelp) 
    307305         
     
    362360        self.disable_smearer.SetValue(True) 
    363361 
    364         # add 4 types of smearing to the sizer 
    365         # Note from June 14, 2015 
    366         # removed the extra (10,10) spaces to make room for help.  Actually 
    367         # don't see the need for those anyway as the wx.LEFT, xx should take 
    368         # care of spacing anyway though it does not seem to work for some 
    369         # reason.  Currently leaving as we are in "code freeze" only making 
    370         # minimal changes necessary for release 3.1.  We probably want to clean 
    371         # up the whole fitpage (and basepage and fitpanel etc) eventually. 
    372         #                          ---- PDB 
    373362        sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) 
    374 #        sizer_smearer.Add((10, 10)) 
    375363        sizer_smearer.Add(self.enable_smearer) 
    376 #        sizer_smearer.Add((10, 10)) 
    377364        sizer_smearer.Add(self.pinhole_smearer) 
    378 #        sizer_smearer.Add((10, 10)) 
    379365        sizer_smearer.Add(self.slit_smearer) 
    380 #        sizer_smearer.Add((10, 10)) 
    381366        sizer_smearer.Add(self.btSmearHelp) 
    382367        sizer_smearer.Add((10, 10)) 
     
    397382 
    398383        # Update and Draw button 
    399         self.draw_button = wx.Button(self, wx.NewId(), 
    400                                      'Compute', size=(88, 24)) 
     384        self.draw_button = wx.Button(self, wx.NewId(), 'Compute') 
    401385        self.draw_button.Bind(wx.EVT_BUTTON, \ 
    402386                              self._onDraw, id=self.draw_button.GetId()) 
     
    414398        box_description_1 = wx.StaticText(self, -1, '   Chi2/Npts') 
    415399        box_description_2 = wx.StaticText(self, -1, 'Npts(Fit)') 
    416         #box_description_3 = wx.StaticText(self, -1, 'Total Npts') 
    417         #box_description_3.SetToolTipString( \ 
    418         #                        " Total Npts : total number of data points") 
    419  
    420         sizer_fit.Add(box_description_1, 0, 0) 
    421         sizer_fit.Add(box_description_2, 0, 0) 
    422         sizer_fit.Add(self.points_sizer, 0, 0) 
    423         #sizer_fit.Add(box_description_3, 0, 0) 
    424         sizer_fit.Add(self.draw_button, 0, 0) 
    425         sizer_fit.Add((-1,5)) 
    426         sizer_fit.Add(self.tcChi, 0, 0) 
    427         sizer_fit.Add(self.Npts_fit, 0, 0) 
    428         sizer_fit.Add(self.Npts_total, 0, 0) 
    429         sizer_fit.Add(self.btFit, 0, 0) 
    430         sizer_fit.Add(self.btFitHelp, 0, 0) 
    431400 
    432401        # StaticText for smear 
     
    576545        self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text) 
    577546        self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text) 
    578         id = wx.NewId() 
    579         self.reset_qrange = wx.Button(self, id, 'Reset', size=(77, 20)) 
    580  
    581         self.reset_qrange.Bind(wx.EVT_BUTTON, self.on_reset_clicked, id=id) 
     547        wx_id = wx.NewId() 
     548        self.reset_qrange = wx.Button(self, wx_id, 'Reset') 
     549 
     550        self.reset_qrange.Bind(wx.EVT_BUTTON, self.on_reset_clicked, id=wx_id) 
    582551        self.reset_qrange.SetToolTipString("Reset Q range to the default") 
    583552 
    584         sizer = wx.GridSizer(2, 4, 2, 6) 
    585  
    586         self.btEditMask = wx.Button(self, wx.NewId(), 'Editor', size=(88, 23)) 
     553        sizer = wx.GridSizer(5, 5, 2, 6) 
     554 
     555        self.btEditMask = wx.Button(self, wx.NewId(), 'Editor') 
    587556        self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask, 
    588557                             id=self.btEditMask.GetId()) 
     
    594563        sizer.Add(wx.StaticText(self, -1, ' Max[1/A]')) 
    595564        sizer.Add(self.EditMask_title) 
     565        sizer.Add((-1,5)) 
     566 
    596567        sizer.Add(self.reset_qrange) 
    597568        sizer.Add(self.qmin) 
    598569        sizer.Add(self.qmax) 
    599         #sizer.Add(self.theory_npts_tcrtl) 
    600570        sizer.Add(self.btEditMask) 
     571        sizer.Add((-1,5)) 
     572 
     573        sizer.AddMany(5*[(-1,5)]) 
     574 
     575        sizer.Add(box_description_1, 0, 0) 
     576        sizer.Add(box_description_2, 0, 0) 
     577        sizer.Add(self.points_sizer, 0, 0) 
     578        sizer.Add(self.draw_button, 0, 0) 
     579        sizer.Add((-1,5)) 
     580         
     581        sizer.Add(self.tcChi, 0, 0) 
     582        sizer.Add(self.Npts_fit, 0, 0) 
     583        sizer.Add(self.Npts_total, 0, 0) 
     584        sizer.Add(self.btFit, 0, 0) 
     585        sizer.Add(self.btFitHelp, 0, 0) 
     586         
    601587        boxsizer_range.Add(sizer_chi2) 
    602         boxsizer_range.Add((10, 10)) 
    603588        boxsizer_range.Add(sizer) 
    604  
    605         boxsizer_range.Add((10, 15)) 
    606         boxsizer_range.Add(sizer_fit) 
    607589        if is_2Ddata: 
    608590            self.btEditMask.Enable() 
  • src/sas/perspectives/fitting/fitting.py

    r098f3d2 r098f3d2  
    6161    Fitting plugin is used to perform fit 
    6262    """ 
    63     def __init__(self, standalone=False): 
    64         PluginBase.__init__(self, name="Fitting", standalone=standalone) 
     63    def __init__(self): 
     64        PluginBase.__init__(self, name="Fitting") 
    6565 
    6666        #list of panel to send to guiframe 
     
    221221        Get the python editor panel 
    222222        """ 
    223         id = event.GetId() 
    224         label = self.edit_menu.GetLabel(id) 
     223        event_id = event.GetId() 
     224        label = self.edit_menu.GetLabel(event_id) 
    225225        from sas.perspectives.calculator.pyconsole import PyConsole 
    226226        filename = os.path.join(models.find_plugins_dir(), label) 
     
    236236        Delete custom model file 
    237237        """ 
    238         id = event.GetId() 
    239         label = self.delete_menu.GetLabel(id) 
     238        event_id = event.GetId() 
     239        label = self.delete_menu.GetLabel(event_id) 
    240240        toks = os.path.splitext(label) 
    241241        path = os.path.join(models.find_plugins_dir(), toks[0]) 
     
    256256                #                                      info='warning')) 
    257257            else: 
    258                 self.delete_menu.Delete(id) 
     258                self.delete_menu.Delete(event_id) 
    259259                for item in self.edit_menu.GetMenuItems(): 
    260260                    if item.GetLabel() == label: 
     
    272272        Edit summodel template and make one 
    273273        """ 
    274         id = event.GetId() 
     274        event_id = event.GetId() 
    275275        model_manager = models.ModelManager() 
    276276        model_list = model_manager.get_model_name_list() 
     
    290290            self.new_model_frame.Show(True) 
    291291        else: 
    292             id = event.GetId() 
     292            event_id = event.GetId() 
    293293            dir_path = models.find_plugins_dir() 
    294294            title = "New Custom Model Function" 
     
    332332        Set list of the edit model menu labels 
    333333        """ 
    334         id = wx.NewId() 
     334        wx_id = wx.NewId() 
    335335        #new_model_menu = wx.Menu() 
    336         self.edit_model_menu.Append(id, 'New', 
     336        self.edit_model_menu.Append(wx_id, 'New', 
    337337                                   'Add a new model function') 
    338         wx.EVT_MENU(owner, id, self.make_new_model) 
    339         id = wx.NewId() 
    340         self.edit_model_menu.Append(id, 'Sum|Multi(p1, p2)', 
     338        wx.EVT_MENU(owner, wx_id, self.make_new_model) 
     339        wx_id = wx.NewId() 
     340        self.edit_model_menu.Append(wx_id, 'Sum|Multi(p1, p2)', 
    341341                                    'Sum of two model functions') 
    342         wx.EVT_MENU(owner, id, self.make_sum_model) 
     342        wx.EVT_MENU(owner, wx_id, self.make_sum_model) 
    343343        e_id = wx.NewId() 
    344344        self.edit_menu = wx.Menu() 
     
    376376                        has_file = True 
    377377                if not has_file: 
    378                     id = wx.NewId() 
    379                     submenu.Append(id, name) 
    380                     wx.EVT_MENU(owner, id, menu) 
     378                    wx_id = wx.NewId() 
     379                    submenu.Append(wx_id, name) 
     380                    wx.EVT_MENU(owner, wx_id, menu) 
    381381                    has_file = False 
    382382 
     
    397397        Create a page to access simultaneous fit option 
    398398        """ 
    399         id = event.GetId() 
     399        event_id = event.GetId() 
    400400        caption = "Const & Simul Fit" 
    401401        page = self.sim_page 
    402         if id == self.id_batchfit: 
     402        if event_id == self.id_batchfit: 
    403403            caption = "Combined Batch" 
    404404            page = self.batch_page 
     
    719719        for uid, value in self.page_finder.iteritems(): 
    720720            if uid != sim_page_id and uid != self.batch_page.uid: 
    721                 list = value.get_model() 
    722                 model = list[0] 
     721                model_list = value.get_model() 
     722                model = model_list[0] 
    723723                if model.name == modelname: 
    724724                    value.set_model_param(names, values) 
     
    15681568        """ 
    15691569        if event.panel is not None: 
    1570             new_panel = event.panel 
    15711570            self.slicer_panels.append(event.panel) 
    15721571            # Set group ID if available 
     
    16521651            #find if this theory was already plotted and replace that plot given 
    16531652            #the same id 
    1654             theory_data = self.page_finder[page_id].get_theory_data(fid=data.id) 
     1653            self.page_finder[page_id].get_theory_data(fid=data.id) 
    16551654 
    16561655            if data.is_data: 
  • src/sas/perspectives/invariant/invariant.py

    r824e488 rf21d496  
    3333    """ 
    3434 
    35     def __init__(self, standalone=False): 
    36         PluginBase.__init__(self, name="Invariant", standalone=standalone) 
     35    def __init__(self): 
     36        PluginBase.__init__(self, name="Invariant") 
    3737 
    3838        # dictionary containing data name and error on dy of that data 
  • src/sas/perspectives/pr/inversion_panel.py

    r3db44fb rf21d496  
    3535    oscillation_max = 1.5 
    3636 
    37     def __init__(self, parent, id=-1, plots=None, standalone=False, **kwargs): 
     37    def __init__(self, parent, id=-1, plots=None, **kwargs): 
    3838        """ 
    3939        """ 
     
    8383        ## Data manager 
    8484        self._manager = None 
    85         ## Standalone flage 
    86         self.standalone = standalone 
    8785        ## Default file location for save 
    8886        self._default_save_location = os.getcwd() 
  • src/sas/perspectives/pr/pr.py

    rc1c14ba rf21d496  
    5454    DEFAULT_DMAX = 140.0 
    5555 
    56     def __init__(self, standalone=True): 
    57         PluginBase.__init__(self, name="Pr Inversion", standalone=standalone) 
     56    def __init__(self): 
     57        PluginBase.__init__(self, name="Pr Inversion") 
    5858        ## Simulation window manager 
    5959        self.simview = None 
     
    9494        ## Number of P(r) points to display on the output plot 
    9595        self._pr_npts = 51 
    96         ## Flag to let the plug-in know that it is running standalone 
    97         self.standalone = standalone 
    9896        self._normalize_output = False 
    9997        self._scale_output_unity = False 
     
    623621            return [] 
    624622        elif item.id == graph.selected_plottable: 
    625             if not self.standalone and issubclass(item.__class__, Data1D): 
     623            if issubclass(item.__class__, Data1D): 
    626624                return [["Compute P(r)", 
    627625                         "Compute P(r) from distribution", 
     
    12381236        self.frame = MDIFrame(self.parent, None, 'None', (100, 200)) 
    12391237        self.control_panel = InversionControl(self.frame, -1, 
    1240                                               style=wx.RAISED_BORDER, 
    1241                                               standalone=self.standalone) 
     1238                                              style=wx.RAISED_BORDER) 
    12421239        self.frame.set_panel(self.control_panel) 
    12431240        self._frame_set_helper() 
     
    13171314            [Somehow openGL needs this call] 
    13181315        """ 
    1319         if self.standalone: 
    1320             self.parent.set_perspective(self.perspective) 
     1316        pass 
Note: See TracChangeset for help on using the changeset viewer.