#NEWLINE# def __init__( self , interface , content = None , content_charset = None , url = None , original = None ) : #NEWLINE# #INDENT# self . interface = interface #NEWLINE# if ( original is None ) : #NEWLINE# #INDENT# if ( ( content is not None ) and ( url is not None ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Cannot specify both content and url' ) #NEWLINE# #UNINDENT# if ( content is not None ) : #NEWLINE# #INDENT# if ( content_charset is None ) : #NEWLINE# #INDENT# content_charset = 'utf-8' #NEWLINE# #UNINDENT# if isinstance ( content , str ) : #NEWLINE# #INDENT# content = content . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( content_charset . lower ( ) . replace ( '-' , '_' ) not in self . trivial_encodings ) : #NEWLINE# #INDENT# content = content . decode ( content_charset ) . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . content = content #NEWLINE# self . url = url #NEWLINE# self . more_like_this = MoreLikeThisHandlerOptions ( ) #NEWLINE# self . _init_common_modules ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . content = original . content #NEWLINE# self . url = original . url #NEWLINE# for opt in self . option_modules : #NEWLINE# #INDENT# if hasattr ( original , opt ) : #NEWLINE# #INDENT# _attr = getattr ( original , opt ) #NEWLINE# setattr ( self , opt , _attr . clone ( ) )