Ignore:
Timestamp:
Oct 27, 2010 4:41:30 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
6cda91f
Parents:
c4d6900
Message:

working with pylint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/collimation_editor.py

    r6137b150 rb0ab6cb  
    1  
     1""" 
     2""" 
    23import wx 
    34import sys 
     
    2829        """ 
    2930        """ 
    30         kwds['size'] =(PANEL_WIDTH, PANEL_HEIGHT) 
     31        kwds['size'] = (PANEL_WIDTH, PANEL_HEIGHT) 
    3132        kwds['title'] = "Collimation Editor" 
    3233        wx.Dialog.__init__(self, parent=parent, *args, **kwds) 
     
    3738        self._notes = "" 
    3839        self._description = "Edit collimation" 
     40        #layout attributes 
     41        self.main_sizer = None 
     42        self.box_collimation = None 
     43        self.boxsizer_collimation = None 
     44         
     45         
    3946        self._do_layout() 
    4047        self.set_values() 
     
    4552        """ 
    4653        self.main_sizer = wx.BoxSizer(wx.VERTICAL) 
    47         self.box_collimation = wx.StaticBox(self, -1,str("Edit Selected Collimation")) 
    48         self.boxsizer_collimation = wx.StaticBoxSizer(self.box_collimation, wx.VERTICAL) 
     54        self.box_collimation = wx.StaticBox(self, -1, 
     55                                            str("Edit Selected Collimation")) 
     56        self.boxsizer_collimation = wx.StaticBoxSizer(self.box_collimation, 
     57                                                       wx.VERTICAL) 
    4958         
    5059        collimation_box = wx.StaticBox(self, -1, "Edit Number of Collimations") 
     
    8089         
    8190        self.bt_remove_collimation = wx.Button(self, -1, "Remove") 
    82         self.bt_remove_collimation.SetToolTipString("Remove data's collimation.") 
     91        hint = "Remove data's collimation." 
     92        self.bt_remove_collimation.SetToolTipString(hint) 
    8393        self.bt_remove_collimation.Bind(wx.EVT_BUTTON, self.remove_collimation) 
    8494       
    85         self.collimation_button_sizer.AddMany([(collimation_name_txt, 0, wx.LEFT, 15), 
     95        self.collimation_button_sizer.AddMany([(collimation_name_txt, 0, 
     96                                                 wx.LEFT, 15), 
    8697                                     (self.collimation_cbox, 0, wx.LEFT, 5), 
    8798                                     (self.bt_add_collimation, 0, wx.LEFT, 10), 
    88                                      (self.bt_remove_collimation, 0, wx.LEFT, 5)]) 
     99                                     (self.bt_remove_collimation, 
     100                                       0, wx.LEFT, 5)]) 
    89101        collimation_hint_txt = 'No collimation is available for this data.' 
    90102        self.collimation_txt = wx.StaticText(self, -1, collimation_hint_txt)  
    91103        self.collimation_hint_sizer.Add(self.collimation_txt, 0, wx.LEFT, 10) 
    92         self.collimation_sizer.AddMany([(self.collimation_button_sizer, 0, wx.ALL, 10), 
    93                                      (self.collimation_hint_sizer, 0, wx.ALL, 10)]) 
     104        self.collimation_sizer.AddMany([(self.collimation_button_sizer, 
     105                                          0, wx.ALL, 10), 
     106                                     (self.collimation_hint_sizer, 
     107                                       0, wx.ALL, 10)]) 
    94108      
    95109        self.fill_collimation_combox() 
     
    115129        self.length_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), style=0)    
    116130        length_unit_txt = wx.StaticText(self, -1, 'Unit: ')  
    117         self.length_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20),style=0)   
     131        self.length_unit_tcl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     132                                           style=0)   
    118133        self.length_sizer.AddMany([(length_txt, 0, wx.LEFT|wx.RIGHT, 10), 
    119134                                     (self.length_tcl, 0, wx.LEFT, 12), 
     
    165180        self.aperture_txt = wx.StaticText(self, -1, aperture_hint_txt)  
    166181        self.aperture_hint_sizer.Add(self.aperture_txt, 0, wx.LEFT, 10) 
    167         self.aperture_sizer.AddMany([(self.aperture_button_sizer, 0, wx.ALL, 10), 
     182        self.aperture_sizer.AddMany([(self.aperture_button_sizer, 
     183                                       0, wx.ALL, 10), 
    168184                                     (self.aperture_hint_sizer, 0, wx.ALL, 10)]) 
    169185        self.fill_aperture_combox() 
    170186        self.enable_aperture() 
    171187     
    172     def _do_layout(self, data=None): 
     188    def _do_layout(self): 
    173189        """ 
    174190        Draw the current panel 
     
    265281    def on_select_collimation(self, event): 
    266282        """ 
    267         fill the control on the panel according to the current  selected collimation  
     283        fill the control on the panel according to  
     284        the current  selected collimation  
    268285        """ 
    269286        self.set_values() 
     
    275292        Enable /disable widgets related to collimation 
    276293        """ 
    277         if self._collimation is not None and self.collimation_cbox.GetCount() > 0: 
     294        if self._collimation is not None and \ 
     295            self.collimation_cbox.GetCount() > 0: 
    278296            self.collimation_cbox.Enable() 
    279297            self.bt_remove_collimation.Enable() 
    280298            n_collimation = self.collimation_cbox.GetCount() 
    281             collimation_hint_txt = 'collimations available: %s '%str(n_collimation) 
     299            collimation_hint_txt = "collimations" 
     300            collimation_hint_txt += " available: %s "% str(n_collimation) 
    282301            if len(self._collimation) > 0: 
    283302                self.bt_remove_collimation.Enable() 
     
    491510                    collimation.length  = float(length) 
    492511            else: 
    493                 self._notes += "Error: Expected a float for collimation length " 
    494                 self._notes += "won't changes length from " 
     512                self._notes += "Error: Expected a float for collimation length" 
     513                self._notes += " won't changes length from " 
    495514                self._notes += "%s to %s"%(collimation.length, length) 
    496515        #change length  unit 
     
    518537        self.set_values() 
    519538        if self.manager is not None: 
    520              self.manager.set_collimation(self._collimation) 
     539            self.manager.set_collimation(self._collimation) 
    521540        
    522541  
    523 if __name__ =="__main__": 
     542if __name__ == "__main__": 
    524543 
    525544    app  = wx.App() 
Note: See TracChangeset for help on using the changeset viewer.