Ignore:
Timestamp:
Apr 9, 2017 6: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/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() 
Note: See TracChangeset for help on using the changeset viewer.