fix code for the new INIConfig parser

This commit is contained in:
Romain Bignon 2010-04-20 09:15:06 +02:00
commit f5a8c1c1a8

View file

@ -39,7 +39,7 @@ class Monboob(ConsoleApplication):
'domain': 'weboob.example.org',
'recipient': 'weboob@example.org',
'smtp': 'localhost',
'html': False}
'html': 0}
def main(self, argv):
self.load_config()
@ -92,7 +92,7 @@ class Monboob(ConsoleApplication):
@ConsoleApplication.command("run daemon")
def command_run(self):
self.weboob.repeat(self.config.get('interval'), self.process)
self.weboob.repeat(int(self.config.get('interval')), self.process)
self.weboob.loop()
def process(self):
@ -114,7 +114,7 @@ class Monboob(ConsoleApplication):
date = time.strftime('%a, %d %b %Y %H:%M:%S +0000', mail.get_date().timetuple())
msg_id = u'<%s.%s@%s>' % (backend.name, mail.get_full_id(), domain)
if self.config.get('html') and mail.is_html:
if int(self.config.get('html')) and mail.is_html:
body = mail.get_content()
content_type = 'html'
else:
@ -125,7 +125,7 @@ class Monboob(ConsoleApplication):
content_type = 'plain'
if mail.get_signature():
if self.config.get('html') and mail.is_html:
if (self.config.get('html')) and mail.is_html:
body += u'<p>-- <br />%s</p>' % mail.get_signature()
else:
body += u'\n\n-- \n'