#NEWLINE# def upload_file( self , file_object , image_type = 'jpeg' ) : #NEWLINE# #INDENT# files = { #NEWLINE# #INDENT# 'file' : ( 'my_photo.jpg' , file_object , 'image/{0}' . format ( image_type ) , { #NEWLINE# #INDENT# 'Expires' : '0' , #NEWLINE# #UNINDENT# } ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . _session . okc_post ( self . _uri , files = files ) #NEWLINE# response_script_text = xpb . script . get_text_ ( html . fromstring ( response . content ) ) #NEWLINE# return self . _get_response_json ( response_script_text )