def _load_url(self, url_u, encoding=None): # word hit list obsolete self.wordhitview.clear_words() # set text in textview ret = fetcher.fetch(url_u) if not encoding: encoding = decoder.detect_encoding(ret.txt_byte) txt_u = decoder.decode(ret.txt_byte, encoding) txt_u = unmarkup.unwiki(txt_u) or unmarkup.unhtml(txt_u) self.text = word.Text() self.text.set_from_txt_u(txt_u) self.textview.set_text(self.text, encoding, url_u)
def set_from_txt_byte(self, txt_byte, encoding, untag=False): txt_u = decoder.decode(txt_byte, encoding) if untag: txt_u = unmarkup.unhtml(txt_u) self.txt_u = txt_u