Added email messaging

This commit is contained in:
2013-07-20 20:58:29 +10:00
parent 00de89d02c
commit f0ac96de94
7 changed files with 105 additions and 9 deletions

View File

@@ -231,7 +231,7 @@ class Settings:
# just returns what is input
def getshow(self, showname):
"""
Get the InputDirectory setting for the show, showname.
Get the name of the show, showname.
"""
showsection = self.__getshowsubsection(showname)
if showsection is None:
@@ -252,3 +252,51 @@ class Settings:
return self.__config["Shows"][show]
return None
class EmailSettings:
"""
Accessor for the email configuration file
"""
def __init__(self, settingsfile):
"""
Initialise settingsfile as a configobj
"""
self.__config = ConfigObj(settingsfile)
def getsmtpserver(self):
"""
Get the address of the smtp server
"""
return self.__config["SMTPServer"]
def getsmtpuser(self):
"""
Get the username for the smtp server
"""
return self.__config["SMTPUser"]
def getsmtppassword(self):
"""
Get the username for the smtp server
"""
return self.__config["SMTPPassword"]
def getfromaddress(self):
"""
Get the from address for emails
"""
return self.__config["From"]
def gettoaddress(self):
"""
Get the to address for emails
"""
return self.__config["To"]