Current File : //usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyc
�
��Xc@s�ddlZddlZddlmZddlmZddlmZddl	Z	ddl
mZddlm
Z
de
eefd��YZdS(	i����N(tArg(t
ArgumentError(tFileTransferProgressBarMixin(tBundleDownloadingMixin(t	S3RequesttDownloadBundlecBsSeZdZedddddddddd	�gZd
�Zd�Zd�ZRS(
s�Download a bundled image from the cloud

You must run euca-unbundle-image on the bundle you download to obtain the original image.s-ds--directorytdesttmetavartDIRtdefaultt.thelpsjthe directory to download the bundle parts to, or "-"
                to write the bundled image to stdoutcCs�tj|�|jddkr@tj|jd<t|jd<n�t|jdtj�r�t	j
j|jd�s�tdj
|jd���nt	j
j|jd�s�tdj
|jd���q�ndS(NRt-t
show_progresss-argument -d/--directory: '{0}' does not exists1argument -d/--directory: '{0}' is not a directory(Rt	configuretargstsyststdouttFalset
isinstancetsixtstring_typestostpathtexistsRtformattisdir(tself((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyR1s
cCsv|j|j�}t|jdtj�rM|j||jd|j�}n|j||jd|j�}||fS(NR(tfetch_manifesttserviceRRRRtdownload_bundle_to_dirtdownload_bundle_to_fileobj(Rtmanifestt
manifest_dest((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pytmainBscCs]|\}}|rYt|jdtj�sM|jdj�tjj�krYdG|GHndS(NRsWrote manifest(RRRRtfilenoRR(Rtresultt_tmanifest_filename((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pytprint_resultLs
"(t__name__t
__module__tDESCRIPTIONRtARGSRR"R'(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyR's		
(tos.pathRRtrequestbuilderRtrequestbuilder.exceptionsRtrequestbuilder.mixinsRRt euca2ools.commands.bundle.mixinsRteuca2ools.commands.s3RR(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyt<module>s