add a wrapper of html2text
This commit is contained in:
parent
14518d060f
commit
3c4ea6f451
2 changed files with 7 additions and 1 deletions
|
|
@ -28,10 +28,10 @@ from email import message_from_file
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from html2text import html2text
|
|
||||||
|
|
||||||
from weboob.capabilities.messages import ICapMessages
|
from weboob.capabilities.messages import ICapMessages
|
||||||
from weboob.tools.application import ConsoleApplication
|
from weboob.tools.application import ConsoleApplication
|
||||||
|
from weboob.tools.misc import html2text
|
||||||
|
|
||||||
class Monboob(ConsoleApplication):
|
class Monboob(ConsoleApplication):
|
||||||
APPNAME = 'monboob'
|
APPNAME = 'monboob'
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,9 @@ def local2utc(d):
|
||||||
d = d.replace(tzinfo=tz.tzlocal())
|
d = d.replace(tzinfo=tz.tzlocal())
|
||||||
d = d.astimezone(tz.tzutc())
|
d = d.astimezone(tz.tzutc())
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
try:
|
||||||
|
from html2text import html2text
|
||||||
|
except ImportError:
|
||||||
|
def html2text(s):
|
||||||
|
return s
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue