Commit a5130a0e authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

adjusted configuration file reading function

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4356
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 74584d55
......@@ -110,7 +110,50 @@ def help():
# -----------------------------------------------------------------------------
class Converter():
pass
"""
Abstract converter base class for section dictionaries.
"""
def __init__(self, sectionDict):
self.sectionDict = sectionDict
self.line = ''
def covert(self)
"""
Abstract function
"""
self.convertDict(self)
def convertDict(self):
raise NotImplementedError("function must be defined!")
def __str__(self)
"""
String representation of converted section dictionary.
"""
return "{0}".format(self.line)
class MailConverter(Converter):
"""
Class which implements a mail section dictionary converter
"""
def convertDict(self):
line =
self.line =
class BackupConverter(Converter):
"""
Class which implements a backup section dictionary converter
"""
def convertDict(self):
class TestConverter(Converter):
"""
Class which implements a test section dictionary converter
"""
def convertDict(self):
# -----------------------------------------------------------------------------
class Processor():
......@@ -137,9 +180,14 @@ class Processor():
# fetch mail section
if self.config.has_section('mail'):
try:
self.mail['addresses'] = self.config.get('addresses').split(',')
self.mail['addresses'] = [add.strip() \
for add in self.mail['addresses']]
self.mail['receivers'] = \
self.config.get('mail', 'receivers').split(',')
self.mail['receivers'] = [add.strip() \
for add in self.mail['receivers']]
self.mail['sender'] = self.config.get('mail', 'sender')
self.mail['host'] = self.config.get('mail', 'host')
self.mail['username'] = self.config.get('mail', 'username')
self.mail['password'] = self.config.get('mail', 'password')
if self.config.has_option('mail', 'logging'):
self.mail['logging'] = self.config.getboolean('mail', 'logging')
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment