Ignore:
Timestamp:
20 Nov 2012, 11:16:38 (12 years ago)
Author:
Henrik Bettermann
Message:

Replace 'has_key' by 'in'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/batching.py

    r9269 r9701  
    146146        errs, inv_errs, conv_dict =  converter.fromStringDict(
    147147            row, self.factory_name, mode=mode)
    148         if row.has_key('transition') and row.has_key('state'):
     148        if 'transition' in row and 'state' in row:
    149149            if row['transition'] not in (IGNORE_MARKER, '') and \
    150150                row['state'] not in (IGNORE_MARKER, ''):
    151151                errs.append(('workflow','not allowed'))
    152152                return errs, inv_errs, conv_dict
    153         if row.has_key('transition'):
     153        if 'transition' in row:
    154154            if row['transition'] not in IMPORTABLE_TRANSITIONS:
    155155                if row['transition'] not in (IGNORE_MARKER, ''):
    156156                    errs.append(('transition','not allowed'))
    157         if row.has_key('state'):
     157        if 'state' in row:
    158158            if row['state'] not in IMPORTABLE_STATES:
    159159                if row['state'] not in (IGNORE_MARKER, ''):
     
    188188        # Update state
    189189        # Attention: When importing states the counters remain unchanged.
    190         if row.has_key('state'):
     190        if 'state' in row:
    191191            state = row.get('state', IGNORE_MARKER)
    192192            if state not in (IGNORE_MARKER, ''):
     
    198198            row.pop('state')
    199199        # Trigger transition. Counters are properly changed.
    200         if row.has_key('transition'):
     200        if 'transition' in row:
    201201            transition = row.get('transition', IGNORE_MARKER)
    202202            if transition not in (IGNORE_MARKER, ''):
     
    209209        # random_num string to avoid annoying automatic number transformation
    210210        # by Excel or Calc
    211         if row.has_key('random_num'):
     211        if 'random_num' in row:
    212212            random_num = row.get('random_num', IGNORE_MARKER)
    213213            if random_num not in (IGNORE_MARKER, ''):
Note: See TracChangeset for help on using the changeset viewer.