#NEWLINE# def extract_text( escaped_html_str ) : #NEWLINE# #INDENT# notes = xml . sax . saxutils . unescape ( escaped_html_str ) #NEWLINE# try : #NEWLINE# #INDENT# from PyQt4 import QtGui #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# return str ( notes ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fragment = QtGui . QTextDocumentFragment . fromHtml ( fragment ) #NEWLINE# return str ( fragment . toPlainText ( ) )