/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/__pycache__
NameSizeModeActions
bandwidth.cpython-313.pyc179660644editdlrm
compat.cpython-313.pyc27020644editdlrm
constants.cpython-313.pyc6880644editdlrm
copies.cpython-313.pyc111430644editdlrm
crt.cpython-313.pyc428680644editdlrm
delete.cpython-313.pyc25350644editdlrm
download.cpython-313.pyc314410644editdlrm
exceptions.cpython-313.pyc19370644editdlrm
futures.cpython-313.pyc287040644editdlrm
manager.cpython-313.pyc262910644editdlrm
processpool.cpython-313.pyc414160644editdlrm
subscribers.cpython-313.pyc36730644editdlrm
tasks.cpython-313.pyc137110644editdlrm
upload.cpython-313.pyc314740644editdlrm
utils.cpython-313.pyc369150644editdlrm
__init__.cpython-313.pyc343430644editdlrm
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/__pycache__/upload.cpython-313.pyc (31474B)
j |0SSKrSSKJr SSKJrJr SSKJr SSKJ r SSK J r J r J r Jr SSKJrJrJrJr "SS 5r"S S 5r"S S 5r"SS\5r"SS\5r"SS\5r"SS\ 5r"SS\5r"SS\5rg)N)BytesIOreadableseekable)FULL_OBJECT_CHECKSUM_ARGS)IN_MEMORY_UPLOAD_TAG)CompleteMultipartUploadTaskCreateMultipartUploadTaskSubmissionTaskTask)ChunksizeAdjusterDeferredOpenFile get_callbacksget_filtered_dictc0\rSrSrSSjrSrSrSrSrg) AggregatedProgressCallback!c*XlX lSUlg)aAggregates progress updates for every provided progress callback :type callbacks: A list of functions that accepts bytes_transferred as a single argument :param callbacks: The callbacks to invoke when threshold is reached :type threshold: int :param threshold: The progress threshold in which to take the aggregated progress and invoke the progress callback with that aggregated progress total rN) _callbacks _threshold _bytes_seen)self callbacks thresholds D/usr/lib/rads/venv/lib/python3.13/site-packages/s3transfer/upload.py__init__#AggregatedProgressCallback.__init__"s$#cU=RU- slURUR:aUR5 ggN)rr_trigger_callbacks)rbytes_transferreds r__call__#AggregatedProgressCallback.__call__2s7 --   t .  # # % /rcFURS:aUR5 gg)z@Flushes out any progress that has not been sent to its callbacksrN)rr!rs rflush AggregatedProgressCallback.flush7s!   a   # # % rcXURHnU"URS9 M SUlg)N)r"r)rr)rcallbacks rr!-AggregatedProgressCallback._trigger_callbacks<s&H t'7'7 8(r)rrrN)i) __name__ __module__ __qualname____firstlineno__rr#r'r!__static_attributes__rrrr!s & & rrcJ\rSrSrSrSrS SjrS SjrSrSr S r S r S r g)InterruptReaderBaWrapper that can interrupt reading using an error It uses a transfer coordinator to propagate an error if it notices that a read is being made while the file is being read from. :type fileobj: file-like obj :param fileobj: The file-like object to read from :type transfer_coordinator: s3transfer.futures.TransferCoordinator :param transfer_coordinator: The transfer coordinator to use if the reader needs to be interrupted. cXlX lgr _fileobj_transfer_coordinator)rfileobjtransfer_coordinators rrInterruptReader.__init__Ps  %9"rNcURR(aURReURRU5$r )r8 exceptionr7read)ramounts rr>InterruptReader.readTs:  % % / /,,66 6}}!!&))rc:URRX5 gr )r7seek)rwherewhences rrBInterruptReader.seek^s 5)rc6URR5$r )r7tellr&s rrGInterruptReader.tellas}}!!##rc8URR5 gr )r7closer&s rrJInterruptReader.closeds rcU$r r1r&s r __enter__InterruptReader.__enter__gs rc$UR5 gr )rJ)rargskwargss r__exit__InterruptReader.__exit__js  rr6r )r) r,r-r.r/__doc__rr>rBrGrJrMrRr0r1rrr3r3Bs* :**$rr3cb\rSrSrSrSSjr\S5rSrSr Sr S r S r S r S rS rSrg)UploadInputManagerna"Base manager class for handling various types of files for uploads This class is typically used for the UploadSubmissionTask class to help determine the following: * How to determine the size of the file * How to determine if a multipart upload is required * How to retrieve the body for a PutObject * How to retrieve the bodies for a set of UploadParts The answers/implementations differ for the various types of file inputs that may be accepted. All implementations must subclass and override public methods from this class. Nc(XlX lX0lgr )_osutilr8_bandwidth_limiter)rosutilr:bandwidth_limiters rrUploadInputManager.__init__~s %9""3rc[S5e)zDetermines if the source for the upload is compatible with manager :param upload_source: The source for which the upload will pull data from. :returns: True if the manager can handle the type of source specified otherwise returns False. zmust implement _is_compatible()NotImplementedErrorcls upload_sources r is_compatible UploadInputManager.is_compatibles""CDDrc[S5e)aWhether the body it provides are stored in-memory :type operation_name: str :param operation_name: The name of the client operation that the body is being used for. Valid operation_names are ``put_object`` and ``upload_part``. :rtype: boolean :returns: True if the body returned by the manager will be stored in memory. False if the manager will not directly store the body in memory. z%must implement store_body_in_memory()r_roperation_names rstores_body_in_memory(UploadInputManager.stores_body_in_memorys""IJJrc[S5e)zProvides the transfer size of an upload :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The future associated with upload request z&must implement provide_transfer_size()r_rtransfer_futures rprovide_transfer_size(UploadInputManager.provide_transfer_sizes ""JKKrc[S5e)aDetermines where a multipart upload is required :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The future associated with upload request :type config: s3transfer.manager.TransferConfig :param config: The config associated to the transfer manager :rtype: boolean :returns: True, if the upload should be multipart based on configuration and size. False, otherwise. z*must implement requires_multipart_upload()r_rrmconfigs rrequires_multipart_upload,UploadInputManager.requires_multipart_uploads""NOOrc[S5e)aReturns the body to use for PutObject :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The future associated with upload request :type config: s3transfer.manager.TransferConfig :param config: The config associated to the transfer manager :rtype: s3transfer.utils.ReadFileChunk :returns: A ReadFileChunk including all progress callbacks associated with the transfer future. z$must implement get_put_object_body()r_rls rget_put_object_body&UploadInputManager.get_put_object_bodys""HIIrc[S5e)aYields the part number and body to use for each UploadPart :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The future associated with upload request :type chunksize: int :param chunksize: The chunksize to use for this upload. :rtype: int, s3transfer.utils.ReadFileChunk :returns: Yields the part number and the ReadFileChunk including all progress callbacks associated with the transfer future for that specific yielded part. z)must implement yield_upload_part_bodies()r_)rrm chunksizes ryield_upload_part_bodies+UploadInputManager.yield_upload_part_bodiess""MNNrc[XR5nUR(a$URRXRSS9nU$)NF)enabled)r3r8rZget_bandwith_limited_stream)rr9s r _wrap_fileobj UploadInputManager._wrap_fileobjsI!'+E+EF  " "--II33UJGrcD[US5nU(a [U5/$/$)Nprogress)rr)rrmrs r_get_progress_callbacks*UploadInputManager._get_progress_callbackss&!/:>  .y9: : rcDUVs/sHo"RPM sn$s snfr )r')raggregated_progress_callbacksr*s r_get_close_callbacks'UploadInputManager._get_close_callbackss/LM/L8/LMMMs)rZrYr8r )r,r-r.r/rTr classmethodrdrirnrsrvrzrrrr0r1rrrVrVnsP 4  E E KL P JO NrrVc^\rSrSrSr\S5rSrSrSr Sr Sr S r S r S rS rS rg)UploadFilenameInputManagerzUpload utility for filenamesc"[U[5$r ) isinstancestrras rrd(UploadFilenameInputManager.is_compatibles---rcg)NFr1rgs rri0UploadFilenameInputManager.stores_body_in_memorysrcURRURRURRR 55 gr )metarnrY get_file_size call_argsr9rls rrn0UploadFilenameInputManager.provide_transfer_sizes:22 LL & &';';'E'E'M'M N rcHURRUR:$r )rsizemultipart_thresholdrqs rrs4UploadFilenameInputManager.requires_multipart_uploads##((F,F,FFFrcURU5up#URU5nURU5nURU5nURR nUR RUUUUUS9$)Nr9 chunk_sizefull_file_sizerclose_callbacks)&_get_put_object_fileobj_with_full_sizerrrrrrY#open_file_chunk_reader_from_fileobj)rrmr9 full_sizerrrs rrv.UploadFilenameInputManager.get_put_object_bodys!HH  $$W-00A 33I>##((||??$+ @  rc ## URRnURX5n[SUS-5HnUR U5nUR U5nX%S- -nUR URRRUUUS9upURU 5n URRU UU UUS9n X[4v M g7f)N) start_byte part_sizerr) rr_get_num_partsrangerr'_get_upload_part_fileobj_with_full_sizerr9rrYr) rrmryr num_parts part_numberrrrr9rread_file_chunks rrz3UploadFilenameInputManager.yield_upload_part_bodiess(--22''C  IM2K44_EI"77 BO"Ao6J"&!M!M$$..66%#- "N" G((1G#llNN$(# / OO. .53sC CcB[XURRS9nU$)N) open_function)rrYopen)rr9rs r_get_deferred_open_file2UploadFilenameInputManager._get_deferred_open_file2s"" t||/@/@ rcURRRnURRnUR US5U4$)Nr)rrr9rrrrmr9rs rrAUploadFilenameInputManager._get_put_object_fileobj_with_full_size8sB!&&0088##((++GQ7==rc <USnUSnURX5U4$)Nrr)r)rr9rQrrs rrBUploadFilenameInputManager._get_upload_part_fileobj_with_full_size=s-L) +, ++G@)KKrc[[R"URR[ U5- 55$r )intmathceilrrfloat)rrmrs rr)UploadFilenameInputManager._get_num_partsBs,499_1166y9IIJKKrr1N)r,r-r.r/rTrrdrirnrsrvrzrrrrr0r1rrrrsG&.. G 0/> > L Lrrc@\rSrSrSr\S5rSrSrSr Sr Sr g ) UploadSeekableInputManageriFz&Upload utility for an open file objectc<[U5=(a [U5$r rras rrd(UploadSeekableInputManager.is_compatibleIs &B8M+BBrcUS:Xagg)N put_objectFTr1rgs rri0UploadSeekableInputManager.stores_body_in_memoryMs \ )rcURRRnUR5nUR SS5 UR5nUR U5 URR XC- 5 g)Nr)rrr9rGrBrn)rrmr9start_position end_positions rrn0UploadSeekableInputManager.provide_transfer_sizeSse!&&0088! Q||~  ^$22  ) rc VURUS5n[U5[U54$)Nr)r>rlen)rr9rQdatas rrBUploadSeekableInputManager._get_upload_part_fileobj_with_full_size`s,||F;/0 t}c$i''rcURRRnUR5URR-nX#4$r )rrr9rGrrs rrAUploadSeekableInputManager._get_put_object_fileobj_with_full_sizeos?!&&0088||~ 4 4 9 99}rr1N) r,r-r.r/rTrrdrirnrrr0r1rrrrFs-0CC   (rrcn^\rSrSrSrS U4Sjjr\S5rSrSr Sr Sr S r SS jr S rS rU=r$)UploadNonSeekableInputManageriwz7Upload utility for a file-like object that cannot seek.c4>[TU]XU5 SUlg)Nr)superr _initial_data)rr[r:r\ __class__s rr&UploadNonSeekableInputManager.__init__zs 7HI rc[U5$r )rras rrd+UploadNonSeekableInputManager.is_compatible~s  &&rcg)NTr1rgs rri3UploadNonSeekableInputManager.stores_body_in_memorysrcgr r1rls rrn3UploadNonSeekableInputManager.provide_transfer_sizes rc2URRb#URRUR:$URRRnURnUR X4S5Ul[UR 5U:agg)NFT)rrrrr9_readrr)rrmrrr9rs rrs7UploadNonSeekableInputManager.requires_multipart_uploads    $ $ 0"'',,0J0JJ J "&&0088.. !ZZEB t!! "Y .rcURU5nURU5nURRRnUR UR UR5-X#5nSUlU$r )rrrrr9 _wrap_datarr>)rrmrrr9bodys rrv1UploadNonSeekableInputManager.get_put_object_bodysl00A 33I>!&&0088    /  " rc## URRRnSnURU5nUR U5nUS- nUR X25nU(dgUR XuU5nSnXH4v M[7f)Nrr)rrr9rrrr) rrmry file_objectrrr part_content part_objects rrz6UploadNonSeekableInputManager.yield_upload_part_bodiess%**44<<  44_EI"77 BO 1 K::k=L//K  L* *sA?Bcl[UR5S:XaURU5$U[UR5::a,URSUnU(aURUSUlU$U[UR5- nURURU5-nU(aSUlU$)a Reads a specific amount of data from a stream and returns it. If there is any data in initial_data, that will be popped out first. :type fileobj: A file-like object that implements read :param fileobj: The stream to read from. :type amount: int :param amount: The number of bytes to read from the stream. :type truncate: bool :param truncate: Whether or not to truncate initial_data after reading from it. :return: Generator which generates part bodies from the initial data. rNr)rrr>)rr9r?truncateramount_to_reads rr#UploadNonSeekableInputManager._reads$ t!! "a '<<' ' S++, ,%%gv.D%)%7%7%@"K  #d&8&8"99!!GLL$@@ !$D  rcUR[U55nURRU[ U5[ U5UUS9$)ah Wraps data with the interrupt reader and the file chunk reader. :type data: bytes :param data: The data to wrap. :type callbacks: list :param callbacks: The callbacks associated with the transfer future. :type close_callbacks: list :param close_callbacks: The callbacks to be called when closing the wrapper for the data. :return: Fully wrapped data. r)rrrYrr)rrrrr9s rr(UploadNonSeekableInputManager._wrap_datasL $$WT]3||??4yt9+ @  r)rr )T)r,r-r.r/rTrrrdrirnrsrvrzrrr0 __classcell__)rs@rrrwsHA!'' " +((T  rrc~\rSrSrSrSS/r\S/-r/SQr/SQ\-r Sr SS jr S r S r S rS rSrSrSrSrg)UploadSubmissionTaskiz.Task for submitting tasks to execute an upload ChecksumType MpuObjectSize)ChecksumAlgorithmSSECustomerKeySSECustomerAlgorithmSSECustomerKeyMD5 RequestPayerExpectedBucketOwner)rrrrrrrc[[[/nURRR nUHnUR U5(dMUs $ [SUS[U5S35e)a?Retrieves a class for managing input for an upload based on file type :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future for the request :rtype: class of UploadInputManager :returns: The appropriate class to use for managing a specific type of input for uploads. zInput z of type: z is not supported.) rrrrrr9rd RuntimeErrortype)rrmupload_manager_resolver_chainr9upload_manager_clss r_get_upload_input_manager_cls2UploadSubmissionTask._get_upload_input_manager_clssw ' & )) % "&&0088"? !//88))#@WIZW 6H I  rNcURU5"X0RU5nURRcUR U5 UR XR5(dUR UUUUUU5 gURUUUUUU5 g)aj :param client: The client associated with the transfer manager :type config: s3transfer.manager.TransferConfig :param config: The transfer config associated with the transfer manager :type osutil: s3transfer.utils.OSUtil :param osutil: The os utility associated to the transfer manager :type request_executor: s3transfer.futures.BoundedExecutor :param request_executor: The request executor associated with the transfer manager :type transfer_future: s3transfer.futures.TransferFuture :param transfer_future: The transfer future associated with the transfer request that tasks are being submitted for N)rr8rrrnrs_submit_upload_request_submit_multipart_request)rclientrrr[request_executorrmr\upload_input_managers r_submitUploadSubmissionTask._submit3s6 $AA  ,,.? A    $ $ , 6 6 G$==     ' ' $    * * $  rc 8URRnURUR5nUR US5n UR R U[UR UURU5URURUS.SS9U S9 g)Nr)rr9bucketkey extra_argsT)r: main_kwargsis_finaltag) rr_extra_put_object_argsr_get_upload_task_tagr8submit PutObjectTaskrvr r ) rrrrr[rrmrrput_object_extra_argsput_object_tags rr+UploadSubmissionTask._submit_upload_requestls$((22 $ ; ;  !  22 ,  ""))  %)%?%?$3GG' (..$=="7  * rc URRn[HBnXR;dMSURS'UR SS5URS'MD UR UR5n UR RU[UR UURURU S.S95n /n URUR5n URUS5n URRn[5nURUR U5nUR#UU5nUH`unnU R%UR RU['UR UUURURUU S .S U 0S 9U S 95 Mb UR)UR5nUR RU[+UR UURURUS.U U S .SS95 g)N FULL_OBJECTrChecksumr)rr r r)r:r upload_part)rr9r r rr upload_id)r:rpending_main_kwargsr)rpartsT)r:rr r)rrrrreplace_extra_create_multipart_argsr8rr r r _extra_upload_part_argsrrr adjust_chunksizemultipart_chunksizerzappendUploadPartTask_extra_complete_multipart_argsr )rrrrr[rrmrrchecksumcreate_multipart_extra_argscreate_multipart_future part_futuresextra_part_argsupload_part_tagradjusterry part_iteratorrr9complete_multipart_extra_argss rr.UploadSubmissionTask._submit_multipart_requests0$((22 2H///7D $$^4r5r9rr rrr$r)r#rrr0r1rrrrsp8*O<!:o=N!N "" >7r% Na FD K  rrc\rSrSrSrSrSrg)riz Task to do a nonmultipart uploadcfUnUR"SX4US.UD6 SSS5 g!,(df  g=f)a :param client: The client to use when calling PutObject :param fileobj: The file to upload. :param bucket: The name of the bucket to upload to :param key: The name of the key to upload to :param extra_args: A dictionary of any extra arguments that may be used in the upload. )BucketKeyBodyNr1)r)rrr9r r rrs r_mainPutObjectTask._mains+    NV4 N: NWWs" 0r1Nr,r-r.r/rTrJr0r1rrrrs * Orrc\rSrSrSrSrSrg)r(iz+Task to upload a part in a multipart uploadc UnUR"SUUUUUS.UD6n SSS5 W Sn XS.n SU;a#USR5n SU 3n X;aXX'U $!,(df  NB=f)a[ :param client: The client to use when calling PutObject :param fileobj: The file to upload. :param bucket: The name of the bucket to upload to :param key: The name of the key to upload to :param upload_id: The id of the upload :param part_number: The number representing the part of the multipart upload :param extra_args: A dictionary of any extra arguments that may be used in the upload. :rtype: dict :returns: A dictionary representing a part:: {'Etag': etag_value, 'PartNumber': part_number} This value can be appended to a list to be used to complete the multipart upload. )rGrHUploadId PartNumberrINETag)rQrPrrr1)rupper)rrr9r r rrrrresponseetag part_metadataalgorithm_namechecksum_members rrJUploadPartTask._main"s,))"&   H!%A * ,'(;<BBDN ((89O*191J .!Ws A A&r1NrLr1rrr(r(s 5&rr()riors3transfer.compatrrs3transfer.constantsrs3transfer.futuresrs3transfer.tasksr r r r s3transfer.utilsr rrrrr3rVrrrrrr(r1rrr_s 0:3 B))XxNxNvZL!3ZLz.!;.bG $6G TK>K\ OD O )T)r