#NEWLINE# def _read_msg( self , method_frame , with_consumer_tag = False , with_message_count = False ) : #NEWLINE# #INDENT# '\n        Support method to read a Message from the current frame buffer.\n        Will return a Message, or re-queue current frames and raise a\n        FrameUnderflow. Takes an optional argument on whether to read the\n        consumer tag so it can be used for both deliver and get-ok.\n        ' #NEWLINE# ( header_frame , body ) = self . _reap_msg_frames ( method_frame ) #NEWLINE# if with_consumer_tag : #NEWLINE# #INDENT# consumer_tag = method_frame . args . read_shortstr ( ) #NEWLINE# #UNINDENT# delivery_tag = method_frame . args . read_longlong ( ) #NEWLINE# redelivered = method_frame . args . read_bit ( ) #NEWLINE# exchange = method_frame . args . read_shortstr ( ) #NEWLINE# routing_key = method_frame . args . read_shortstr ( ) #NEWLINE# if with_message_count : #NEWLINE# #INDENT# message_count = method_frame . args . read_long ( ) #NEWLINE# #UNINDENT# delivery_info = { #NEWLINE# #INDENT# 'channel' : self . channel , #NEWLINE# 'delivery_tag' : delivery_tag , #NEWLINE# 'redelivered' : redelivered , #NEWLINE# 'exchange' : exchange , #NEWLINE# 'routing_key' : routing_key , #NEWLINE# #UNINDENT# } #NEWLINE# if with_consumer_tag : #NEWLINE# #INDENT# delivery_info [ 'consumer_tag' ] = consumer_tag #NEWLINE# #UNINDENT# if with_message_count : #NEWLINE# #INDENT# delivery_info [ 'message_count' ] = message_count #NEWLINE# #UNINDENT# return Message ( body = body , delivery_info = delivery_info , ** header_frame . properties )