Ignore:
Timestamp:
Apr 9, 2017 5:46:10 AM (8 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:
ac07a3a
Parents:
5b2b04d
Message:

MAINT: replace '== None' by 'is None'

Location:
src/sas/sasgui/perspectives/invariant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    r959eb01 r235f514  
    240240        """ 
    241241 
    242         if state == None and data == None: 
     242        if state is None and data is None: 
    243243            self.state = IState() 
    244         elif state == None or data == None: 
     244        elif state is None or data is None: 
    245245            return 
    246246        else: 
     
    604604        compute invariant 
    605605        """ 
    606         if self._data == None: 
     606        if self._data is None: 
    607607            msg = "\n\nData must be loaded first in order" 
    608608            msg += " to perform a compution..." 
     
    792792        : param state_num: the given state number 
    793793        """ 
    794         if state_num == None: 
     794        if state_num is None: 
    795795            return 
    796796 
     
    924924        :param event: rb/cb event 
    925925        """ 
    926         if event == None: 
     926        if event is None: 
    927927            return 
    928928        obj = event.GetEventObject() 
     
    934934 
    935935        try: 
    936             if value == None or value.lstrip().rstrip() == '': 
     936            if value is None or value.lstrip().rstrip() == '': 
    937937                value = 'None' 
    938938            setattr(self.state, name, str(value)) 
     
    10131013        Used in 'set_current_data()' 
    10141014        """ 
    1015         #if data == None: return 
     1015        #if data is None: return 
    10161016        #temp_state = self.state.clone_state() 
    10171017        #copy.deepcopy(self.state.saved_state) 
     
    10491049 
    10501050        """ 
    1051         if self._data == None: 
     1051        if self._data is None: 
    10521052            return 
    10531053        # check if this event is from do/undo button 
     
    10721072        # try to add new state of the text changes in the state_list 
    10731073        try: 
    1074             if value.strip() == None: 
     1074            if value.strip() is None: 
    10751075                value = '' 
    10761076            setattr(self.state, name, str(value)) 
     
    11401140        the popup menu on bookmark context menu event 
    11411141        """ 
    1142         if self._data == None: 
     1142        if self._data is None: 
    11431143            return 
    1144         if event == None: 
     1144        if event is None: 
    11451145            return 
    11461146        self.bookmark_num += 1 
     
    12061206        : event: popUpMenu event 
    12071207        """ 
    1208         if event == None: 
     1208        if event is None: 
    12091209            return 
    12101210        # get the object 
     
    12461246        if self.parent != None: 
    12471247            self._default_save_location = self.parent.get_save_location() 
    1248         if self._default_save_location == None: 
     1248        if self._default_save_location is None: 
    12491249            self._default_save_location = os.getcwd() 
    12501250        dlg = wx.FileDialog(self, "Choose a file", 
  • src/sas/sasgui/perspectives/invariant/invariant_state.py

    r463e7ffc r235f514  
    787787            raise RuntimeError, msg 
    788788        # make sure title and data run is filled up. 
    789         if datainfo.title == None or datainfo.title == '': 
     789        if datainfo.title is None or datainfo.title == '': 
    790790            datainfo.title = datainfo.name 
    791         if datainfo.run_name == None or datainfo.run_name == {}: 
     791        if datainfo.run_name is None or datainfo.run_name == {}: 
    792792            datainfo.run = [str(datainfo.name)] 
    793793            datainfo.run_name[0] = datainfo.name 
Note: See TracChangeset for help on using the changeset viewer.