Ignore:
Timestamp:
Apr 9, 2017 8:09:12 AM (8 years ago)
Author:
GitHub <noreply@…>
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:
fca1f50
Parents:
5b2b04d (diff), 45dffa69 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Butler <butlerpd@…> (04/09/17 08:09:12)
git-committer:
GitHub <noreply@…> (04/09/17 08:09:12)
Message:

Merge pull request #67 from andyfaff/is_none

MAINT: use 'is None' instead of '== None'

File:
1 edited

Legend:

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

    r959eb01 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 
     
    212212        On Qmin Qmax vertical line event 
    213213        """ 
    214         if event == None: 
     214        if event is None: 
    215215            return 
    216216        event.Skip() 
    217217        active_ctrl = event.active 
    218         if active_ctrl == None: 
     218        if active_ctrl is None: 
    219219            return 
    220220        if hasattr(event, 'is_corfunc'): 
     
    231231                colors.append('purple') 
    232232                values.append(min(x_data.max(), float(ctrl[2].GetValue()))) 
    233             if self.ly == None: 
     233            if self.ly is None: 
    234234                self.ly = [] 
    235235                for c, v in zip(colors, values): 
     
    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: 
     
    336336        if hasattr(event, "action"): 
    337337            dclick = event.action == 'dclick' 
    338             if ax == None or dclick: 
     338            if ax is None or dclick: 
    339339                # remove the vline 
    340340                self._check_zoom_plot() 
     
    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()) 
     
    361361        Move the cursor line to write Q range 
    362362        """ 
    363         if self.q_ctrl == None: 
     363        if self.q_ctrl is None: 
    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) 
     
    370370            return 
    371371        ax = event.inaxes 
    372         if ax == None or not hasattr(event, 'action'): 
     372        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 
     
    618618            # add menu of other plugins 
    619619            item_list = self.parent.get_current_context_menu(self) 
    620             if (not item_list == None) and (not len(item_list) == 0): 
     620            if (item_list is not None) and (len(item_list)): 
    621621                for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 
    622  
    623622                    try: 
    624623                        plot_menu.Append(wx_id, item[0], name) 
     
    684683 
    685684 
    686         if self.position != None: 
     685        if self.position is not None: 
    687686            wx_id = ids.next() 
    688687            self._slicerpop.Append(wx_id, '&Add Text') 
     
    761760            default_name = default_name.split('.')[0] 
    762761        default_name += "_out" 
    763         if self.parent != None: 
     762        if self.parent is not None: 
    764763            self.parent.save_data1d(data, default_name) 
    765764 
     
    779778            default_name = default_name.split('.')[0] 
    780779        # default_name += "_out" 
    781         if self.parent != None: 
     780        if self.parent is not None: 
    782781            self.parent.show_data1d(data, default_name) 
    783782 
     
    811810        curr_label = self.appearance_selected_plot.label 
    812811 
    813         if curr_color == None: 
     812        if curr_color is None: 
    814813            curr_color = self._color_labels['Blue'] 
    815814            curr_symbol = 13 
Note: See TracChangeset for help on using the changeset viewer.