Initial import
This commit is contained in:
15
dmarcreceiver/config.py
Normal file
15
dmarcreceiver/config.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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' ]
|
||||
Reference in New Issue
Block a user