Files
DMARCReceiver/dmarcreceiver/config.py
2020-01-22 18:02:35 -05:00

16 lines
425 B
Python

class _Config(dict):
def read_file(self, f):
for line in f:
line = line.strip()
if line.find('#') != -1:
line = line[:line.find('#')]
if line.find('=') != -1:
name, value = line.split('=', 1)
name = name.strip()
value = value.strip()
self[name] = value
config = _Config()
__all__ = [ 'config' ]