#NEWLINE# def add( self , byte ) : #NEWLINE# #INDENT# '\n        Push a byte onto the unicode string; if the byte contains or\n        completes a full utf-8-encoded character, that new character\n        will be included in the result of L{get}.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# character = byte . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# if ( self . _buf and isinstance ( self . _buf [ ( - 1 ) ] , str ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# character = ( self . _buf [ ( - 1 ) ] + byte ) . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# self . _buf [ ( - 1 ) ] = ( self . _buf [ ( - 1 ) ] + byte ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _buf [ ( - 1 ) ] = byte #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _buf . append ( byte ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _buf . append ( character )