display html2text missing warning only at first call
This commit is contained in:
parent
d07f661cb0
commit
144e98bbaf
1 changed files with 3 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2010-2013 Romain Bignon
|
# Copyright(C) 2010-2014 Romain Bignon
|
||||||
#
|
#
|
||||||
# This file is part of weboob.
|
# This file is part of weboob.
|
||||||
#
|
#
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
from logging import warning
|
import warnings
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
from tempfile import gettempdir
|
from tempfile import gettempdir
|
||||||
import os
|
import os
|
||||||
|
|
@ -68,9 +68,8 @@ try:
|
||||||
h2t.LINKS_EACH_PARAGRAPH = True
|
h2t.LINKS_EACH_PARAGRAPH = True
|
||||||
html2text = h2t.html2text
|
html2text = h2t.html2text
|
||||||
except ImportError:
|
except ImportError:
|
||||||
warning('python-html2text is not present. HTML pages will not be converted into text.')
|
|
||||||
|
|
||||||
def html2text(html):
|
def html2text(html):
|
||||||
|
warnings.warn('python-html2text is not present. HTML pages are not converted into text.', stacklevel=2)
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue