ó FRTc@s™ddlZddlmZmZmZddlmZd Zdefd„ƒYZdefd„ƒYZ d „Z ed „Z d efd „ƒYZ dS(iÿÿÿÿN(t chunk_hashest tree_hasht bytes_to_hex(tcompute_hashes_from_fileobjit _PartitionercBs2eZdZd„Zd„Zd„Zd„ZRS(s¨Convert variable-size writes into part-sized writes Call write(data) with variable sized data as needed to write all data. Call flush() after all data is written. This instance will call send_fn(part_data) as needed in part_size pieces, except for the final part which may be shorter than part_size. Make sure to call flush() to ensure that a short final part results in a final send_fn call. cCs(||_||_g|_d|_dS(Ni(t part_sizetsend_fnt_buffert _buffer_size(tselfRR((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pyt__init__1s   cCs\|dkrdS|jj|ƒ|jt|ƒ7_x |j|jkrW|jƒq8WdS(Nt(RtappendRtlenRt _send_part(R tdata((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pytwrite7s  cCsƒdj|jƒ}t|ƒ|jkrS||jg|_t|jdƒ|_ng|_d|_||j }|j|ƒdS(NR i(tjoinRR RRR(R Rtpart((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pyR?s   cCs |jdkr|jƒndS(Ni(RR(R ((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pytflushMs(t__name__t __module__t__doc__R RRR(((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pyR%s     t _UploadercBs>eZdZed„Zd„Zd„Zd„Zd„ZRS(s‚Upload to a Glacier upload_id. Call upload_part for each part (in any order) and then close to complete the upload. cCsL||_||_||_||_d|_d|_g|_t|_ dS(Ni( tvaultt upload_idRt chunk_sizetNonet archive_idt_uploaded_sizet _tree_hashestFalsetclosed(R RRRR((s@/opt/freeware/lib/python2.7/site-packages/boto/glacier/writer.pyR Ys       cCsNt|jƒ}||kr=|jjdg||dƒn||j|s -R  !