Skip to content
Snippets Groups Projects
Commit 70d83bba authored by Peters, Wouter's avatar Peters, Wouter
Browse files

needed minor update

parent faf9475a
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -131,12 +131,12 @@ def get_countrydict():
import mysettings
import os
file=os.path.join(mysettings.pylibdir,'datasets','country_dictionary.dat')
file=os.path.join('country_dictionary.dat')
try:
countrydict = cPickle.load(open(file,'rb'))
except:
db=dbf.Dbf(os.path.join(mysettings.pylibdir,'datasets/GRIDCTRY.DBF'))
db=dbf.Dbf(os.path.join('GRIDCTRY.DBF'))
countrydict={}
for n,rec in enumerate(db):
......@@ -172,9 +172,10 @@ def get_countrydict():
countrydict[code]=a
dummy = cPickle.dump(countrydict,open(file,'wb'),-1)
db.close()
dummy = cPickle.dump(countrydict,open(file,'wb'),-1)
return countrydict
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment