<s> import dns . exception <EOL> import dns . rdata <EOL> import dns . tokenizer <EOL> class X25 ( dns . rdata . Rdata ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ '<STR_LIT:address>' ] <EOL> def __init__ ( self , rdclass , rdtype , address ) : <EOL> super ( X25 , self ) . __init__ ( rdclass , rdtype ) <EOL> self . address = address <EOL> def to_text ( self , origin = None , relativize = True , ** kw ) : <EOL> return '<STR_LIT>' % dns . rdata . _escapify ( self . address ) <EOL> def from_text ( cls , rdclass , rdtype , tok , origin = None , relativize = True ) : <EOL> address = tok . get_string ( ) <EOL> tok . get_eol ( ) <EOL> return cls ( rdclass , rdtype , address ) <EOL> from_text = classmethod ( from_text ) <EOL> def to_wire ( self , file , compress = None , origin = None ) : <EOL> l = len ( self . address ) <EOL> assert l < <NUM_LIT> <EOL> byte = chr ( l ) <EOL> file . write ( byte ) <EOL> file . write ( self . address ) <EOL> def from_wire ( cls , rdclass , rdtype , wire , current , rdlen , origin = None ) : <EOL> l = ord ( wire [ current ] ) <EOL> current += <NUM_LIT:1> <EOL> rdlen -= <NUM_LIT:1> <EOL> if l != rdlen : <EOL> raise dns . exception . FormError <EOL> address = wire [ current : current + l ] <EOL> return cls ( rdclass , rdtype , address ) <EOL> from_wire = classmethod ( from_wire ) <EOL> def _cmp ( self , other ) : <EOL> return cmp ( self . address , other . address ) </s>
