move remove_html_tags function into weboob.tools.misc

This commit is contained in:
Romain Bignon 2011-07-03 10:52:33 +02:00
commit ba6f31dac8
3 changed files with 7 additions and 14 deletions

View file

@ -24,6 +24,7 @@ from dateutil import tz
from logging import warning
from time import time, sleep
from tempfile import gettempdir
import re
import os
import sys
import traceback
@ -61,6 +62,9 @@ def get_bytes_size(size, unit_name):
}
return float(size * unit_data.get(unit_name, 1))
def remove_html_tags(data):
p = re.compile(r'<.*?>')
return p.sub(' ', data)
try:
import html2text as h2t