#NEWLINE# def encode( self ) : #NEWLINE# #INDENT# pieces = list ( ) #NEWLINE# pieces . append ( struct . pack ( '>H' , self . ticket ) ) #NEWLINE# assert isinstance ( self . queue , str_or_bytes ) , 'A non-string value was supplied for self.queue' #NEWLINE# data . encode_short_string ( pieces , self . queue ) #NEWLINE# assert isinstance ( self . exchange , str_or_bytes ) , 'A non-string value was supplied for self.exchange' #NEWLINE# data . encode_short_string ( pieces , self . exchange ) #NEWLINE# assert isinstance ( self . routing_key , str_or_bytes ) , 'A non-string value was supplied for self.routing_key' #NEWLINE# data . encode_short_string ( pieces , self . routing_key ) #NEWLINE# data . encode_table ( pieces , self . arguments ) #NEWLINE# return pieces