Changes between Version 3 and Version 4 of PythonScriptForParsingSettings


Ignore:
Timestamp:
12/23/2009 01:31:11 AM (6 years ago)
Author:
bugmenot
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PythonScriptForParsingSettings

    v3 v4  
    4545#       ini.get('KEY', defaultvalue)    if a key has been delete, it'll also can be returned
    4646#       ini.keys()              omit the key deleted
    47 #       ini.has_key('KEY')      omit the key deleted
     47#       'KEY' in ini            omit the key deleted
    4848#       ini.get_obj('KEY')      can also get a delete obj
    4949#       ini.save(filename or fileobj)   saving the result to file
     
    159159                x, y = b.span(2)
    160160                if deleteflag:
    161                     x = x + 1
     161                    x += 1
    162162                value = value.strip()
    163163                obj = Node(self, key, value, lines, span=(0, x+len(value)), delete=deleteflag)
     
    166166                if value == '(':
    167167                    s = ['(']
    168                     while 1:
     168                    while True:
    169169                        line = f.next().rstrip()
    170170                        if line.startswith('#') and deleteflag:
     
    272272        return [obj.value for obj in self.items.values()]
    273273   
    274     def has_key(self, name):
    275         return self._items.has_key(name)
     274    def __contains__(self, name):
     275        return name in self._items
    276276   
    277277    def save(self, filename=None, encoding='utf-8'):
Back to Top