#NEWLINE# def serialize_properties( self ) : #NEWLINE# #INDENT# 'Serialize :attr:`self.properties` into raw bytes suitable to append\n        to the payload of `FrameType.HEADER` frames\n        ' #NEWLINE# shift = 15 #NEWLINE# flag_bits = 0 #NEWLINE# flags = [ ] #NEWLINE# prop_writer = AMQPWriter ( ) #NEWLINE# for ( prop_name , data_type ) in self . PROPERTIES : #NEWLINE# #INDENT# val = self . properties . get ( prop_name ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# if ( shift == 0 ) : #NEWLINE# #INDENT# flags . append ( flag_bits ) #NEWLINE# flag_bits = 0 #NEWLINE# shift = 15 #NEWLINE# #UNINDENT# flag_bits |= ( 1 << shift ) #NEWLINE# if ( data_type != 'bit' ) : #NEWLINE# #INDENT# getattr ( prop_writer , ( 'write_' + data_type ) ) ( val ) #NEWLINE# #UNINDENT# #UNINDENT# shift -= 1 #NEWLINE# #UNINDENT# flags . append ( flag_bits ) #NEWLINE# writer = AMQPWriter ( ) #NEWLINE# for flag_bits in flags : #NEWLINE# #INDENT# writer . write_short ( flag_bits ) #NEWLINE# #UNINDENT# writer . write ( prop_writer . getvalue ( ) ) #NEWLINE# return writer . getvalue ( )