#NEWLINE# def upload_file( self , filename , bucket , key , callback = None , extra_args = None ) : #NEWLINE# #INDENT# "Upload a file to an S3 object.\n\n        Variants have also been injected into S3 client, Bucket and Object.\n        You don't have to use S3Transfer.upload_file() directly.\n        " #NEWLINE# if ( extra_args is None ) : #NEWLINE# #INDENT# extra_args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . _validate_all_known_args ( extra_args , self . ALLOWED_UPLOAD_ARGS ) #NEWLINE# events = self . _client . meta . events #NEWLINE# events . register_first ( 'request-created.s3' , disable_upload_callbacks , unique_id = 's3upload-callback-disable' ) #NEWLINE# events . register_last ( 'request-created.s3' , enable_upload_callbacks , unique_id = 's3upload-callback-enable' ) #NEWLINE# if ( self . _osutil . get_file_size ( filename ) >= self . _config . multipart_threshold ) : #NEWLINE# #INDENT# self . _multipart_upload ( filename , bucket , key , callback , extra_args ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _put_object ( filename , events , key , callback , extra_args )