def _prepare_markup(self, markup, is_plus=True): if is_plus: text = Plus.msnplus_parse(markup) else: text = Plus.msnplus_strip(markup) text = MarkupParser.replace_markup(text) text_list = MarkupParser.replace_emoticons(text) return text_list
def _build_display_role(self, index, is_group=False): '''Build a string to be used as item's display role''' model = index.model() data_role = model.data(index, Role.DataRole).toPyObject() if is_group: display_role = self.contact_list.format_group(data_role) else: display_role = self.contact_list.format_nick(data_role) text = self.plus_text_parse(display_role) if not is_group else display_role text = MarkupParser.replace_markup(text) if not is_group: text_list = MarkupParser.replace_emoticons(text) return text_list return [text]
def _build_display_role(self, index, is_group=False): '''Build a string to be used as item's display role''' model = index.model() data_role = model.data(index, Role.DataRole).toPyObject() if is_group: display_role = self.contact_list.format_group(data_role) else: display_role = self.contact_list.format_nick(data_role) text = self.plus_text_parse( display_role) if not is_group else display_role text = MarkupParser.replace_markup(text) if not is_group: text_list = MarkupParser.replace_emoticons(text) return text_list return [text]
def msnplus_to_list(text): '''parse text and return a list of strings and gtk.gdk.Pixbufs''' text = plus_text_parse(text) text = MarkupParser.replace_markup(text) text_list = MarkupParser.replace_emoticons(text) return text_list