Ejemplo n.º 1
0
def cut_yahoo_quote(html_message):
    ''' Cuts the outermost block element with class yahoo_quoted. '''
    yahoo_quote = cssselect('div.yahoo_quoted', html_message)
    if yahoo_quote and (yahoo_quote[0].text is None
                        or not RE_FWD.match(yahoo_quote[0].text)):
        yahoo_quote[0].getparent().remove(yahoo_quote[0])
        return True
Ejemplo n.º 2
0
def cut_gmail_quote(html_message):
    ''' Cuts the outermost block element with class gmail_quote. '''
    gmail_quote = cssselect('div.gmail_quote', html_message)
    if gmail_quote and (gmail_quote[0].text is None
                        or not RE_FWD.match(gmail_quote[0].text)):
        gmail_quote[0].getparent().remove(gmail_quote[0])
        return True
Ejemplo n.º 3
0
def cut_by_id(html_message):
    found = False
    for quote_id in QUOTE_IDS:
        quote = cssselect('#{}'.format(quote_id), html_message)
        if quote:
            found = True
            quote[0].getparent().remove(quote[0])
    return found
Ejemplo n.º 4
0
def cut_by_id(html_message):
    found = False
    for quote_id in QUOTE_IDS:
        quote = cssselect('#{}'.format(quote_id), html_message)
        if quote:
            found = True
            quote[0].getparent().remove(quote[0])
    return found
Ejemplo n.º 5
0
def cut_gmail_extra(html_message):
    print("test12")
    gmail_quote = cssselect('div.gmail_extra', html_message)
    print("test")
    if gmail_quote and (gmail_quote[0].text is None
                        or not RE_FWD.match(gmail_quote[0].text)):
        print("test")
        gmail_quote[0].getparent().remove(gmail_quote[0])
        return True
Ejemplo n.º 6
0
def cut_gmail_quote(html_message):
    ''' Cuts the outermost block element with class gmail_quote. '''
    gmail_quote = cssselect('div.gmail_quote', html_message)
    if gmail_quote and (gmail_quote[0].text is None or not RE_FWD.match(gmail_quote[0].text)):
        gmail_quote[0].getparent().remove(gmail_quote[0])
        return True
Ejemplo n.º 7
0
def cut_yahoo_quoted(html_message):
    gmail_quote = cssselect('div.yahoo_quoted', html_message)
    if gmail_quote and (gmail_quote[0].text is None):
        gmail_quote[0].getparent().remove(gmail_quote[0])
        return True