mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-11-15 07:10:22 +01:00
17 lines
367 B
Python
17 lines
367 B
Python
import os.path
|
|
|
|
def read_config_file(fname):
|
|
settings = {}
|
|
|
|
if not os.path.isfile(fname):
|
|
return settings
|
|
|
|
with open(fname, 'r') as f:
|
|
for line in f:
|
|
slist = line.split('=', 1)
|
|
if len(slist) >= 2:
|
|
prefix, suffix = slist
|
|
settings[prefix.strip()] = suffix.strip()
|
|
|
|
return settings
|