mirror of
https://gitlab.com/gaelysam/mapgen_rivers.git
synced 2024-11-14 06:40:21 +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
|