@@ -150,7 +150,7 @@ def __init__(self, account_name=None, account_key=None, sas_token=None, is_emula
150150 custom_domain , request_session , connection_string , socket_timeout , token_credential )
151151
152152 def put_block (self , container_name , blob_name , block , block_id ,
153- validate_content = False , lease_id = None , cpk = None , timeout = None ):
153+ validate_content = False , lease_id = None , timeout = None , cpk = None ):
154154 '''
155155 Creates a new block to be committed as part of a blob.
156156
@@ -198,8 +198,8 @@ def put_block(self, container_name, blob_name, block, block_id,
198198 def put_block_list (
199199 self , container_name , blob_name , block_list , content_settings = None ,
200200 metadata = None , validate_content = False , lease_id = None , if_modified_since = None ,
201- if_unmodified_since = None , if_match = None , if_none_match = None , cpk = None ,
202- timeout = None , standard_blob_tier = None ):
201+ if_unmodified_since = None , if_match = None , if_none_match = None ,
202+ timeout = None , standard_blob_tier = None , cpk = None ):
203203 '''
204204 Writes a blob by specifying the list of block IDs that make up the blob.
205205 In order to be written as part of a blob, a block must have been
@@ -336,7 +336,7 @@ def get_block_list(self, container_name, blob_name, snapshot=None,
336336
337337 def put_block_from_url (self , container_name , blob_name , copy_source_url , block_id ,
338338 source_range_start = None , source_range_end = None ,
339- source_content_md5 = None , lease_id = None , cpk = None , timeout = None ):
339+ source_content_md5 = None , lease_id = None , timeout = None , cpk = None ):
340340 """
341341 Creates a new block to be committed as part of a blob.
342342
@@ -401,11 +401,10 @@ def put_block_from_url(self, container_name, blob_name, copy_source_url, block_i
401401
402402 # ----Convenience APIs-----------------------------------------------------
403403
404- def create_blob_from_path (
405- self , container_name , blob_name , file_path , content_settings = None ,
406- metadata = None , validate_content = False , progress_callback = None ,
407- max_connections = 2 , lease_id = None , if_modified_since = None ,
408- if_unmodified_since = None , if_match = None , if_none_match = None , cpk = None , timeout = None , standard_blob_tier = None ):
404+ def create_blob_from_path (self , container_name , blob_name , file_path , content_settings = None , metadata = None ,
405+ validate_content = False , progress_callback = None , max_connections = 2 , lease_id = None ,
406+ if_modified_since = None , if_unmodified_since = None , if_match = None , if_none_match = None ,
407+ timeout = None , standard_blob_tier = None , cpk = None ):
409408 '''
410409 Creates a new blob from a file path, or updates the content of an
411410 existing blob, with automatic chunking and progress notifications.
@@ -482,31 +481,20 @@ def create_blob_from_path(
482481
483482 count = path .getsize (file_path )
484483 with open (file_path , 'rb' ) as stream :
485- return self .create_blob_from_stream (
486- container_name = container_name ,
487- blob_name = blob_name ,
488- stream = stream ,
489- count = count ,
490- content_settings = content_settings ,
491- metadata = metadata ,
492- validate_content = validate_content ,
493- lease_id = lease_id ,
494- progress_callback = progress_callback ,
495- max_connections = max_connections ,
496- if_modified_since = if_modified_since ,
497- if_unmodified_since = if_unmodified_since ,
498- if_match = if_match ,
499- if_none_match = if_none_match ,
500- standard_blob_tier = standard_blob_tier ,
501- cpk = cpk ,
502- timeout = timeout )
503-
504- def create_blob_from_stream (
505- self , container_name , blob_name , stream , count = None ,
506- content_settings = None , metadata = None , validate_content = False ,
507- progress_callback = None , max_connections = 2 , lease_id = None ,
508- if_modified_since = None , if_unmodified_since = None , if_match = None ,
509- if_none_match = None , cpk = None , timeout = None , use_byte_buffer = False , standard_blob_tier = None ):
484+ return self .create_blob_from_stream (container_name = container_name , blob_name = blob_name , stream = stream ,
485+ count = count , content_settings = content_settings , metadata = metadata ,
486+ validate_content = validate_content , progress_callback = progress_callback ,
487+ max_connections = max_connections , lease_id = lease_id ,
488+ if_modified_since = if_modified_since ,
489+ if_unmodified_since = if_unmodified_since , if_match = if_match ,
490+ if_none_match = if_none_match , timeout = timeout ,
491+ standard_blob_tier = standard_blob_tier , cpk = cpk )
492+
493+ def create_blob_from_stream (self , container_name , blob_name , stream , count = None , content_settings = None ,
494+ metadata = None , validate_content = False , progress_callback = None , max_connections = 2 ,
495+ lease_id = None , if_modified_since = None , if_unmodified_since = None , if_match = None ,
496+ if_none_match = None , timeout = None , use_byte_buffer = False , standard_blob_tier = None ,
497+ cpk = None ):
510498 '''
511499 Creates a new blob from a file/stream, or updates the content of
512500 an existing blob, with automatic chunking and progress
@@ -712,12 +700,10 @@ def create_blob_from_stream(
712700 cpk = cpk ,
713701 )
714702
715- def create_blob_from_bytes (
716- self , container_name , blob_name , blob , index = 0 , count = None ,
717- content_settings = None , metadata = None , validate_content = False ,
718- progress_callback = None , max_connections = 2 , lease_id = None ,
719- if_modified_since = None , if_unmodified_since = None , if_match = None ,
720- if_none_match = None , cpk = None , timeout = None , standard_blob_tier = None ):
703+ def create_blob_from_bytes (self , container_name , blob_name , blob , index = 0 , count = None , content_settings = None ,
704+ metadata = None , validate_content = False , progress_callback = None , max_connections = 2 ,
705+ lease_id = None , if_modified_since = None , if_unmodified_since = None , if_match = None ,
706+ if_none_match = None , timeout = None , standard_blob_tier = None , cpk = None ):
721707 '''
722708 Creates a new blob from an array of bytes, or updates the content
723709 of an existing blob, with automatic chunking and progress
@@ -807,33 +793,19 @@ def create_blob_from_bytes(
807793 stream = BytesIO (blob )
808794 stream .seek (index )
809795
810- return self .create_blob_from_stream (
811- container_name = container_name ,
812- blob_name = blob_name ,
813- stream = stream ,
814- count = count ,
815- content_settings = content_settings ,
816- metadata = metadata ,
817- validate_content = validate_content ,
818- progress_callback = progress_callback ,
819- max_connections = max_connections ,
820- lease_id = lease_id ,
821- if_modified_since = if_modified_since ,
822- if_unmodified_since = if_unmodified_since ,
823- if_match = if_match ,
824- if_none_match = if_none_match ,
825- timeout = timeout ,
826- use_byte_buffer = True ,
827- standard_blob_tier = standard_blob_tier ,
828- cpk = cpk ,
829- )
830-
831- def create_blob_from_text (
832- self , container_name , blob_name , text , encoding = 'utf-8' ,
833- content_settings = None , metadata = None , validate_content = False ,
834- progress_callback = None , max_connections = 2 , lease_id = None ,
835- if_modified_since = None , if_unmodified_since = None , if_match = None ,
836- if_none_match = None , cpk = None , timeout = None , standard_blob_tier = None ):
796+ return self .create_blob_from_stream (container_name = container_name , blob_name = blob_name , stream = stream ,
797+ count = count , content_settings = content_settings , metadata = metadata ,
798+ validate_content = validate_content , progress_callback = progress_callback ,
799+ max_connections = max_connections , lease_id = lease_id ,
800+ if_modified_since = if_modified_since ,
801+ if_unmodified_since = if_unmodified_since , if_match = if_match ,
802+ if_none_match = if_none_match , timeout = timeout , use_byte_buffer = True ,
803+ standard_blob_tier = standard_blob_tier , cpk = cpk )
804+
805+ def create_blob_from_text (self , container_name , blob_name , text , encoding = 'utf-8' , content_settings = None ,
806+ metadata = None , validate_content = False , progress_callback = None , max_connections = 2 ,
807+ lease_id = None , if_modified_since = None , if_unmodified_since = None , if_match = None ,
808+ if_none_match = None , timeout = None , standard_blob_tier = None , cpk = None ):
837809 '''
838810 Creates a new blob from str/unicode, or updates the content of an
839811 existing blob, with automatic chunking and progress notifications.
@@ -912,25 +884,13 @@ def create_blob_from_text(
912884 _validate_not_none ('encoding' , encoding )
913885 text = text .encode (encoding )
914886
915- return self .create_blob_from_bytes (
916- container_name = container_name ,
917- blob_name = blob_name ,
918- blob = text ,
919- index = 0 ,
920- count = len (text ),
921- content_settings = content_settings ,
922- metadata = metadata ,
923- validate_content = validate_content ,
924- lease_id = lease_id ,
925- progress_callback = progress_callback ,
926- max_connections = max_connections ,
927- if_modified_since = if_modified_since ,
928- if_unmodified_since = if_unmodified_since ,
929- if_match = if_match ,
930- if_none_match = if_none_match ,
931- standard_blob_tier = standard_blob_tier ,
932- cpk = cpk ,
933- timeout = timeout )
887+ return self .create_blob_from_bytes (container_name = container_name , blob_name = blob_name , blob = text , index = 0 ,
888+ count = len (text ), content_settings = content_settings , metadata = metadata ,
889+ validate_content = validate_content , progress_callback = progress_callback ,
890+ max_connections = max_connections , lease_id = lease_id ,
891+ if_modified_since = if_modified_since , if_unmodified_since = if_unmodified_since ,
892+ if_match = if_match , if_none_match = if_none_match , timeout = timeout ,
893+ standard_blob_tier = standard_blob_tier , cpk = cpk )
934894
935895 def set_standard_blob_tier (
936896 self , container_name , blob_name , standard_blob_tier , timeout = None , rehydrate_priority = None ):
0 commit comments