예제 #1
0
    def text_message_received(self, origin, target, message):
        if is_command(message):
            self.handle_command(origin, message)

        else:
            self.bus.broadcast(self, origin.name, strip_html(message),
                               MsgType.TEXT)
예제 #2
0
    def fix_title(self, act):
        if act.title.endswith(':'):
            act.title = act.title[:-1] + '.'

        try:
            act.title = util.strip_html(act.title)
        except Exception, e:
            log.error("error stripping html: %r (data = %r)", e, act.title)
예제 #3
0
    def fix_title(self, act):
        if act.title.endswith(':'):
            act.title = act.title[:-1] + '.'

        try:
            act.title = util.strip_html(act.title)
        except Exception, e:
            log.error("error stripping html: %r (data = %r)", e, act.title)
 def __init__(self, html_instructions):
     self.html_instructions = html_instructions
     self.instructions = util.strip_html(self.html_instructions)
     self.tokens = self.tokenize()
     self.turn_street = self.get_turn_street()
     self.toward_street = self.get_toward_street()
     self.turn_direction = self.get_turn_direction()
     self.destination_direction = self.get_destination_direction()
     self.on_street = self.get_on_street()
예제 #5
0
def get_destination_direction_from_html_directions(html_instructions):

    instructions = util.strip_html(html_instructions)
    instructions = instructions.split('Destination will be on the ')
    if len(instructions) == 2:
        instructions = instructions[1].upper()
        return instructions

    return None
예제 #6
0
    def update_item_to_notification(self, item):
        import weakref
        import gui.browser.webkit.imageloader as imageloader

        default_icon = skin.get('BuddiesPanel.BuddyIcons.NoIcon', None)

        if hasattr(item, 'content_body'):
            body = item.content_body()
        else:
            html = self.generate_item_html(item)
            body = util.strip_html(html).strip()

        n = util.Storage(acct=weakref.ref(self),
                         icon=imageloader.LazyWebKitImage(
                             item.person.picture_url, default_icon),
                         body=body,
                         title=item.person.name,
                         url=getattr(item, 'url', item.person.profile_url),
                         post_id=item.id)

        return n
예제 #7
0
    def update_item_to_notification(self, item):
        import weakref
        import gui.browser.webkit.imageloader as imageloader

        default_icon = skin.get("BuddiesPanel.BuddyIcons.NoIcon", None)

        if hasattr(item, "content_body"):
            body = item.content_body()
        else:
            html = self.generate_item_html(item)
            body = util.strip_html(html).strip()

        n = util.Storage(
            acct=weakref.ref(self),
            icon=imageloader.LazyWebKitImage(item.person.picture_url, default_icon),
            body=body,
            title=item.person.name,
            url=getattr(item, "url", item.person.profile_url),
            post_id=item.id,
        )

        return n
예제 #8
0
 def stripped_msg(self):
     msg = self.status_message
     return strip_html(msg) if msg else u''
예제 #9
0
 def content_body(self):
     return util.strip_html(self.body.decode('fuzzy utf8'))
예제 #10
0
 def content_body(self):
     return util.strip_html(self.body.decode('fuzzy utf8'))