#NEWLINE# def __init__( self , firmware_data , b64encode = True , logger = None ) : #NEWLINE# #INDENT# if ( not logger ) : #NEWLINE# #INDENT# logger = Logging ( max_level = Logging . DEBUG ) #NEWLINE# #UNINDENT# self . logger = logger #NEWLINE# logger . LOG_DEBUG ( 'Building SetFirmware request body.' ) #NEWLINE# logger . LOG_DEBUG ( ( 'Length of firmware: %d' % len ( firmware_data ) ) ) #NEWLINE# if b64encode : #NEWLINE# #INDENT# self . encoded_firmware = base64 . b64encode ( firmware_data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . encoded_firmware = firmware_data #NEWLINE# #UNINDENT# logger . LOG_DEBUG ( ( 'Length of encoded firmware: %d' % len ( self . encoded_firmware ) ) )