1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

Fix creating settings file on Linux.

This commit is contained in:
Jonathan Harris 2015-06-13 17:27:46 +01:00
parent 5f05f7216a
commit b96c5bc88b

View File

@ -195,23 +195,23 @@ class Config:
try:
self.config.readfp(codecs.open(self.filename, 'r', 'utf-8'))
except:
self.config.add_section('DEFAULT')
self.config.add_section('config')
if not self.get('outdir') or not isdir(self.get('outdir')):
self.set('outdir', expanduser('~'))
def set(self, key, val):
self.config.set('DEFAULT', key, val)
self.config.set('config', key, val)
def get(self, key):
try:
return self.config.get('DEFAULT', key) # all values are stored as strings
return self.config.get('config', key) # all values are stored as strings
except:
return None
def getint(self, key):
try:
return int(self.config.get('DEFAULT', key)) # all values are stored as strings
return int(self.config.get('config', key)) # all values are stored as strings
except:
return 0