Changeset 7432acb in sasview for src/sas/sasgui/perspectives


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/perspectives
Files:
23 edited

Legend:

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