From bb622efcd87b0f265ec0fcaaa4a863808566e7b9 Mon Sep 17 00:00:00 2001 From: lukeroge Date: Tue, 21 Feb 2012 11:40:40 +1300 Subject: [PATCH] Tidied plugins/util/misc.py (hope I didn't break anything) --- plugins/util/misc.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/plugins/util/misc.py b/plugins/util/misc.py index 16f35eb..411d6eb 100644 --- a/plugins/util/misc.py +++ b/plugins/util/misc.py @@ -1,13 +1,7 @@ from htmlentitydefs import name2codepoint -from time import time as unix_time from HTMLParser import HTMLParser -from datetime import datetime -import tempfile -import logging as log import errno import re -import sys -import os class HTMLStripper(HTMLParser): @@ -28,13 +22,11 @@ class HTMLStripper(HTMLParser): char = int(name) self._stripped.append(unichr(char)) except Exception, error: - log.warn('invalid entity: %s' % error) def handle_entityref(self, name): try: char = unichr(name2codepoint[name]) except Exception, error: - log.warn('unknown entity: %s' % error) char = u'&%s;' % name self._stripped.append(char) @@ -45,10 +37,5 @@ class HTMLStripper(HTMLParser): def stripped(self): return ''.join(self._stripped) -def superscript(text): - if isinstance(text, str): - text = decode(text, 'utf-8') - return text.translate(SUPER_MAP) - def strip_html(data): return HTMLStripper(data).stripped