Changeset 7432acb in sasview for src/sas/sasgui


Ignore:
Timestamp:
Apr 9, 2017 4:11:31 AM (7 years ago)
Author:
andyfaff
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
45dffa69
Parents:
ac07a3a
Message:

MAINT: search+replace '!= None' by 'is not None'

Location:
src/sas/sasgui
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/dataFitting.py

    r235f514 r7432acb  
    154154        result.lam = np.append(self.lam, other.lam) 
    155155        result.lam = result.lam[ind] 
    156         if result.dlam != None: 
     156        if result.dlam is not None: 
    157157            result.dlam = np.append(self.dlam, other.dlam) 
    158158            result.dlam = result.dlam[ind] 
    159         if result.dy != None: 
     159        if result.dy is not None: 
    160160            result.dy = np.append(self.dy, other.dy) 
    161161            result.dy = result.dy[ind] 
     
    307307        result.lam = np.append(self.lam, other.lam) 
    308308        result.lam = result.lam[ind] 
    309         if result.dy != None: 
     309        if result.dy is not None: 
    310310            result.dy = np.append(self.dy, other.dy) 
    311311            result.dy = result.dy[ind] 
  • src/sas/sasgui/guiframe/data_processor.py

    rac07a3a r7432acb  
    10281028                                    label += create_label(col_name, 
    10291029                                                          int(new_row) + 1, None) 
    1030                     if row_min != None and row_max != None: 
     1030                    if row_min is not None and row_max is not None: 
    10311031                        if index == 0: 
    10321032                            label += create_label(col_name, 
     
    13741374            wx.PostEvent(self.parent.parent, StatusEvent(status=msg, info="error")) 
    13751375            return 
    1376         if dy != None and (len(y) != len(dy)): 
     1376        if dy is not None and (len(y) != len(dy)): 
    13771377            msg = "Need same length for Y and dY axis and both greater than 0" 
    13781378            msg += " to plot.\n" 
     
    15721572        """ 
    15731573 
    1574         if label != None: 
     1574        if label is not None: 
    15751575            tcrtl_label.SetValue(str(label)) 
    1576         if title != None: 
     1576        if title is not None: 
    15771577            tcrtl_title.SetValue(str(title)) 
    15781578 
     
    16851685        # I Believe this is no longer used now that we have removed the  
    16861686        # edit menu from the menubar - PDB July 12, 2015 
    1687         if event != None: 
     1687        if event is not None: 
    16881688            event.Skip() 
    16891689        pos = self.panel.notebook.GetSelection() 
     
    16971697        # I Believe this is no longer used now that we have removed the  
    16981698        # edit menu from the menubar - PDB July 12, 2015 
    1699         if event != None: 
     1699        if event is not None: 
    17001700            event.Skip() 
    17011701        pos = self.panel.notebook.GetSelection() 
     
    17391739            pos = self.panel.notebook.GetSelection() 
    17401740            grid = self.panel.notebook.GetPage(pos) 
    1741             has_data = (grid.data != None and grid.data != {}) 
     1741            has_data = (grid.data is not None and grid.data != {}) 
    17421742            self.open_excel_menu.Enable(has_data) 
    17431743            self.save_menu.Enable(has_data) 
     
    18221822                    path = dlg.GetPath() 
    18231823                dlg.Destroy() 
    1824                 if path != None: 
     1824                if path is not None: 
    18251825                    if self.parent is not None: 
    18261826                        data = grid.get_grid_view() 
     
    20072007                    path = dlg.GetPath() 
    20082008                dlg.Destroy() 
    2009                 if path != None: 
     2009                if path is not None: 
    20102010                    if self.parent is not None and  self.data is not None: 
    20112011                        self.parent.write_batch_tofile(data=self.data, 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py

    r235f514 r7432acb  
    498498        # Update locations 
    499499        self.outer_circle.update() 
    500         # if self.is_inside != None: 
     500        # if self.is_inside is not None: 
    501501        out = self._post_data() 
    502502        return out 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Arc.py

    r235f514 r7432acb  
    7171        x = [] 
    7272        y = [] 
    73         if theta1 != None: 
     73        if theta1 is not None: 
    7474            self.theta1 = theta1 
    75         if theta2 != None: 
     75        if theta2 is not None: 
    7676            self.theta2 = theta2 
    7777        while self.theta2 < self.theta1: 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Edge.py

    r959eb01 r7432acb  
    6363        Draw the new roughness on the graph. 
    6464        """ 
    65         if r1 != None: 
     65        if r1 is not None: 
    6666            self.r1 = r1 
    67         if r2 != None: 
     67        if r2 is not None: 
    6868            self.r2 = r2 
    69         if theta != None: 
     69        if theta is not None: 
    7070            self.theta = theta 
    7171        x1 = self.r1 * math.cos(self.theta) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    rac07a3a r7432acb  
    183183        # So manually recode the size (=x_size) and compare here. 
    184184        # Massy code to work around:< 
    185         if self.parent._mgr != None: 
     185        if self.parent._mgr is not None: 
    186186            max_panel = self.parent._mgr.GetPane(self) 
    187187            if max_panel.IsMaximized(): 
    188188                self.parent._mgr.RestorePane(max_panel) 
    189189                max_panel.Maximize() 
    190         if self.x_size != None: 
     190        if self.x_size is not None: 
    191191            if self.x_size == self.GetSize(): 
    192192                self.resizing = False 
     
    241241                xval = float(active_ctrl.GetValue()) 
    242242                position = self.get_data_xy_vals(xval) 
    243                 if position != None and not self.is_corfunc: 
     243                if position is not None and not self.is_corfunc: 
    244244                    wx.PostEvent(self.parent, StatusEvent(status=position)) 
    245245            except: 
     
    342342                self.q_ctrl = None 
    343343                return 
    344         if self.ly != None and event.xdata != None: 
     344        if self.ly is not None and event.xdata is not None: 
    345345            # Selecting a new line if cursor lines are displayed already 
    346346            dqmin = math.fabs(event.xdata - self.ly[0].get_xdata()) 
     
    364364            return 
    365365        # release a q range vline 
    366         if self.ly != None and not self.leftdown: 
     366        if self.ly is not None and not self.leftdown: 
    367367            for ly in self.ly: 
    368368                ly.set_alpha(0.7) 
     
    372372        if ax is None or not hasattr(event, 'action'): 
    373373            return 
    374         end_drag = event.action != 'drag' and event.xdata != None 
     374        end_drag = event.action != 'drag' and event.xdata is not None 
    375375        nop = len(self.plots) 
    376376        pos_x, _ = float(event.xdata), float(event.ydata) 
     
    514514        ax = event.inaxes 
    515515        PlotPanel.onLeftDown(self, event) 
    516         if ax != None: 
     516        if ax is not None: 
    517517            try: 
    518518                pos_x = float(event.xdata)  # / size_x 
     
    683683 
    684684 
    685         if self.position != None: 
     685        if self.position is not None: 
    686686            wx_id = ids.next() 
    687687            self._slicerpop.Append(wx_id, '&Add Text') 
     
    760760            default_name = default_name.split('.')[0] 
    761761        default_name += "_out" 
    762         if self.parent != None: 
     762        if self.parent is not None: 
    763763            self.parent.save_data1d(data, default_name) 
    764764 
     
    778778            default_name = default_name.split('.')[0] 
    779779        # default_name += "_out" 
    780         if self.parent != None: 
     780        if self.parent is not None: 
    781781            self.parent.show_data1d(data, default_name) 
    782782 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    rac07a3a r7432acb  
    156156        PlotPanel.onLeftDown(self, event) 
    157157        ax = event.inaxes 
    158         if ax != None: 
     158        if ax is not None: 
    159159            # data coordinate position 
    160160            pos_x = "%8.3g" % event.xdata 
     
    264264        # control axis labels from the panel itself 
    265265        yname, yunits = data.get_yaxis() 
    266         if self.yaxis_label != None: 
     266        if self.yaxis_label is not None: 
    267267            yname = self.yaxis_label 
    268268            yunits = self.yaxis_unit 
     
    271271            self.yaxis_unit = yunits 
    272272        xname, xunits = data.get_xaxis() 
    273         if self.xaxis_label != None: 
     273        if self.xaxis_label is not None: 
    274274            xname = self.xaxis_label 
    275275            xunits = self.xaxis_unit 
     
    355355            slicerpop.Append(wx_id, '&Box Averaging in Qy') 
    356356            wx.EVT_MENU(self, wx_id, self.onBoxavgY) 
    357             if self.slicer != None: 
     357            if self.slicer is not None: 
    358358                wx_id = ids.next() 
    359359                slicerpop.Append(wx_id, '&Clear Slicer') 
     
    435435                msg = "Add Text: Error. Check your property values..." 
    436436                logger.error(msg) 
    437                 if self.parent != None: 
     437                if self.parent is not None: 
    438438                    wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    439439        dial.Destroy() 
     
    629629 
    630630        """ 
    631         if self.slicer != None: 
     631        if self.slicer is not None: 
    632632            from SlicerParameters import SlicerParameterPanel 
    633633            dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 
     
    735735        """ 
    736736        event_id = str(evt.GetId()) 
    737         if self.parent != None: 
     737        if self.parent is not None: 
    738738            self._default_save_location = self.parent._default_save_location 
    739739        default_name = self.plots[self.graph.selected_plottable].label 
     
    759759            default_name = default_name.split('.')[0] 
    760760        #default_name += "_out" 
    761         if self.parent != None: 
     761        if self.parent is not None: 
    762762            self.parent.show_data2d(data, default_name) 
    763763 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py

    r235f514 r7432acb  
    362362        self.left_moving = left 
    363363        theta3 = 0 
    364         if phi != None: 
     364        if phi is not None: 
    365365            self.phi = phi 
    366366        if delta is None: 
     
    374374            self.theta = mline.theta + self.phi 
    375375 
    376         if mline != None: 
     376        if mline is not None: 
    377377            if delta != 0: 
    378378                self.theta2 = mline + delta 
     
    538538        """ 
    539539 
    540         if theta != None: 
     540        if theta is not None: 
    541541            self.theta = theta 
    542542        x1 = self.radius * math.cos(self.theta) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/SimplePlot.py

    r959eb01 r7432acb  
    8787            pos = (pos_x, pos_y + 5) 
    8888        self.PopupMenu(slicerpop, pos) 
    89         if self.scale != None: 
     89        if self.scale is not None: 
    9090            self.parent.scale2d = self.scale 
    9191 
     
    106106            self.leftdown = True 
    107107            ax = event.inaxes 
    108             if ax != None: 
     108            if ax is not None: 
    109109                self.xInit, self.yInit = event.xdata, event.ydata 
    110110                try: 
     
    123123        """ 
    124124        self.resizing = False 
    125         if self.x_size != None: 
     125        if self.x_size is not None: 
    126126            if self.x_size == self.GetSize(): 
    127127                self.canvas.set_resizing(self.resizing) 
     
    161161        self.plots[plot.name] = plot 
    162162        # Axis scales 
    163         if plot.xtransform != None: 
     163        if plot.xtransform is not None: 
    164164            self.xLabel = plot.xtransform 
    165         if plot.ytransform != None: 
     165        if plot.ytransform is not None: 
    166166            self.yLabel = plot.ytransform 
    167167        # Init graph 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxMask.py

    r959eb01 r7432acb  
    123123                                         x2=self.vertical_lines.x2, 
    124124                                         width=self.vertical_lines.half_width) 
    125         # if self.is_inside != None: 
     125        # if self.is_inside is not None: 
    126126        out = self._post_data() 
    127127        return out 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py

    r235f514 r7432acb  
    147147        y_max = math.fabs(self.horizontal_lines.y) 
    148148 
    149         if nbins != None: 
     149        if nbins is not None: 
    150150            self.nbins = nbins 
    151151        if self.averager is None: 
     
    357357        """ 
    358358        # # Reset x, y- coordinates if send as parameters 
    359         if x != None: 
     359        if x is not None: 
    360360            self.x = np.sign(self.x) * math.fabs(x) 
    361         if y != None: 
     361        if y is not None: 
    362362            self.y = np.sign(self.y) * math.fabs(y) 
    363363        # # Draw lines and markers 
     
    464464        """ 
    465465        # # reset x, y -coordinates if given as parameters 
    466         if x != None: 
     466        if x is not None: 
    467467            self.x = np.sign(self.x) * math.fabs(x) 
    468         if y != None: 
     468        if y is not None: 
    469469            self.y = np.sign(self.y) * math.fabs(y) 
    470470        # # draw lines and markers 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py

    rd85c194 r7432acb  
    353353            Draw the new roughness on the graph. 
    354354        """ 
    355         if center_x != None: 
     355        if center_x is not None: 
    356356            self.x = center_x 
    357         if center_y != None: 
     357        if center_y is not None: 
    358358            self.y = center_y 
    359359        self.center_marker.set(xdata=[self.x], ydata=[self.y]) 
     
    490490        """ 
    491491        # # save the new height, witdh of the rectangle if given as a param 
    492         if width != None: 
     492        if width is not None: 
    493493            self.half_width = width 
    494         if height != None: 
     494        if height is not None: 
    495495            self.half_height = height 
    496496        # # If new  center coordinates are given draw the rectangle 
    497497        # #given these value 
    498         if center != None: 
     498        if center is not None: 
    499499            self.center_x = center.x 
    500500            self.center_y = center.y 
     
    511511            return 
    512512        # # if x1, y1, y2, y3 are given draw the rectangle with this value 
    513         if x1 != None: 
     513        if x1 is not None: 
    514514            self.x1 = x1 
    515         if x2 != None: 
     515        if x2 is not None: 
    516516            self.x2 = x2 
    517         if y1 != None: 
     517        if y1 is not None: 
    518518            self.y1 = y1 
    519         if y2 != None: 
     519        if y2 is not None: 
    520520            self.y2 = y2 
    521521        # # Draw 2 vertical lines and a marker 
     
    657657        """ 
    658658        # # save the new height, witdh of the rectangle if given as a param 
    659         if width != None: 
     659        if width is not None: 
    660660            self.half_width = width 
    661         if height != None: 
     661        if height is not None: 
    662662            self.half_height = height 
    663663        # # If new  center coordinates are given draw the rectangle 
    664664        # #given these value 
    665         if center != None: 
     665        if center is not None: 
    666666            self.center_x = center.x 
    667667            self.center_y = center.y 
     
    679679            return 
    680680        # # if x1, y1, y2, y3 are given draw the rectangle with this value 
    681         if x1 != None: 
     681        if x1 is not None: 
    682682            self.x1 = x1 
    683         if x2 != None: 
     683        if x2 is not None: 
    684684            self.x2 = x2 
    685         if y1 != None: 
     685        if y1 is not None: 
    686686            self.y1 = y1 
    687         if y2 != None: 
     687        if y2 is not None: 
    688688            self.y2 = y2 
    689689        # # Draw 2 vertical lines and a marker 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/detector_dialog.py

    r235f514 r7432acb  
    155155        self.qmax_ctl.SetLabel(str(format_number(qmax))) 
    156156        self.beam_ctl.SetLabel(str(format_number(beam))) 
    157         if zmin != None: 
     157        if zmin is not None: 
    158158            self.zmin_ctl.SetValue(str(format_number(zmin))) 
    159         if zmax != None: 
     159        if zmax is not None: 
    160160            self.zmax_ctl.SetValue(str(format_number(zmax))) 
    161161 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py

    rac07a3a r7432acb  
    100100        wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 
    101101 
    102         if data != None: 
     102        if data is not None: 
    103103            # Font size 
    104104            kwds = [] 
     
    235235        event.Skip() 
    236236        # from boxMask import BoxMask 
    237         if event != None: 
     237        if event is not None: 
    238238            self._on_clear_slicer(event) 
    239239        self.slicer_z += 1 
     
    336336        """ 
    337337        # the case of liitle numbers of True points 
    338         if len(mask[mask]) < 10 and self.data != None: 
     338        if len(mask[mask]) < 10 and self.data is not None: 
    339339            self.ShowMessage() 
    340340            mask = copy.deepcopy(self.mask) 
     
    355355        temp_data.data[mask == False] = temp_mask[mask == False] 
    356356        self.plotpanel.clear() 
    357         if self.slicer != None: 
     357        if self.slicer is not None: 
    358358            self.slicer.clear() 
    359359            self.slicer = None 
     
    460460        wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 
    461461 
    462         if data != None: 
     462        if data is not None: 
    463463            # Font size 
    464464            kwds = [] 
     
    710710        Status msg 
    711711        """ 
    712         if self.parent.parent.parent != None: 
     712        if self.parent.parent.parent is not None: 
    713713            wx.PostEvent(self.parent.parent.parent, 
    714714                         StatusEvent(status=msg, type=type)) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/profile_dialog.py

    r959eb01 r7432acb  
    4444        wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 
    4545 
    46         if data != None: 
     46        if data is not None: 
    4747            #Font size 
    4848            kwds = [] 
     
    284284            default_name = default_name.split('.')[0] 
    285285        default_name += "_out" 
    286         if self.parent != None: 
     286        if self.parent is not None: 
    287287            # What an ancestor! 
    288288            fit_panel = self.parent.parent.parent 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py

    r235f514 r7432acb  
    9696            self.left_line.update(phi=self.right_line.phi, delta=None, 
    9797                                  mline=self.main_line, side=True, left=False) 
    98         #if self.is_inside != None: 
     98        #if self.is_inside is not None: 
    9999        out = self._post_data() 
    100100        return out 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py

    r235f514 r7432acb  
    114114        self.Layout() 
    115115        psizer = self.parent.GetSizer() 
    116         if psizer != None: 
     116        if psizer is not None: 
    117117            psizer.Layout() 
    118118 
  • src/sas/sasgui/guiframe/plugin_base.py

    rd85c194 r7432acb  
    161161        Sets default frame config 
    162162        """ 
    163         if self.frame != None: 
     163        if self.frame is not None: 
    164164            self.frame.EnableCloseButton(False) 
    165165            self.frame.Show(False) 
     
    230230        old_frame = None 
    231231        old_persp = self.parent.get_current_perspective() 
    232         if old_persp != None: 
     232        if old_persp is not None: 
    233233            old_frame = old_persp.get_frame() 
    234234        self.parent.check_multimode(self) 
     
    236236        self.parent.set_perspective(self.perspective) 
    237237 
    238         if self.frame != None: 
    239             if old_frame != None: 
     238        if self.frame is not None: 
     239            if old_frame is not None: 
    240240                pos_x, pos_y = old_frame.GetPositionTuple() 
    241241                self.frame.SetPosition((pos_x, pos_y)) 
  • src/sas/sasgui/guiframe/startup_configuration.py

    r235f514 r7432acb  
    208208        for key, item in strings.iteritems(): 
    209209            if (key == 'DEFAULT_PERSPECTIVE') or \ 
    210                 (key == 'DEFAULT_OPEN_FOLDER' and item != None): 
     210                (key == 'DEFAULT_OPEN_FOLDER' and item is not None): 
    211211                out_f.write("%s = \"%s\"\n" % (key,str(item))) 
    212212            else: 
  • src/sas/sasgui/guiframe/utils.py

    r959eb01 r7432acb  
    8989    list = [] 
    9090    for item in mylist: 
    91         if re.search(separator,item)!= None: 
     91        if re.search(separator,item)is not None: 
    9292            if n > 0: 
    9393                word = re.split(separator, item, int(n)) 
  • src/sas/sasgui/perspectives/calculator/data_operator.py

    r235f514 r7432acb  
    182182        On data name typing 
    183183        """ 
    184         if event != None: 
     184        if event is not None: 
    185185            event.Skip() 
    186186        item = event.GetEventObject() 
     
    264264        self.put_text_pic(self.data2_pic, content=str(val)) 
    265265        self.check_data_inputs() 
    266         if self.output != None: 
     266        if self.output is not None: 
    267267            self.output.name = str(self.data_namectr.GetValue()) 
    268268        self.draw_output(self.output) 
     
    284284            self.data1_pic.add_image(data) 
    285285        self.check_data_inputs() 
    286         if self.output != None: 
     286        if self.output is not None: 
    287287            self.output.name = str(self.data_namectr.GetValue()) 
    288288        self.draw_output(self.output) 
     
    297297        self.put_text_pic(self.operator_pic, content=text) 
    298298        self.check_data_inputs() 
    299         if self.output != None: 
     299        if self.output is not None: 
    300300            self.output.name = str(self.data_namectr.GetValue()) 
    301301        self.draw_output(self.output) 
     
    329329                data = None 
    330330            item.SetClientData(pos, data) 
    331             if data != None: 
     331            if data is not None: 
    332332                self.check_data_inputs() 
    333333 
    334334            self.put_text_pic(self.data2_pic, content) 
    335335 
    336         if self.output != None: 
     336        if self.output is not None: 
    337337            self.output.name = str(self.data_namectr.GetValue()) 
    338338        self.draw_output(self.output) 
     
    472472        On Focus at this window 
    473473        """ 
    474         if event != None: 
     474        if event is not None: 
    475475            event.Skip() 
    476476        self._data = self.get_datalist() 
     
    534534        ids = self._data.keys() 
    535535        for id in ids: 
    536             if id != None: 
    537                 if self._data[id].data != None: 
     536            if id is not None: 
     537                if self._data[id].data is not None: 
    538538                    dnames.append(self._data[id].data.name) 
    539539                else: 
     
    546546            for datastate in val_list: 
    547547                data = datastate.data 
    548                 if data != None: 
     548                if data is not None: 
    549549                    name = data.name 
    550550                    pos1 = self.data1_cbox.Append(str(name)) 
     
    577577        """ 
    578578        data_manager = self.parent.parent.get_data_manager() 
    579         if data_manager != None: 
     579        if data_manager is not None: 
    580580            return  data_manager.get_all_data() 
    581581        else: 
     
    983983        On close event 
    984984        """ 
    985         if self.manager != None: 
     985        if self.manager is not None: 
    986986            self.manager.data_operator_frame = None 
    987987        self.panel.disconnect_panels() 
  • src/sas/sasgui/perspectives/calculator/density_panel.py

    r235f514 r7432acb  
    438438        On close event 
    439439        """ 
    440         if self.manager != None: 
     440        if self.manager is not None: 
    441441            self.manager.cal_md_frame = None 
    442442        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py

    rac07a3a r7432acb  
    6161    Add icon in the frame 
    6262    """ 
    63     if parent != None: 
     63    if parent is not None: 
    6464        if hasattr(frame, "IsIconized"): 
    6565            if not frame.IsIconized(): 
     
    7474    Set_error dialog 
    7575    """ 
    76     if item != None: 
     76    if item is not None: 
    7777        item.SetBackgroundColour("pink") 
    7878        item.Refresh() 
    7979    if show_msg: 
    8080        msg = "Error: wrong (or out of range) value entered." 
    81         if panel.parent.parent != None: 
     81        if panel.parent.parent is not None: 
    8282            wx.PostEvent(panel.parent.parent, 
    8383                     StatusEvent(status=msg, info='Error')) 
     
    425425        """ 
    426426        unit = 'sec' 
    427         if self.time_text != None: 
     427        if self.time_text is not None: 
    428428            self.time_text.SetForegroundColour('black') 
    429429            etime = self.estimate_ctime() 
     
    633633        self.model.set_sld_data(self.sld_data) 
    634634 
    635         self.draw_button.Enable(self.sld_data != None) 
     635        self.draw_button.Enable(self.sld_data is not None) 
    636636        wx.CallAfter(self.parent.set_sld_data, self.sld_data) 
    637637        self._update_model_params() 
     
    855855        """ 
    856856        flag = self.parent.check_omfpanel_inputs() 
    857         if not flag and self.parent.parent != None: 
     857        if not flag and self.parent.parent is not None: 
    858858            infor = 'Error' 
    859859            msg = 'Error: Wrong inputs in the SLD info panel.' 
     
    865865        self.sld_data = self.parent.get_sld_from_omf() 
    866866        if self.sld_data is None: 
    867             if self.parent.parent != None: 
     867            if self.parent.parent is not None: 
    868868                infor = 'Error' 
    869869                msg = 'Error: No data has been selected.' 
     
    971971        self.bt_compute.SetLabel(label) 
    972972        self.bt_compute.SetToolTipString(label) 
    973         if self.parent.parent != None: 
     973        if self.parent.parent is not None: 
    974974            wx.PostEvent(self.parent.parent, 
    975975                             StatusEvent(status=msg, type=type)) 
     
    995995        for ind in range(len(input[0])): 
    996996            if self.is_avg: 
    997                 if ind % 1 == 0 and update != None: 
     997                if ind % 1 == 0 and update is not None: 
    998998                    update() 
    999999                    time.sleep(0.1) 
     
    10021002                out = np.append(out, outi) 
    10031003            else: 
    1004                 if ind % 50 == 0  and update != None: 
     1004                if ind % 50 == 0  and update is not None: 
    10051005                    update() 
    10061006                    time.sleep(0.001) 
     
    11511151        new_plot.label = new_plot.id 
    11521152        #theory_data = deepcopy(new_plot) 
    1153         if self.parent.parent != None: 
     1153        if self.parent.parent is not None: 
    11541154            self.parent.parent.update_theory(data_id=new_plot.id, 
    11551155                                           theory=new_plot, 
     
    12101210        new_plot.label = new_plot.id 
    12111211        #theory_data = deepcopy(new_plot) 
    1212         if self.parent.parent != None: 
     1212        if self.parent.parent is not None: 
    12131213            self.parent.parent.update_theory(data_id=data.id, 
    12141214                                           theory=new_plot, 
     
    12991299                mz = sld_sets[key] 
    13001300            else: 
    1301                 if sld_sets[key] != None: 
     1301                if sld_sets[key] is not None: 
    13021302                    self.sld_data.set_sldn(sld_sets[key]) 
    13031303        self.sld_data.set_sldms(mx, my, mz) 
     
    13471347            infor = 'Error' 
    13481348            #logger.error(msg) 
    1349             if self.parent.parent != None: 
     1349            if self.parent.parent is not None: 
    13501350                # inform msg to wx 
    13511351                wx.PostEvent(self.parent.parent, 
     
    16901690            data = self.parent.get_sld_data() 
    16911691            fName = os.path.splitext(path)[0] + '.' + extension.split('.')[-1] 
    1692             if data != None: 
     1692            if data is not None: 
    16931693                try: 
    16941694                    reader.write(fName, data) 
     
    16991699                infor = 'Error' 
    17001700                #logger.error(msg) 
    1701                 if self.parent.parent != None: 
     1701                if self.parent.parent is not None: 
    17021702                    # inform msg to wx 
    17031703                    wx.PostEvent(self.parent.parent, 
     
    17081708            msg = "Error occurred while saving. " 
    17091709            infor = 'Error' 
    1710             if self.parent.parent != None: 
     1710            if self.parent.parent is not None: 
    17111711                # inform msg to wx 
    17121712                wx.PostEvent(self.parent.parent, 
     
    17181718        """ 
    17191719        flag = True 
    1720         if event != None: 
     1720        if event is not None: 
    17211721            event.Skip() 
    17221722            ctl = event.GetEventObject() 
     
    17581758        """ 
    17591759        flag = True 
    1760         if event != None: 
     1760        if event is not None: 
    17611761            event.Skip() 
    17621762            ctl = event.GetEventObject() 
     
    19741974        Send full draw to gui frame 
    19751975        """ 
    1976         if self.parent != None: 
     1976        if self.parent is not None: 
    19771977            self.parent.set_schedule_full_draw(panel, func) 
    19781978 
     
    20502050        Close 
    20512051        """ 
    2052         if self.base != None: 
     2052        if self.base is not None: 
    20532053            self.base.gen_frame = None 
    20542054        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/image_viewer.py

    r235f514 r7432acb  
    7070                plot_frame.SetTitle('Picture -- %s --' % basename) 
    7171                plot_frame.Show(True) 
    72                 if parent != None: 
     72                if parent is not None: 
    7373                    parent.put_icon(plot_frame) 
    7474            except: 
     
    403403        output.is_data = True 
    404404        output = reader2D_converter(output) 
    405         if self.base != None: 
     405        if self.base is not None: 
    406406            data = self.base.create_gui_data(output, self.title) 
    407407            self.base.add_data({data.id:data}) 
  • src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py

    r959eb01 r7432acb  
    190190        """ 
    191191        # skip for another event 
    192         if event != None: 
     192        if event is not None: 
    193193            event.Skip() 
    194194        dq = self.dq_name_tcl.GetValue() 
     
    237237        Close event 
    238238        """ 
    239         if self.manager != None: 
     239        if self.manager is not None: 
    240240            self.manager.kiessig_frame = None 
    241241        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/model_editor.py

    r235f514 r7432acb  
    387387        self._msg_box.SetLabel(msg) 
    388388        self._msg_box.SetForegroundColour(color) 
    389         if self.parent.parent != None: 
     389        if self.parent.parent is not None: 
    390390            from sas.sasgui.guiframe.events import StatusEvent 
    391391            wx.PostEvent(self.parent.parent, StatusEvent(status=msg, 
     
    478478        """ 
    479479        # For Mac 
    480         if event != None: 
     480        if event is not None: 
    481481            event.Skip() 
    482482        item = event.GetEventObject() 
     
    979979 
    980980        # Prepare the messagebox 
    981         if self.base != None and not msg: 
     981        if self.base is not None and not msg: 
    982982            self.base.update_custom_combo() 
    983983            # Passed exception in import test as it will fail for sasmodels.sasview_model class 
     
    10021002        self._msg_box.SetForegroundColour(color) 
    10031003        # Send msg to the top window 
    1004         if self.base != None: 
     1004        if self.base is not None: 
    10051005            from sas.sasgui.guiframe.events import StatusEvent 
    10061006            wx.PostEvent(self.base.parent, 
     
    11901190        """ 
    11911191        self.Show(False) 
    1192         #if self.parent != None: 
     1192        #if self.parent is not None: 
    11931193        #    self.parent.new_model_frame = None 
    11941194        #self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/pyconsole.py

    rddbac66 r7432acb  
    118118        self.panel = panel 
    119119        self._add_menu() 
    120         if filename != None: 
     120        if filename is not None: 
    121121            dataDir = os.path.dirname(filename) 
    122         elif self.parent != None: 
     122        elif self.parent is not None: 
    123123            dataDir = self.parent._default_save_location 
    124124        else: 
     
    128128 
    129129        # See if there is a corresponding C file 
    130         if filename != None: 
     130        if filename is not None: 
    131131            c_filename = os.path.splitext(filename)[0] + ".c" 
    132132            if os.path.isfile(c_filename): 
     
    244244 
    245245        # See if there is a corresponding C file 
    246         if result.path != None: 
     246        if result.path is not None: 
    247247            c_filename = os.path.splitext(result.path)[0] + ".c" 
    248248            if os.path.isfile(c_filename): 
     
    303303 
    304304        # Update plugin model list in fitpage combobox 
    305         if success and self._manager != None and self.panel != None: 
     305        if success and self._manager is not None and self.panel is not None: 
    306306            self._manager.set_edit_menu_helper(self.parent) 
    307307            wx.CallAfter(self._manager.update_custom_combo) 
     
    337337        Close event 
    338338        """ 
    339         if self.base != None: 
     339        if self.base is not None: 
    340340            self.base.py_frame = None 
    341341        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py

    r235f514 r7432acb  
    656656            event.Skip() 
    657657        # Clear the plot 
    658         if self.image != None: 
     658        if self.image is not None: 
    659659            self.image.clf() 
    660660            # reset image 
     
    674674        """ 
    675675        # Skip event for next event 
    676         if event != None: 
     676        if event is not None: 
    677677            event.Skip() 
    678678            msg = "Please Check your input values " 
     
    708708            # Validate the wave inputs 
    709709            wave_input = self._validate_q_input(wavelength, wavelength_spread) 
    710             if wave_input != None: 
     710            if wave_input is not None: 
    711711                wavelength, wavelength_spread = wave_input 
    712712 
     
    757757        # Validate the q inputs 
    758758        q_input = self._validate_q_input(self.qx, self.qy) 
    759         if q_input != None: 
     759        if q_input is not None: 
    760760            self.qx, self.qy = q_input 
    761761 
     
    769769 
    770770        # Compute the resolution 
    771         if self.image != None: 
     771        if self.image is not None: 
    772772            #_pylab_helpers.Gcf.set_active(self.fm) 
    773773            _pylab_helpers.Gcf.figs = {} 
     
    982982        """ 
    983983        # skip for another event 
    984         if event != None: 
     984        if event is not None: 
    985985            event.Skip() 
    986986        # init resolution_calculator 
     
    11481148        Set the detector coordinate for sigmas to x-y coordinate 
    11491149        """ 
    1150         if event != None: 
     1150        if event is not None: 
    11511151            event.Skip() 
    11521152        # Set the coordinate in Cartesian 
     
    11601160        Set the detector coordinate for sigmas to polar coordinate 
    11611161        """ 
    1162         if event != None: 
     1162        if event is not None: 
    11631163            event.Skip() 
    11641164        # Set the coordinate in polar 
     
    11811181        self.compute_button.SetLabel(label) 
    11821182        self.compute_button.SetToolTipString(label) 
    1183         if self.parent.parent != None: 
     1183        if self.parent.parent is not None: 
    11841184            wx.PostEvent(self.parent.parent, 
    11851185                         StatusEvent(status=msg, type=type)) 
     
    11961196        On source combobox selection 
    11971197        """ 
    1198         if event != None: 
     1198        if event is not None: 
    11991199            combo = event.GetEventObject() 
    12001200            event.Skip() 
     
    12151215        On source color combobox selection 
    12161216        """ 
    1217         if event != None: 
     1217        if event is not None: 
    12181218            #combo = event.GetEventObject() 
    12191219            event.Skip() 
     
    12531253        On spectrum ComboBox event 
    12541254        """ 
    1255         if event != None: 
     1255        if event is not None: 
    12561256            #combo = event.GetEventObject() 
    12571257            event.Skip() 
     
    13481348        """ 
    13491349        _pylab_helpers.Gcf.figs = {} 
    1350         if self.manager != None: 
     1350        if self.manager is not None: 
    13511351            self.manager.cal_res_frame = None 
    13521352        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/sld_panel.py

    r959eb01 r7432acb  
    504504        On close event 
    505505        """ 
    506         if self.manager != None: 
     506        if self.manager is not None: 
    507507            self.manager.sld_frame = None 
    508508        self.Destroy() 
  • src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py

    r235f514 r7432acb  
    303303        Close event 
    304304        """ 
    305         if self.manager != None: 
     305        if self.manager is not None: 
    306306            self.manager.cal_slit_frame = None 
    307307        self.Destroy() 
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    r1dc8ec9 r7432acb  
    320320        path = None 
    321321        default_save_location = os.getcwd() 
    322         if self._manager.parent != None: 
     322        if self._manager.parent is not None: 
    323323            default_save_location = self._manager.parent.get_save_location() 
    324324 
     
    329329            path = dlg.GetPath() 
    330330            default_save_location = os.path.dirname(path) 
    331             if self._manager.parent != None: 
     331            if self._manager.parent is not None: 
    332332                self._manager.parent._default_save_location = default_save_location 
    333333        else: 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r235f514 r7432acb  
    293293                corstate = self._parse_state(entry) 
    294294 
    295                 if corstate != None: 
     295                if corstate is not None: 
    296296                    sas_entry.meta_data['corstate'] = corstate 
    297297                    sas_entry.filename = corstate.file 
  • src/sas/sasgui/perspectives/fitting/batchfitpage.py

    ree4b3cb r7432acb  
    200200#         self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection() 
    201201#        
    202 #         if self.model != None: 
     202#         if self.model is not None: 
    203203#             self._set_copy_flag(True) 
    204204#             self._set_paste_flag(True) 
    205 #             if self.data != None: 
     205#             if self.data is not None: 
    206206#                 self._set_bookmark_flag(False) 
    207207#                 self._keep.Enable(False) 
     
    225225#  
    226226#              
    227 #         if event != None: 
     227#         if event is not None: 
    228228#             ## post state to fit panel 
    229229#             new_event = PageInfoEvent(page = self) 
     
    254254#         is_modified = False 
    255255#  
    256 #         if self.model != None:            
     256#         if self.model is not None: 
    257257#             ##Check the values 
    258258#             self._check_value_enter( self.fittable_param) 
     
    291291#         else: 
    292292#             #self.btFit.Enable(True) 
    293 #             if self._is_2D() and  self.data != None: 
     293#             if self._is_2D() and  self.data is not None: 
    294294#                 self.btEditMask.Enable(True) 
    295295#  
     
    335335#             self._set_save_flag(False) 
    336336#         else: 
    337 #             if self.model != None: 
     337#             if self.model is not None: 
    338338#                 self._set_bookmark_flag(False) 
    339339#                 self._keep.Enable(False) 
  • src/sas/sasgui/perspectives/fitting/fitting.py

    r235f514 r7432acb  
    302302        Make new model 
    303303        """ 
    304         if self.new_model_frame != None: 
     304        if self.new_model_frame is not None: 
    305305            self.new_model_frame.Show(False) 
    306306            self.new_model_frame.Show(True) 
     
    441441            wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    442442 
    443         if page != None: 
     443        if page is not None: 
    444444            return set_focus_page(page) 
    445445        if caption == "Const & Simul Fit": 
     
    634634            state = self.temp_state[self.state_index] 
    635635            #panel state should have model selection to set_state 
    636             if state.formfactorcombobox != None: 
     636            if state.formfactorcombobox is not None: 
    637637                #set state 
    638638                data = self.parent.create_gui_data(state.data) 
     
    10161016                return False 
    10171017        ## If a thread is already started, stop it 
    1018         #if self.calc_fit!= None and self.calc_fit.isrunning(): 
     1018        #if self.calc_fitis not None and self.calc_fit.isrunning(): 
    10191019        #    self.calc_fit.stop() 
    10201020        msg = "Fitting is in progress..." 
     
    11061106            page = self.fit_panel.add_empty_page() 
    11071107            # add data associated to the page created 
    1108             if page != None: 
     1108            if page is not None: 
    11091109                evt = StatusEvent(status="Page Created", info="info") 
    11101110                wx.PostEvent(self.parent, evt) 
     
    12161216            for item in param: 
    12171217                ## check if constraint 
    1218                 if item[0] != None and item[1] != None: 
     1218                if item[0] is not None and item[1] is not None: 
    12191219                    listOfConstraint.append((item[0], item[1])) 
    12201220        new_model = model 
     
    14571457        cell.value = index 
    14581458 
    1459         if theory_data != None: 
     1459        if theory_data is not None: 
    14601460            #Suucessful fit 
    14611461            theory_data.id = wx.NewId() 
     
    15441544                    #(CallAfter is important to MAC) 
    15451545                    try: 
    1546                         #if res != None: 
     1546                        #if res is not None: 
    15471547                        wx.CallAfter(cpage.onsetValues, res.fitness, 
    15481548                                     res.param_list, 
     
    20102010            if index is None: 
    20112011                index = np.ones(len(data_copy.data), dtype=bool) 
    2012             if weight != None: 
     2012            if weight is not None: 
    20132013                data_copy.err_data = weight 
    20142014            # get rid of zero error points 
     
    20252025            if index is None: 
    20262026                index = np.ones(len(data_copy.y), dtype=bool) 
    2027             if weight != None: 
     2027            if weight is not None: 
    20282028                data_copy.dy = weight 
    20292029            if data_copy.dy is None or data_copy.dy == []: 
  • src/sas/sasgui/perspectives/fitting/model_thread.py

    r235f514 r7432acb  
    5656            self.qmin = 0 
    5757        if self.qmax is None: 
    58             if self.data != None: 
     58            if self.data is not None: 
    5959                newx = math.pow(max(math.fabs(self.data.xmax), 
    6060                                   math.fabs(self.data.xmin)), 2) 
  • src/sas/sasgui/perspectives/fitting/report_dialog.py

    r959eb01 r7432acb  
    3939        self.nimages = len(self.report_list[2]) 
    4040 
    41         if self.report_list[2] != None: 
     41        if self.report_list[2] is not None: 
    4242            # put image path in the report string 
    4343            if len(self.report_list[2]) == 1: 
  • src/sas/sasgui/perspectives/invariant/invariant.py

    r959eb01 r7432acb  
    331331        new_plot.title = self.__data.title 
    332332        # Save theory_data in a state 
    333         if data != None: 
     333        if data is not None: 
    334334            name_head = name.split('-') 
    335335            if name_head[0] == 'Low': 
     
    353353 
    354354        # Save data in a state: but seems to never happen 
    355         if new_plot != None: 
     355        if new_plot is not None: 
    356356            self.invariant_panel.state.data = copy.deepcopy(new_plot) 
    357357        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    r235f514 r7432acb  
    609609            wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    610610        # set a state for this computation for saving 
    611         elif event != None: 
     611        elif event is not None: 
    612612            self._set_compute_state(state='compute') 
    613613            self._set_bookmark_flag(True) 
     
    718718        self._set_preview_flag(True) 
    719719 
    720         if event != None: 
     720        if event is not None: 
    721721            self._set_preview_flag(True) 
    722722            self._set_save_flag(True) 
     
    10221022        self.state.saved_state['state_num'] = 0 
    10231023        self.state.saved_state['compute_num'] = 0 
    1024         if self._data != None: 
     1024        if self._data is not None: 
    10251025            self.state.saved_state['file'] = str(self._data.name) 
    10261026        else: 
     
    12441244        # Ask the user the location of the file to write to. 
    12451245        path = None 
    1246         if self.parent != None: 
     1246        if self.parent is not None: 
    12471247            self._default_save_location = self.parent.get_save_location() 
    12481248        if self._default_save_location is None: 
     
    12541254            path = dlg.GetPath() 
    12551255            self._default_save_location = os.path.dirname(path) 
    1256             if self.parent != None: 
     1256            if self.parent is not None: 
    12571257                self.parent._default_save_location = \ 
    12581258                    self._default_save_location 
     
    13931393        Enable and disable the power value editing 
    13941394        """ 
    1395         if event != None: 
     1395        if event is not None: 
    13961396            self._set_bookmark_flag(True) 
    13971397            self._set_preview_flag(False) 
     
    14111411        Disable or enable some button if the user enable low q extrapolation 
    14121412        """ 
    1413         if event != None: 
     1413        if event is not None: 
    14141414            self._set_bookmark_flag(True) 
    14151415            self._set_preview_flag(False) 
     
    14381438        Enable editing power law section at low q range 
    14391439        """ 
    1440         if event != None: 
     1440        if event is not None: 
    14411441            self._set_bookmark_flag(True) 
    14421442            self._set_preview_flag(False) 
     
    15371537        Enable and disable the power value editing 
    15381538        """ 
    1539         if event != None: 
     1539        if event is not None: 
    15401540            self._set_bookmark_flag(True) 
    15411541 
     
    15541554        Disable or enable some button if the user enable high q extrapolation 
    15551555        """ 
    1556         if event != None: 
     1556        if event is not None: 
    15571557            self._set_bookmark_flag(True) 
    15581558            self._set_preview_flag(False) 
  • src/sas/sasgui/perspectives/invariant/invariant_state.py

    r235f514 r7432acb  
    281281        # File name 
    282282        element = newdoc.createElement("filename") 
    283         if self.file != None and self.file != '': 
     283        if self.file is not None and self.file != '': 
    284284            element.appendChild(newdoc.createTextNode(str(self.file))) 
    285285        else: 
     
    734734                    # invstate could be None when .svs file is loaded 
    735735                    # in this case, skip appending to output 
    736                     if invstate != None: 
     736                    if invstate is not None: 
    737737                        sas_entry.meta_data['invstate'] = invstate 
    738738                        sas_entry.filename = invstate.file 
  • src/sas/sasgui/perspectives/pr/inversion_panel.py

    r235f514 r7432acb  
    271271        # Ask the user the location of the file to write to. 
    272272        path = None 
    273         if self.parent != None: 
     273        if self.parent is not None: 
    274274            self._default_save_location = self.parent._default_save_location 
    275275        dlg = wx.FileDialog(self, "Choose a file", 
     
    279279            path = dlg.GetPath() 
    280280            self._default_save_location = os.path.dirname(path) 
    281             if self.parent != None: 
     281            if self.parent is not None: 
    282282                self.parent._default_save_location = self._default_save_location 
    283283        else: 
  • src/sas/sasgui/perspectives/pr/inversion_state.py

    r959eb01 r7432acb  
    473473                    #prstate could be None when .svs file is loaded 
    474474                    #in this case, skip appending to output 
    475                     if prstate != None: 
     475                    if prstate is not None: 
    476476                        sas_entry.meta_data['prstate'] = prstate 
    477477                        sas_entry.filename = prstate.file 
  • src/sas/sasgui/perspectives/pr/pr.py

    rac07a3a r7432acb  
    721721 
    722722        # If a thread is already started, stop it 
    723         if self.calc_thread != None and self.calc_thread.isrunning(): 
     723        if self.calc_thread is not None and self.calc_thread.isrunning(): 
    724724            self.calc_thread.stop() 
    725725            ## stop just raises the flag -- the thread is supposed to 
     
    11291129 
    11301130        # If a thread is already started, stop it 
    1131         if self.estimation_thread != None and \ 
     1131        if self.estimation_thread is not None and \ 
    11321132            self.estimation_thread.isrunning(): 
    11331133            self.estimation_thread.stop() 
     
    11591159 
    11601160        # If a thread is already started, stop it 
    1161         if self.estimation_thread != None and self.estimation_thread.isrunning(): 
     1161        if self.estimation_thread is not None and self.estimation_thread.isrunning(): 
    11621162            self.estimation_thread.stop() 
    11631163            ## stop just raises the flag -- the thread is supposed to 
  • src/sas/sasgui/perspectives/simulation/simulation.py

    r959eb01 r7432acb  
    213213         
    214214        # If a computation thread is running, stop it 
    215         if self.calc_thread_1D != None and self.calc_thread_1D.isrunning(): 
     215        if self.calc_thread_1D is not None and self.calc_thread_1D.isrunning(): 
    216216            self.calc_thread_1D.stop() 
    217217            ## stop just raises the flag -- the thread is supposed to  
  • src/sas/sasgui/plottools/PlotPanel.py

    r235f514 r7432acb  
    154154        self.selectedText = None 
    155155        #User scale 
    156         if xtransform != None: 
     156        if xtransform is not None: 
    157157            self.xLabel = xtransform 
    158158        else: 
    159159            self.xLabel = "log10(x)" 
    160         if ytransform != None: 
     160        if ytransform is not None: 
    161161            self.yLabel = ytransform 
    162162        else: 
     
    360360                    return 
    361361 
    362             if ax != None: 
     362            if ax is not None: 
    363363                self.xInit, self.yInit = event.xdata, event.ydata 
    364364                try: 
     
    392392        Set legend alpha 
    393393        """ 
    394         if self.legend != None: 
     394        if self.legend is not None: 
    395395            self.legend.legendPatch.set_alpha(alpha) 
    396396 
     
    461461            # User has clicked on text and is dragging 
    462462            ax = event.inaxes 
    463             if ax != None: 
     463            if ax is not None: 
    464464                # Only move text if mouse is within axes 
    465465                self.selectedText.set_position((event.xdata, event.ydata)) 
     
    476476        if self.leftdown == True and self.mousemotion == True: 
    477477            ax = event.inaxes 
    478             if ax != None:  # the dragging is perform inside the figure 
     478            if ax is not None:  # the dragging is perform inside the figure 
    479479                self.xFinal, self.yFinal = event.xdata, event.ydata 
    480480                # Check whether this is the first point 
     
    576576        step = event.step 
    577577 
    578         if ax != None: 
     578        if ax is not None: 
    579579            # Event occurred inside a plotting area 
    580580            lo, hi = ax.get_xlim() 
     
    935935        # reset postion 
    936936        self.position = None 
    937         if self.graph.selected_plottable != None: 
     937        if self.graph.selected_plottable is not None: 
    938938            self.graph.selected_plottable = None 
    939939 
     
    959959                                              prop=FontProperties(size=10), 
    960960                                              loc=self.legendLoc) 
    961             if self.legend != None: 
     961            if self.legend is not None: 
    962962                self.legend.set_picker(self.legend_picker) 
    963963                self.legend.set_axes(self.subplot) 
     
    989989                                          prop=FontProperties(size=10), 
    990990                                          loc=self.legendLoc) 
    991         if self.legend != None: 
     991        if self.legend is not None: 
    992992            self.legend.set_picker(self.legend_picker) 
    993993            self.legend.set_axes(self.subplot) 
     
    10101010        pos_x = 0 
    10111011        pos_y = 0 
    1012         if self.position != None: 
     1012        if self.position is not None: 
    10131013            pos_x, pos_y = self.position 
    10141014        else: 
     
    10351035                    self.subplot.figure.canvas.draw_idle() 
    10361036            except: 
    1037                 if self.parent != None: 
     1037                if self.parent is not None: 
    10381038                    msg = "Add Text: Error. Check your property values..." 
    10391039                    wx.PostEvent(self.parent, StatusEvent(status=msg)) 
     
    10691069            self.xaxis_tick = xaxis_font 
    10701070 
    1071         if self.data != None: 
     1071        if self.data is not None: 
    10721072            # 2D 
    10731073            self.xaxis(self.xaxis_label, self.xaxis_unit, \ 
     
    11161116            self.yaxis_tick = yaxis_font 
    11171117 
    1118         if self.data != None: 
     1118        if self.data is not None: 
    11191119            # 2D 
    11201120            self.yaxis(self.yaxis_label, self.yaxis_unit, \ 
     
    11551155                label_temp = textdial.getText() 
    11561156                if label_temp.count("\%s" % "\\") > 0: 
    1157                     if self.parent != None: 
     1157                    if self.parent is not None: 
    11581158                        msg = "Add Label: Error. Can not use double '\\' " 
    11591159                        msg += "characters..." 
     
    11621162                    label = label_temp 
    11631163            except: 
    1164                 if self.parent != None: 
     1164                if self.parent is not None: 
    11651165                    msg = "Add Label: Error. Check your property values..." 
    11661166                    wx.PostEvent(self.parent, StatusEvent(status=msg)) 
     
    11801180        num_text = len(self.textList) 
    11811181        if num_text < 1: 
    1182             if self.parent != None: 
     1182            if self.parent is not None: 
    11831183                msg = "Remove Text: Nothing to remove.  " 
    11841184                wx.PostEvent(self.parent, StatusEvent(status=msg)) 
     
    11901190            text_remove = txt.get_text() 
    11911191            txt.remove() 
    1192             if self.parent != None: 
     1192            if self.parent is not None: 
    11931193                msg = "Removed Text: '%s'. " % text_remove 
    11941194                wx.PostEvent(self.parent, StatusEvent(status=msg)) 
    11951195        except: 
    1196             if self.parent != None: 
     1196            if self.parent is not None: 
    11971197                msg = "Remove Text: Error occurred. " 
    11981198                wx.PostEvent(self.parent, StatusEvent(status=msg)) 
     
    12501250                                        prop=FontProperties(size=10), 
    12511251                                        loc=self.legendLoc) 
    1252                 if self.legend != None: 
     1252                if self.legend is not None: 
    12531253                    self.legend.set_picker(self.legend_picker) 
    12541254                    self.legend.set_axes(self.subplot) 
     
    12791279        if font: 
    12801280            self.subplot.set_xlabel(label, fontproperties=font, color=color) 
    1281             if t_font != None: 
     1281            if t_font is not None: 
    12821282                for tick in self.subplot.xaxis.get_major_ticks(): 
    12831283                    tick.label.set_fontproperties(t_font) 
     
    13001300        if font: 
    13011301            self.subplot.set_ylabel(label, fontproperties=font, color=color) 
    1302             if t_font != None: 
     1302            if t_font is not None: 
    13031303                for tick_label in self.subplot.get_yticklabels(): 
    13041304                    tick_label.set_fontproperties(t_font) 
     
    13271327        from plottable_interactor import PointInteractor 
    13281328        p = PointInteractor(self, self.subplot, zorder=zorder, id=id) 
    1329         if p.markersize != None: 
     1329        if p.markersize is not None: 
    13301330            markersize = p.markersize 
    13311331        p.points(x, y, dx=dx, dy=dy, color=color, symbol=symbol, zorder=zorder, 
     
    13631363 
    13641364        # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 
    1365         if dx != None and type(dx) == type(()): 
     1365        if dx is not None and type(dx) == type(()): 
    13661366            dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 
    1367         if dy != None and type(dy) == type(()): 
     1367        if dy is not None and type(dy) == type(()): 
    13681368            dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 
    13691369        if dx is None and dy is None: 
     
    17721772            # control axis labels from the panel itself 
    17731773            yname, yunits = item.get_yaxis() 
    1774             if self.yaxis_label != None: 
     1774            if self.yaxis_label is not None: 
    17751775                yname = self.yaxis_label 
    17761776                yunits = self.yaxis_unit 
     
    17791779                self.yaxis_unit = yunits 
    17801780            xname, xunits = item.get_xaxis() 
    1781             if self.xaxis_label != None: 
     1781            if self.xaxis_label is not None: 
    17821782                xname = self.xaxis_label 
    17831783                xunits = self.xaxis_unit 
  • src/sas/sasgui/plottools/TextDialog.py

    r959eb01 r7432acb  
    4141        style_box = wx.BoxSizer(wx.HORIZONTAL) 
    4242        # tcA 
    43         if unit != None: 
     43        if unit is not None: 
    4444            styles = wx.TAB_TRAVERSAL 
    4545            height = -1 
     
    130130                       0, wx.TOP, 5) 
    131131        family_box.Add(self.font_size, 0, 0) 
    132         if unit_box != None: 
     132        if unit_box is not None: 
    133133            family_box.Add((_BOX_WIDTH / 2, -1)) 
    134134            family_box.Add(tick_label_text, 0, 0) 
     
    159159        text_box.Add(self.text_string) 
    160160        vbox.Add(text_box, 0, wx.EXPAND, 15) 
    161         if unit_box != None: 
     161        if unit_box is not None: 
    162162            unit_box.Add(unit_text, 0, 0) 
    163163            unit_box.Add(self.unit_ctrl, 0, 0) 
  • src/sas/sasgui/plottools/arrow3d.py

    r959eb01 r7432acb  
    2929        self.base = base 
    3030 
    31         if base != None: 
     31        if base is not None: 
    3232            # To turn the updating off during dragging 
    3333            base.canvas.mpl_connect('button_press_event', self.on_left_down) 
  • src/sas/sasgui/plottools/canvas.py

    r463e7ffc r7432acb  
    153153        """ 
    154154        self.panel.subplot.grid(self.panel.grid_on) 
    155         if self.panel.legend != None and self.panel.legend_pos_loc: 
     155        if self.panel.legend is not None and self.panel.legend_pos_loc: 
    156156            self.panel.legend._loc = self.panel.legend_pos_loc 
    157157        self.idletimer.Restart(5, *args, **kwargs)  # Delay by 5 ms 
  • src/sas/sasgui/plottools/fitDialog.py

    r235f514 r7432acb  
    579579                    self.I0_tctr.SetValue(format_number(val)) 
    580580            if self.Rgerr_tctr.IsShown(): 
    581                 if rg != None and rg != 0: 
     581                if rg is not None and rg != 0: 
    582582                    value = format_number(3 * float(errA) / (2 * rg)) 
    583583                else: 
     
    593593                self.Diameter_tctr.SetValue(value) 
    594594            if self.Diametererr_tctr.IsShown(): 
    595                 if rg != None and rg != 0: 
     595                if rg is not None and rg != 0: 
    596596                    value = format_number(8 * float(errA) / _diam) 
    597597                else: 
  • src/sas/sasgui/plottools/plottable_interactor.py

    rac07a3a r7432acb  
    5656            markersize = self.markersize 
    5757        # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 
    58         if dx != None and type(dx) == type(()): 
     58        if dx is not None and type(dx) == type(()): 
    5959            dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 
    60         if dy != None and type(dy) == type(()): 
     60        if dy is not None and type(dy) == type(()): 
    6161            dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 
    6262 
  • src/sas/sasgui/plottools/plottables.py

    rac07a3a r7432acb  
    682682        has_err_y = not (dy is None or len(dy) == 0) 
    683683 
    684         if(x != None) and (y != None): 
     684        if(x is not None) and (y is not None): 
    685685            if not dx is None and not len(dx) == 0 and not len(x) == len(dx): 
    686686                msg = "Plottable.View: Given x and dx are not" 
     
    864864        if self.dy is None: 
    865865            self.dy = np.zeros(len(self.y)) 
    866         if xmin != None and xmax != None: 
     866        if xmin is not None and xmax is not None: 
    867867            for i in range(len(self.x)): 
    868868                if self.x[i] >= xmin and self.x[i] <= xmax: 
  • src/sas/sasgui/plottools/transform.py

    r235f514 r7432acb  
    188188 
    189189    """ 
    190     if  dx != None: 
     190    if  dx is not None: 
    191191        err = 2 * x * dx 
    192192        return math.fabs(err) 
     
    204204    """ 
    205205    if x > 0: 
    206         if dx != None: 
     206        if dx is not None: 
    207207            err = dx / (2 * math.sqrt(x)) 
    208208        else: 
     
    222222 
    223223    """ 
    224     if dx != None: 
     224    if dx is not None: 
    225225        err = 4 * math.pow(x, 3) * dx 
    226226        return math.fabs(err) 
     
    238238    """ 
    239239    if x > 0: 
    240         if dx != None: 
     240        if dx is not None: 
    241241            err = dx / (4 * math.pow(x, 3 / 4)) 
    242242        else: 
Note: See TracChangeset for help on using the changeset viewer.