diff --git a/weboob/applications/boobmsg/boobmsg.py b/weboob/applications/boobmsg/boobmsg.py index 3ce501e4..20c959c0 100644 --- a/weboob/applications/boobmsg/boobmsg.py +++ b/weboob/applications/boobmsg/boobmsg.py @@ -25,10 +25,26 @@ from weboob.tools.application.repl import ReplApplication from weboob.tools.application.formatters.iformatter import IFormatter from weboob.tools.misc import html2text - __all__ = ['Boobmsg'] +class XHtmlFormatter(IFormatter): + def flush(self): + pass + + def format_dict(self, item): + result = "
\n" + result += "

%s

" % (item['title']) + result += "
" + result += "
Date
%s
" % (item['date']) + result += "
Sender
%s
" % (item['sender']) + result += "
Signature
%s
" % (item['signature']) + result += "
" + result += "
%s
" % (item['content']) + result += "
\n" + return result + + class MessageFormatter(IFormatter): def flush(self): pass @@ -153,6 +169,7 @@ class Boobmsg(ReplApplication): CAPS = ICapMessages EXTRA_FORMATTERS = {'msglist': MessagesListFormatter, 'msg': MessageFormatter, + 'xhtml': XHtmlFormatter, } COMMANDS_FORMATTERS = {'list': 'msglist', 'show': 'msg',