Changeset 6605880 in sasview


Ignore:
Timestamp:
Apr 18, 2012 10:26:45 AM (12 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
d47c349
Parents:
bc2db41
Message:

Fixing code style problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/data_panel.py

    rdc0cfa4 r6605880  
    6969    Check list control to be used for Data Panel 
    7070    """ 
    71     def __init__(self, parent,*args, **kwds): 
     71    def __init__(self, parent, *args, **kwds): 
    7272        #agwstyle is introduced in wx.2.8.11 but is not working for mac 
    7373        if IS_MAC and wx_version < 812: 
     
    7979                CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 
    8080        else: 
    81             #agwstyle is introduced in wx.2.8.11 .argument working only for windows 
     81            # agwstyle is introduced in wx.2.8.11 
     82            # argument working only for windows 
    8283            try: 
    8384                kwds['agwStyle'] = STYLE_FLAG 
     
    127128                 size=(PANEL_WIDTH, PANEL_HEIGHT), 
    128129                 list_of_perspective=None, manager=None, *args, **kwds): 
    129         kwds['size']= size 
     130        kwds['size'] = size 
    130131        kwds['style'] = STYLE_FLAG 
    131132        ScrolledPanel.__init__(self, parent=parent, *args, **kwds) 
     
    146147            list_of_perspective = [] 
    147148        self.list_of_perspective = list_of_perspective 
    148         self.list_rb_perspectives= [] 
     149        self.list_rb_perspectives = [] 
    149150        self.list_cb_data = {} 
    150151        self.list_cb_theory = {} 
     
    165166    def do_layout(self): 
    166167        """ 
     168            Create the panel layout 
    167169        """ 
    168170        self.define_panel_structure() 
     
    171173        self.layout_batch() 
    172174        self.layout_button() 
    173          
    174175    
    175176    def define_panel_structure(self): 
     
    187188        self.sizer5 = wx.BoxSizer(wx.VERTICAL) 
    188189        
    189         self.vbox.Add(self.sizer5, 0, wx.EXPAND|wx.ALL,1) 
    190         self.vbox.Add(self.sizer1, 1, wx.EXPAND|wx.ALL,0) 
    191         self.vbox.Add(self.sizer2, 0, wx.EXPAND|wx.ALL,1) 
    192         self.vbox.Add(self.sizer3, 0, wx.EXPAND|wx.ALL,10) 
     190        self.vbox.Add(self.sizer5, 0, wx.EXPAND|wx.ALL, 1) 
     191        self.vbox.Add(self.sizer1, 1, wx.EXPAND|wx.ALL, 0) 
     192        self.vbox.Add(self.sizer2, 0, wx.EXPAND|wx.ALL, 1) 
     193        self.vbox.Add(self.sizer3, 0, wx.EXPAND|wx.ALL, 10) 
    193194        #self.vbox.Add(self.sizer4, 0, wx.EXPAND|wx.ALL,5) 
    194195         
     
    197198    def layout_selection(self): 
    198199        """ 
     200            Create selection option combo box 
    199201        """ 
    200202        select_txt = wx.StaticText(self, -1, 'Selection Options') 
     
    218220    def _on_selection_type(self, event): 
    219221        """ 
    220         Select data according to patterns 
    221         """ 
    222          
    223         list_of_options = ['Select all Data', 
    224                             'Unselect all Data', 
    225                            'Select all Data 1D', 
    226                            'Unselect all Data 1D', 
    227                            'Select all Data 2D', 
    228                            'Unselect all Data 2D' ] 
     222            Select data according to patterns 
     223            :param event: UI event 
     224        """ 
    229225        option = self.selection_cbox.GetValue() 
    230226         
     
    234230        option = self.selection_cbox.GetString(pos) 
    235231        for item in self.list_cb_data.values(): 
    236             data_ctrl, _, _, _,_, _,_,_= item 
     232            data_ctrl, _, _, _, _, _, _, _= item 
    237233            data_id, data_class, _ = self.tree_ctrl.GetItemPyData(data_ctrl)  
    238234            if option == 'Select all Data': 
     
    283279        if not IS_MAC: 
    284280            self.perspective_cbox.SetMinSize((BUTTON_WIDTH*1.6, -1)) 
    285         wx.EVT_COMBOBOX(self.perspective_cbox,-1,  
     281        wx.EVT_COMBOBOX(self.perspective_cbox, -1,  
    286282                        self._on_perspective_selection) 
    287283     
     
    303299        self.bt_freeze.SetToolTipString(freeze_tip) 
    304300        wx.EVT_BUTTON(self, self.bt_freeze.GetId(), self.on_freeze) 
    305         #hide plot 
    306         #self.bt_close_plot = wx.Button(self, wx.NewId(), "Delete Plot",  
    307         #                           size=(BUTTON_WIDTH, -1)) 
    308         #self.bt_close_plot.SetToolTipString("Delete the plot panel on focus") 
    309         #wx.EVT_BUTTON(self, self.bt_close_plot.GetId(), self.on_close_plot) 
    310301        
    311302        if sys.platform == 'darwin' and build_options.WXPORT == 'osx_cocoa': 
     
    315306            self.cb_plotpanel = wx.ComboBox(self, -1,  
    316307                                            style=wx.CB_READONLY|wx.CB_SORT) 
    317         #self.cb_plotpanel.SetMinSize((BUTTON_WIDTH*2, -1)) 
    318308        wx.EVT_COMBOBOX(self.cb_plotpanel,-1, self._on_plot_selection) 
    319309        self.cb_plotpanel.Disable() 
     
    349339    def layout_batch(self): 
    350340        """ 
     341            Set up batch mode options 
    351342        """ 
    352343        self.rb_single_mode = wx.RadioButton(self, -1, 'Single Mode', 
     
    360351        self.rb_single_mode.SetValue(not self.parent.batch_on) 
    361352        self.rb_batch_mode.SetValue(self.parent.batch_on) 
    362         self.sizer4.AddMany([(self.rb_single_mode,0, wx.ALL, 4), 
    363                              (self.rb_batch_mode,0, wx.ALL, 4)]) 
     353        self.sizer4.AddMany([(self.rb_single_mode, 0, wx.ALL, 4), 
     354                             (self.rb_batch_mode, 0, wx.ALL, 4)]) 
    364355         
    365356    def on_single_mode(self, event): 
    366357        """ 
    367         change guiframe to its single mode 
     358            Change to single mode 
     359            :param event: UI event 
    368360        """ 
    369361        if self.parent is not None: 
     
    373365    def on_batch_mode(self, event): 
    374366        """ 
    375         change guiframe to its batch mode 
     367            Change to batch mode 
     368            :param event: UI event 
    376369        """ 
    377370        if self.parent is not None: 
    378                 wx.PostEvent(self.parent,  
    379                              NewBatchEvent(enable=True)) 
     371            wx.PostEvent(self.parent,  
     372                         NewBatchEvent(enable=True)) 
    380373     
    381374    def _get_data_selection(self, event):   
    382375        """ 
    383         Get data selection from the right click 
     376            Get data selection from the right click 
     377            :param event: UI event 
    384378        """ 
    385379        data = None 
     
    404398        panel = MaskDialog(parent=self.parent, base=self,  
    405399                           data=data, id=wx.NewId()) 
    406         #self.panel.Bind(wx.EVT_CLOSE, self._draw_masked_model) 
    407400        panel.ShowModal() 
    408401     
Note: See TracChangeset for help on using the changeset viewer.