oops fix the fix
This commit is contained in:
parent
eec9a016f0
commit
8d9e1ce51c
1 changed files with 7 additions and 7 deletions
|
|
@ -110,16 +110,16 @@ class Monboob(ReplApplication):
|
||||||
def main(self, argv):
|
def main(self, argv):
|
||||||
self.load_config()
|
self.load_config()
|
||||||
try:
|
try:
|
||||||
self.config['interval'] = int(self.config['interval'])
|
self.config.set('interval', int(self.config.get('interval')))
|
||||||
if self.config['interval'] < 1:
|
if self.config.get('interval') < 1:
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print >>sys.stderr, 'Configuration error: interval must be an integer >0.'
|
print >>sys.stderr, 'Configuration error: interval must be an integer >0.'
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.config['html'] = int(self.config['html'])
|
self.config.set('html', int(self.config.get('html')))
|
||||||
if self.config['html'] not in (0,1):
|
if self.config.get('html') not in (0,1):
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print >>sys.stderr, 'Configuration error: html must be 0 or 1.'
|
print >>sys.stderr, 'Configuration error: html must be 0 or 1.'
|
||||||
|
|
@ -248,7 +248,7 @@ class Monboob(ReplApplication):
|
||||||
|
|
||||||
Run the fetching daemon.
|
Run the fetching daemon.
|
||||||
"""
|
"""
|
||||||
self.weboob.repeat(int(self.config.get('interval')), self.process)
|
self.weboob.repeat(self.config.get('interval'), self.process)
|
||||||
self.weboob.loop()
|
self.weboob.loop()
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
|
@ -273,7 +273,7 @@ class Monboob(ReplApplication):
|
||||||
date = formatdate(time.mktime(utc2local(mail.date).timetuple()), localtime=True)
|
date = formatdate(time.mktime(utc2local(mail.date).timetuple()), localtime=True)
|
||||||
msg_id = u'<%s.%s@%s>' % (backend.name, mail.full_id, domain)
|
msg_id = u'<%s.%s@%s>' % (backend.name, mail.full_id, domain)
|
||||||
|
|
||||||
if int(self.config.get('html')) and mail.flags & mail.IS_HTML:
|
if self.config.get('html') and mail.flags & mail.IS_HTML:
|
||||||
body = mail.content
|
body = mail.content
|
||||||
content_type = 'html'
|
content_type = 'html'
|
||||||
else:
|
else:
|
||||||
|
|
@ -287,7 +287,7 @@ class Monboob(ReplApplication):
|
||||||
body = ''
|
body = ''
|
||||||
|
|
||||||
if mail.signature:
|
if mail.signature:
|
||||||
if int(self.config.get('html')) and mail.flags & mail.IS_HTML:
|
if self.config.get('html') and mail.flags & mail.IS_HTML:
|
||||||
body += u'<p>-- <br />%s</p>' % mail.signature
|
body += u'<p>-- <br />%s</p>' % mail.signature
|
||||||
else:
|
else:
|
||||||
body += u'\n\n-- \n'
|
body += u'\n\n-- \n'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue