Ignore:
Timestamp:
Mar 5, 2015 4:53:03 PM (9 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:
c4f6851
Parents:
c039589
Message:

pylint fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/guiframe/local_perspectives/plotting/SlicerParameters.py

    r79492222 rb40ad40  
    1212class SlicerParameterPanel(wx.Dialog): 
    1313    """ 
    14     Panel class to show the slicer parameters  
     14    Panel class to show the slicer parameters 
    1515    """ 
    1616    #TODO: show units 
    1717    #TODO: order parameters properly 
    18      
     18 
    1919    def __init__(self, parent, *args, **kwargs): 
    20         wx.Dialog.__init__(self, parent, *args, **kwargs) 
    2120        """ 
    22         Dialog window that allow to edit parameters slicer  
     21        Dialog window that allow to edit parameters slicer 
    2322        by entering new values 
    2423        """ 
     24        wx.Dialog.__init__(self, parent, *args, **kwargs) 
    2525        self.params = {} 
    2626        self.parent = parent 
     
    3333        title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
    3434        self.bck.Add(title, (0, 0), (1, 2), 
    35                      flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     35                     flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15) 
    3636        # Bindings 
    3737        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
     
    4242        Process EVT_SLICER events 
    4343        When the slicer changes, update the panel 
    44          
     44 
    4545        :param event: EVT_SLICER event 
    4646        """ 
     
    5050        else: 
    5151            self.set_slicer(event.type, event.params) 
    52          
     52 
    5353    def set_slicer(self, type, params): 
    5454        """ 
    5555        Rebuild the panel 
    5656        """ 
    57         self.bck.Clear(True)   
    58         self.type = type   
     57        self.bck.Clear(True) 
     58        self.type = type 
    5959        if type == None: 
    6060            label = "Right-click on 2D plot for slicer options" 
    6161            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
    62             self.bck.Add(title, (0, 0), (1, 2),  
    63                          flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     62            self.bck.Add(title, (0, 0), (1, 2), 
     63                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15) 
    6464        else: 
    65             title = wx.StaticText(self, -1,  
     65            title = wx.StaticText(self, -1, 
    6666                                  "Slicer Parameters", style=wx.ALIGN_LEFT) 
    6767            self.bck.Add(title, (0, 0), (1, 2), 
    68                          flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     68                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15) 
    6969            ix = 0 
    7070            iy = 0 
     
    7777                if not item in ["count", "errors"]: 
    7878                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 
    79                     self.bck.Add(text, (iy, ix), (1, 1),  
    80                                  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     79                    self.bck.Add(text, (iy, ix), (1, 1), 
     80                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    8181                    ctl = wx.TextCtrl(self, -1, size=(80, 20), 
    8282                                      style=wx.TE_PROCESS_ENTER) 
     
    8888                    self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter) 
    8989                    self.parameters.append([item, ctl]) 
    90                     self.bck.Add(ctl, (iy, ix), (1, 1),  
    91                                  wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     90                    self.bck.Add(ctl, (iy, ix), (1, 1), 
     91                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    9292                    ix = 3 
    93                     self.bck.Add((20, 20), (iy, ix), (1, 1),  
    94                                  wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     93                    self.bck.Add((20, 20), (iy, ix), (1, 1), 
     94                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    9595                else: 
    96                     text = wx.StaticText(self, -1, item + " : ",  
     96                    text = wx.StaticText(self, -1, item + " : ", 
    9797                                         style=wx.ALIGN_LEFT) 
    98                     self.bck.Add(text, (iy, ix), (1, 1),  
    99                                  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    100                     ctl = wx.StaticText(self, -1,  
    101                                     format_number(str(params[item])),  
    102                                     style=wx.ALIGN_LEFT) 
     98                    self.bck.Add(text, (iy, ix), (1, 1), 
     99                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
     100                    ctl = wx.StaticText(self, -1, 
     101                                        format_number(str(params[item])), 
     102                                        style=wx.ALIGN_LEFT) 
    103103                    ix = 1 
    104                     self.bck.Add(ctl, (iy, ix), (1, 1),  
    105                                  wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     104                    self.bck.Add(ctl, (iy, ix), (1, 1), 
     105                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    106106            iy += 1 
    107107            ix = 1 
    108             self.bck.Add((20, 20), (iy, ix), (1, 1),  
    109                          wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     108            self.bck.Add((20, 20), (iy, ix), (1, 1), 
     109                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    110110        self.bck.Layout() 
    111111        self.bck.Fit(self) 
     
    119119        evt.Skip() 
    120120        if evt.type == "UPDATE": 
    121             for item in self.parameters:               
     121            for item in self.parameters: 
    122122                if item[0] in evt.params: 
    123123                    item[1].SetValue("%-5.3g" % evt.params[item[0]]) 
    124124                    item[1].Refresh() 
    125          
    126     def onTextEnter(self, evt):  
     125 
     126    def onTextEnter(self, evt): 
    127127        """ 
    128128        Parameters have changed 
    129         """  
     129        """ 
    130130        params = {} 
    131131        has_error = False 
     
    133133            try: 
    134134                params[item[0]] = float(item[1].GetValue()) 
    135                 item[1].SetBackgroundColour( 
    136                         wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
     135                item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
    137136                item[1].Refresh() 
    138137            except: 
     
    146145            event = SlicerParameterEvent(type=self.type, params=params) 
    147146            wx.PostEvent(self.parent, event) 
    148          
Note: See TracChangeset for help on using the changeset viewer.