/usr/lib/python2.6/site-packages/boto
NameSizeModeActions
beanstalk/-0755rm
cacerts/-0755rm
cloudformation/-0755rm
cloudfront/-0755rm
cloudsearch/-0755rm
cloudsearch2/-0755rm
cloudtrail/-0755rm
cognito/-0755rm
contrib/-0755rm
datapipeline/-0755rm
directconnect/-0755rm
dynamodb/-0755rm
dynamodb2/-0755rm
ec2/-0755rm
ecs/-0755rm
elasticache/-0755rm
elastictranscoder/-0755rm
emr/-0755rm
file/-0755rm
fps/-0755rm
glacier/-0755rm
gs/-0755rm
iam/-0755rm
kinesis/-0755rm
logs/-0755rm
manage/-0755rm
mashups/-0755rm
mturk/-0755rm
mws/-0755rm
opsworks/-0755rm
pyami/-0755rm
rds/-0755rm
rds2/-0755rm
redshift/-0755rm
roboto/-0755rm
route53/-0755rm
s3/-0755rm
sdb/-0755rm
services/-0755rm
ses/-0755rm
sns/-0755rm
sqs/-0755rm
sts/-0755rm
support/-0755rm
swf/-0755rm
vendored/-0755rm
vpc/-0755rm
auth.py398540644editdlrm
auth.pyc348910644editdlrm
auth.pyo348910644editdlrm
auth_handler.py20640644editdlrm
auth_handler.pyc17350644editdlrm
auth_handler.pyo17350644editdlrm
compat.py26390644editdlrm
compat.pyc15210644editdlrm
compat.pyo15210644editdlrm
connection.py507910644editdlrm
connection.pyc384300644editdlrm
connection.pyo384300644editdlrm
endpoints.json183840644editdlrm
exception.py171060644editdlrm
exception.pyc226280644editdlrm
exception.pyo226280644editdlrm
handler.py23820644editdlrm
handler.pyc23790644editdlrm
handler.pyo23790644editdlrm
https_connection.py51350644editdlrm
https_connection.pyc50880644editdlrm
https_connection.pyo50880644editdlrm
jsonresponse.py60320644editdlrm
jsonresponse.pyc57330644editdlrm
jsonresponse.pyo57330644editdlrm
plugin.py27110644editdlrm
plugin.pyc23270644editdlrm
plugin.pyo23270644editdlrm
provider.py208900644editdlrm
provider.pyc136860644editdlrm
provider.pyo136860644editdlrm
regioninfo.py62140644editdlrm
regioninfo.pyc56060644editdlrm
regioninfo.pyo56060644editdlrm
requestlog.py14860644editdlrm
requestlog.pyc21850644editdlrm
requestlog.pyo21850644editdlrm
resultset.py65560644editdlrm
resultset.pyc57690644editdlrm
resultset.pyo57690644editdlrm
storage_uri.py391150644editdlrm
storage_uri.pyc352790644editdlrm
storage_uri.pyo352790644editdlrm
utils.py348850644editdlrm
utils.pyc346950644editdlrm
utils.pyo346950644editdlrm
__init__.py363370644editdlrm
__init__.pyc334460644editdlrm
__init__.pyo334460644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/utils.pyc (34695B)
P5Tc6@sdZddkZddkZddkZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z ddkZ ddkZ ddkZ ddkZ ddkZddkZddkZddklZlZlZlZddklZddklZlZeZddkl Z yddk!l"Z"Wne#j o e$Z"nXdd d d d d ddddddddddddddddddd d!d"d#gZ%e i&d$Z'e i&d%Z(e i&d&Z)d'Z*ddd(Z,dd)Z-dd*Z.e/d+dd,Z0dd-Z1d.e2fd/YZ3d0Z4d1d2d3dd4d5Z5d1d2dd4d6Z6d1dd2dd4d7Z7d8Z8d9Z9d:Z:ei;Z<ed;Z=dd<Z>d=Z?dd>Z@d?ZAdddd@ZBdAeCfdBYZDdCeiEiFfdDYZGdEe2fdFYZHdGeCfdHYZIdddde/dIZJdJZKdKZLdLZMeNdMdNdOZOdPZPdQddRZQdQdedSZRdTZSdUZTdVeCfdWYZUdS(Xs7 Some handy utility functions used by several classes. iN(tsixtStringIOturllibt encodebytes(tcontextmanager(tmd5tsha512(tjson(tJSONDecodeErrortacltcorstdefaultObjectAcltlocationtloggingt partNumbertpolicytrequestPaymentttorrentt versioningt versionIdtversionstwebsitetuploadstuploadIdsresponse-content-typesresponse-content-languagesresponse-expiressresponse-cache-controlsresponse-content-dispositionsresponse-content-encodingtdeletet lifecyclettaggingtrestoret storageClasst websiteConfigtcomposes(.)([A-Z][a-z]+)s([a-z])([0-9]+)s([a-z0-9])([A-Z])cCs:t|djo|S|dtii|dfSdS(Nii(tlenRtparsetunquote(tnv((s./usr/lib/python2.6/site-packages/boto/utils.pyt unquote_vdsc Cs|ptii}nh}xi|D]a}|i}||dj o>|djp|i|iot||i||sN(s content-md5s content-typeR$(tbototprovidert get_defaulttlowertNonet startswitht header_prefixtstrtstript date_headertsortedtkeystsplitRtqsa_of_interestR#tsorttjoin(tmethodtpaththeaderstexpiresR-tinteresting_headersR)tlktsorted_header_keystbuftvaltttqsat_[1]tat_[2]t_[3]((s./usr/lib/python2.6/site-packages/boto/utils.pytcanonical_stringksL  "    -<* cCs|ptii}n|i}|i}xW|iD]I}|itiii i jo||||tmetadataR-RLt final_headerstk((s./usr/lib/python2.6/site-packages/boto/utils.pyt merge_metas   c Cs|ptii}n|i}h}x|iD]}|ii|ortii ||}t |t o-y|i d}Wqt j oqXn|||t|<||=q6q6W|S(Nsutf-8(R,R-R.RLR7R/R1RR R!t isinstancetbytestdecodetUnicodeDecodeErrorR(R>R-RLRQthkeyRD((s./usr/lib/python2.6/site-packages/boto/utils.pytget_aws_metadatas    i c CsmxVtd|D]E}ytiih}tii|}tii|}|i|d|}|i} t| t i  o#t | do| i d} n| SWnUti ij o/} | i} | djo | odSntj o } nXtiid|d|jo0titd |tiid d d qqWtii d dS(s Retry a url. This is specifically used for accessing the metadata service on an instance. Since this address should never be proxied (for security reasons), we create a ProxyHandler with a NULL dictionary to override any proxy settings in the environment. ittimeoutRWsutf-8iR%s&Caught exception reading instance dataiitBototmax_retry_delayi<s'Unable to read instance data, giving up(trangeRtrequestt ProxyHandlert build_openertRequesttopentreadRURt string_typesthasattrRWterrort HTTPErrortgetcodet ExceptionR,tlogt exceptionttimetsleeptmintconfigtget( turlt retry_on_404t num_retriesR[tit proxy_handlertopenertreqtrtresulttetcode((s./usr/lib/python2.6/site-packages/boto/utils.pyt retry_urls0   $cCst|||S(N(tLazyLoadMetadata(RrRtR[((s./usr/lib/python2.6/site-packages/boto/utils.pyt_get_instance_metadatasR~cBsVeZddZdZdZddZdZdZdZ dZ RS( c Cs||_||_h|_g|_||_tii|id|id|i}|o|id}x|D]}|i do!|dd!}|ii |nW|i d}|djo#||d}|d|!d } n |}} | |i|>> _build_instance_metadata_url('http://169.254.169.254', 'latest', 'meta-data/') http://169.254.169.254/latest/meta-data/ :type url: string :param url: URL to metadata service, e.g. 'http://169.254.169.254' :type version: string :param version: Version of the metadata to get, e.g. 'latest' :type path: string :param path: Path of the metadata to get, e.g. 'meta-data/'. If a trailing slash is required it must be passed in with the path. :return: The full metadata URL s%s/%s/%s((RrtversionR=((s./usr/lib/python2.6/site-packages/boto/utils.pyt_build_instance_metadata_urlcstlatestshttp://169.254.169.254s meta-data/ic CsMy,t|||}t|d|d|SWntiij odSXdS(s Returns the instance metadata as a nested Python dictionary. Simple values (e.g. local_hostname, hostname, etc.) will be stored as string values. Values such as ancestor-ami-ids will be stored in the dict as a list of string values. More complex fields such as public-keys and will be stored as nested dicts. If the timeout is specified, the connection to the specified url will time out after the specified number of seconds. RtR[N(RRRRgtURLErrorR0(RRrRR[Rtt metadata_url((s./usr/lib/python2.6/site-packages/boto/utils.pytget_instance_metadata{s c Csh}t||d}yt|d|d|}|id}xk|D]c}t|d|dd|d|} | ddjoti| } n|o| ||ttdi|dd!|}q>W|SWndSXdS(Ns%s.%st.iii(R8R0tgetattrt __import__R;(t module_namet class_nametmodulestctm((s./usr/lib/python2.6/site-packages/boto/utils.pyt find_classs )cCs<d}|d7}tii|||||f}|iS(s= Update your Dynamic DNS record with DNSMadeEasy.com s,https://www.dnsmadeeasy.com/servlet/updateips$?username=%s&password=%s&id=%s&ip=%s(RR_turlopenRd(tusernametpasswordtdme_idt ip_addresstdme_urlts((s./usr/lib/python2.6/site-packages/boto/utils.pyt update_dmes "c Csvtiid||d joti}ny|idoi|tdidd\}}ti d|d|}|i |}|i |}|i |n|od|o]t ii} | id |||t ii| } t ii| } t ii| nt ii|} |i| i|idWn$tiid|d }nX|S( s Fetch a file based on the URI provided. If you do not pass in a file pointer a tempfile.NamedTemporaryFile, or None if the file could not be retrieved is returned. The URI can be either an HTTP url, or "s3://bucket_name/key_name" s Fetching %sss3://Ritaws_access_key_idtaws_secret_access_keyisProblem Retrieving file: %sN(R,RktinfoR0ttempfiletNamedTemporaryFileR1RR8t connect_s3t get_buckettget_keytget_contents_to_fileRR_tHTTPPasswordMgrWithDefaultRealmt add_passwordtHTTPBasicAuthHandlerRatinstall_openerRtwriteRdtseekRl( turitfileRRt bucket_nametkey_nameRtbucketR)tpassmant authhandlerRwR((s./usr/lib/python2.6/site-packages/boto/utils.pyt fetch_files2 "  t ShellCommandcBskeZeeddZddZdZdZe eeddZ dZ e e eddZ RS(cCsDd|_||_t|_||_||_|id|dS(Nitcwd(t exit_codetcommandRtlog_fptwaitt fail_fasttrun(RRRRR((s./usr/lib/python2.6/site-packages/boto/utils.pyRs      c Cs/tiid|iti|idtdtidtidtid||_|i ox_|ii djoHt i d|ii}|ii|d|ii|dq`Wtii|ii|ii|_|io2|idjo"td |id |in|iSdS( Ns running:%stshelltstdintstdouttstderrRiisCommand s failed with status (R,RkRRt subprocesstPopentTruetPIPEtprocessRtpollR0RmRnt communicateRRtgetvaluet returncodeRRRj(RRRE((s./usr/lib/python2.6/site-packages/boto/utils.pyR#s&      cCs tdS(N(tAttributeError(Rtvalue((s./usr/lib/python2.6/site-packages/boto/utils.pyt setReadOnly9scCs|iS(N(R(R((s./usr/lib/python2.6/site-packages/boto/utils.pyt getStatus<ssThe exit code for the commandcCs |iiS(N(RR(R((s./usr/lib/python2.6/site-packages/boto/utils.pyt getOutputBss*The STDIN and STDERR output of the commandN( RRRRR0RRR R tpropertytstatusR toutput(((s./usr/lib/python2.6/site-packages/boto/utils.pyRs       tAuthSMTPHandlercBs eZdZdZdZRS(s This class extends the SMTPHandler in the standard Python logging module to accept a username and password on the constructor and to then use those credentials to authenticate with the SMTP server. To use this, you could add something like this in your boto config file: [handler_hand07] class=boto.utils.AuthSMTPHandler level=WARN formatter=form07 args=('localhost', 'username', 'password', 'from@abc', ['user1@abc', 'user2@xyz'], 'Logger Subject') cCs5tt|i||||||_||_dS(s Initialize the handler. We have extended the constructor to accept a username/password for SMTP authentication. N(RRRRR(RtmailhostRRtfromaddrttoaddrstsubject((s./usr/lib/python2.6/site-packages/boto/utils.pyRWs  c Csy|i}|p ti}nti|i|}|i|i|i|i|}d|i di |i |i |t ii|f}|i|i |i ||iWn/ttfj o n|i|nXdS(s Emit a record. Format the record and send it to the specified addressees. It would be really nice if I could add authorization to this class without having to resort to cut and paste inheritance but, no. s-From: %s To: %s Subject: %s Date: %s %st,N(tmailporttsmtplibt SMTP_PORTtSMTPRtloginRRtformatRR;Rt getSubjecttemailRt formatdatetsendmailtquittKeyboardInterruptt SystemExitt handleError(Rtrecordtporttsmtptmsg((s./usr/lib/python2.6/site-packages/boto/utils.pytemitds$   (RRt__doc__RR'(((s./usr/lib/python2.6/site-packages/boto/utils.pyRIs  tLRUCachecBs~eZdZdefdYZdZdZdZdZdZ dZ d Z d Z d Z d ZRS( sqA dictionary-like object that stores only a certain number of items, and discards its least recently used item when full. >>> cache = LRUCache(3) >>> cache['A'] = 0 >>> cache['B'] = 1 >>> cache['C'] = 2 >>> len(cache) 3 >>> cache['A'] 0 Adding new items to the cache does not increase its size. Instead, the least recently used item is dropped: >>> cache['D'] = 3 >>> len(cache) 3 >>> 'B' in cache False Iterating over the cache returns the keys, starting with the most recently used: >>> for key in cache: ... print key D A C This code is based on the LRUCache class from Genshi which is based on `Myghty `_'s LRUCache from ``myghtyutils.util``, written by Mike Bayer and released under the MIT license (Genshi uses the BSD License). t_ItemcBseZdZdZRS(cCs&d|_|_||_||_dS(N(R0tprevioustnextR)R(RR)R((s./usr/lib/python2.6/site-packages/boto/utils.pyRs cCs t|iS(N(treprR(R((s./usr/lib/python2.6/site-packages/boto/utils.pyRs(RRRR(((s./usr/lib/python2.6/site-packages/boto/utils.pyR*s cCs+t|_||_d|_d|_dS(N(tdictt_dicttcapacityR0theadttail(RR0((s./usr/lib/python2.6/site-packages/boto/utils.pyRs   cCs ||ijS(N(R/(RR)((s./usr/lib/python2.6/site-packages/boto/utils.pyt __contains__sccs-|i}x|o|iV|i}q WdS(N(R1R)R,(Rtcur((s./usr/lib/python2.6/site-packages/boto/utils.pyt__iter__s  cCs t|iS(N(RR/(R((s./usr/lib/python2.6/site-packages/boto/utils.pyt__len__scCs!|i|}|i||iS(N(R/t _update_itemR(RR)titem((s./usr/lib/python2.6/site-packages/boto/utils.pyRs  cCss|ii|}|djo0|i||}||i|<|i|n!||_|i||idS(N(R/RqR0R*t _insert_itemRR7t _manage_size(RR)RR8((s./usr/lib/python2.6/site-packages/boto/utils.pyt __setitem__s    cCs t|iS(N(R-R/(R((s./usr/lib/python2.6/site-packages/boto/utils.pyRscCsUd|_|i|_|idj o||i_n ||_||_|idS(N(R0R+R1R,R2R:(RR8((s./usr/lib/python2.6/site-packages/boto/utils.pyR9s    cCswxpt|i|ijoV|i|ii=|i|ijo|ii|_d|i_qd|_|_qWdS(N( RR/R0R2R)R1R+R0R,(R((s./usr/lib/python2.6/site-packages/boto/utils.pyR:scCs|i|jodS|i}|i|_|idj o||i_n ||_d|_|i|_||i_|_dS(N(R1R+R,R0R2(RR8R+((s./usr/lib/python2.6/site-packages/boto/utils.pyR7s     (RRR(tobjectR*RR3R5R6RR;RR9R:R7(((s./usr/lib/python2.6/site-packages/boto/utils.pyR)s$       tPasswordcBsGeZdZeZdddZdZdZdZ dZ RS(sp Password object that stores itself as hashed. Hash defaults to SHA512 if available, MD5 otherwise. cCs!||_|o ||_ndS(sh Load the string from an initial value, this should be the raw hashed password. N(R3thashfunc(RR3R>((s./usr/lib/python2.6/site-packages/boto/utils.pyRs cCs?t|tp|id}n|i|i|_dS(Nsutf-8(RURVtencodeR>t hexdigestR3(RR((s./usr/lib/python2.6/site-packages/boto/utils.pytsetscCs t|iS(N(R3(R((s./usr/lib/python2.6/site-packages/boto/utils.pyR scCs]|djotSt|tp|id}nt|i|it|ijS(Nsutf-8(R0RRURVR?R3R>R@(Rtother((s./usr/lib/python2.6/site-packages/boto/utils.pyt__eq__s  cCs |iot|iSdSdS(Ni(R3R(R((s./usr/lib/python2.6/site-packages/boto/utils.pyR6s N( RRR(t_hashfnR>R0RRARRCR6(((s./usr/lib/python2.6/site-packages/boto/utils.pyR=s   c Cs|pg}|o#dtiidd|f}n|ptiiddd}n|o-ytiiddd}tiii}||d<||d <||d 'camel_case' pythonize_name('already_pythonized') -> 'already_pythonized' pythonize_name('HTTPRequest') -> 'http_request' pythonize_name('HTTPStatus200Ok') -> 'http_status_200_ok' pythonize_name('UPPER') -> 'upper' pythonize_name('') -> '' s\1_\2(t_first_cap_regextsubt_number_cap_regext_end_cap_regexR/(Rts1ts2((s./usr/lib/python2.6/site-packages/boto/utils.pytpythonize_nameks s text/plaint:cCs;tiii}x|D]\}}t||}|idd\}} |djotiii|d| } n6tiii || } | i |ti i | | i ddd||i| qW|i} |oPt} tidd d | } z| i| Wd | iX| i} n| S( sDescription: :param content: A list of tuples of name-content pairs. This is used instead of a dict to ensure that scripts run in order :type list of tuples: :param compress: Use gzip to compress the scripts, defaults to no compression :type bool: :param deftype: The type that should be assumed if nothing else can be figured out :type str: :param delimiter: mime delimiter :type str: :return: Final mime multipart :rtype: str: RiRNt_subtypesContent-Dispositiont attachmenttfilenametmodetwbtfileobjN(RRWRXRYtguess_mime_typeR8RNR[R\R]R^R_R`t add_headerRZReRtgziptGzipFileRtcloseR(tcontenttcompresstdeftypet delimitertwrapperRtcont definite_typetmaintypetsubtypetmime_contrcontentRCtgz((s./usr/lib/python2.6/site-packages/boto/utils.pytwrite_mime_multipart}s*      cCsrhdd6dd6dd6dd6d d 6d d 6}|}x5|iD]'\}}|i|o |}PqCqCW|S( sDescription: Guess the mime type of a block of text :param content: content we're finding the type of :type str: :param deftype: Default mime type :type str: :rtype: : :return: stext/x-include-urls#includestext/x-shellscripts#!stext/cloud-configs #cloud-configstext/upstart-jobs #upstart-jobstext/part-handlers #part-handlerstext/cloud-boothooks#cloud-boothook(RR1(RRtstarts_with_mappingstrtypet possible_typetmimetype((s./usr/lib/python2.6/site-packages/boto/utils.pyRs    i cCst|||dtS(s Compute MD5 hash on passed file and return results in a tuple of values. :type fp: file :param fp: File pointer to the file to MD5 hash. The file pointer will be reset to its current location before the method returns. :type buf_size: integer :param buf_size: Number of bytes per read request. :type size: int :param size: (optional) The Maximum number of bytes to read from the file pointer (fp). This is useful when uploading a file in multiple parts where the file is being split inplace into different parts. Less bytes may be available. :rtype: tuple :return: A tuple containing the hex digest version of the MD5 hash as the first element, the base64 encoded version of the plain digest as the second element and the data size as the third element. thash_algorithm(t compute_hashR(tfptbuf_sizetsize((s./usr/lib/python2.6/site-packages/boto/utils.pyt compute_md5sc Cs`|}|i}|o ||jo|i|}n|i|}x|ot|tp|id}n|i||o&|t|8}|djoPqn|o ||jo|i|}qN|i|}qNW|i}t|i i d}|ddjo|dd!}n|i|} |i |||| fS(Nsutf-8iis ( ttellRdRURVR?tupdateRR@RtdigestRWR( RRRRthash_objtsposRt hex_digestt base64_digestt data_size((s./usr/lib/python2.6/site-packages/boto/utils.pyRs0       cCs<g}|D]*}|i|ijo ||q q ~S(s Takes a specific header name and a dict of headers {"name": "value"}. Returns a list of matching header names, case-insensitive. (R/(RR>RGth((s./usr/lib/python2.6/site-packages/boto/utils.pytfind_matching_headersscs,t|}difd|DS(s Takes a specific header name and a dict of headers {"name": "value"}. Returns a string of all header values, comma-separated, that match the input header name, case-insensitive. Rc3s8x1|]*}|dj ot|VqqWdS(N(R0R3(t.0R(R>(s./usr/lib/python2.6/site-packages/boto/utils.pys s (RR;(RR>tmatching_headers((R>s./usr/lib/python2.6/site-packages/boto/utils.pytmerge_headers_by_namest RequestHookcBseZdZedZRS(s This can be extended and supplied to the connection object to gain access to request and response object after the request completes. One use for this would be to implement some specific request logging. cCsdS(N((RR_tresponseRg((s./usr/lib/python2.6/site-packages/boto/utils.pythandle_request_datas(RRR(RR(((s./usr/lib/python2.6/site-packages/boto/utils.pyRs(VR(RRmtlogging.handlersR R,t boto.providerRRRRtretemail.mime.multipartRtemail.mime.basetemail.mime.textt email.utilstemail.encodersRt threadingRt boto.compatRRRRt contextlibRthashlibRRRDRtboto.compat.jsonRt ImportErrorRR9tcompileRuRwRxR#R0RKRTRZRR}RR.R~RRRRRRRtLockRRRRRRRR<Rthandlerst SMTPHandlerRR)R=RnRqRtR{RRRRRRRR(((s./usr/lib/python2.6/site-packages/boto/utils.pyt(s                  "        9  # v       #07w& 7 -