Make /python/CFDataFile.py work on both Python 2.x and Python 3.x with no need to run 2to3 for the python 3.x users.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11459 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
d037e074c6
commit
ae645b58e3
|
@ -79,7 +79,7 @@ class CFDataFile:
|
||||||
else:
|
else:
|
||||||
header = dic['#']
|
header = dic['#']
|
||||||
del dic['#']
|
del dic['#']
|
||||||
index = dic.keys()
|
index = list(dic.keys())
|
||||||
index.sort()
|
index.sort()
|
||||||
contents = '#|%s\n' %('|'.join(header))
|
contents = '#|%s\n' %('|'.join(header))
|
||||||
file.write(contents)
|
file.write(contents)
|
||||||
|
@ -150,7 +150,7 @@ class CFData:
|
||||||
|
|
||||||
def get_keys(self):
|
def get_keys(self):
|
||||||
'''returns a sorted list of the primary keys (usually names) in the datafile'''
|
'''returns a sorted list of the primary keys (usually names) in the datafile'''
|
||||||
keys = self.datadb.keys()
|
keys = list(self.datadb.keys())
|
||||||
keys.remove('#')
|
keys.remove('#')
|
||||||
keys.sort()
|
keys.sort()
|
||||||
return keys
|
return keys
|
||||||
|
|
Loading…
Reference in New Issue