blockstack_zones/parse_zone_file.py
def remove_class(text):
    """
    Remove the CLASS from each DNS record, if present.
    The only class that gets used today (for all intents
    and purposes) is 'IN'.
    """

    # see RFC 1035 for list of classes
    lines = text.split("\n")
    ret = []
    for line in lines:
        tokens = tokenize_line(line)
        tokens_upper = [t.upper() for t in tokens]

        if "IN" in tokens_upper:
            tokens.remove("IN")
        elif "CS" in tokens_upper:
            tokens.remove("CS")
        elif "CH" in tokens_upper:
            tokens.remove("CH")
        elif "HS" in tokens_upper:
            tokens.remove("HS")

        ret.append(serialize(tokens))

    return "\n".join(ret)
def remove_class(text):
    """
    Remove the CLASS from each DNS record, if present.
    The only class that gets used today (for all intents
    and purposes) is 'IN'.
    """

    # see RFC 1035 for list of classes
    lines = text.split("\n")
    ret = []
    for line in lines:
        tokens = tokenize_line(line)
        tokens_upper = [t.upper() for t in tokens]

        if "IN" in tokens_upper:
            tokens.remove("IN")
        elif "CS" in tokens_upper:
            tokens.remove("CS")
        elif "CH" in tokens_upper:
            tokens.remove("CH")
        elif "HS" in tokens_upper:
            tokens.remove("HS")

        ret.append(serialize(tokens))

    return "\n".join(ret)
def remove_class ( text ) : # see RFC 1035 for list of classes lines = text . split ( "\n" ) ret = [ ] for line in lines : tokens = tokenize_line ( line ) tokens_upper = [ t . upper ( ) for t in tokens ] if "IN" in tokens_upper : tokens . remove ( "IN" ) elif "CS" in tokens_upper : tokens . remove ( "CS" ) elif "CH" in tokens_upper : tokens . remove ( "CH" ) elif "HS" in tokens_upper : tokens . remove ( "HS" ) ret . append ( serialize ( tokens ) ) return "\n" . join ( ret )
Remove the CLASS from each DNS record, if present.
    The only class that gets used today (for all intents
    and purposes) is 'IN'.
Remove the CLASS from each DNS record if present . The only class that gets used today ( for all intents and purposes ) is IN .