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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.