/usr/lib/python2.6/site-packages/swiftclient
NameSizeModeActions
client.py633230644editdlrm
client.pyc549830644editdlrm
command_helpers.py66150644editdlrm
command_helpers.pyc66920644editdlrm
exceptions.py24640644editdlrm
exceptions.pyc18220644editdlrm
multithreading.py75690644editdlrm
multithreading.pyc90710644editdlrm
service.py895930644editdlrm
service.pyc579250644editdlrm
shell.py629740755editdlrm
shell.pyc495480644editdlrm
utils.py74360644editdlrm
utils.pyc92340644editdlrm
version.py12870644editdlrm
version.pyc4620644editdlrm
__init__.py10730644editdlrm
__init__.pyc4060644editdlrm
Edit: /usr/lib/python2.6/site-packages/swiftclient/utils.pyc (9234B)
Ñò ;vVc@sâdZddkZddkZddkZddkZddkZddkZddkZedƒZ d Z d „Z d „Z e d „Zd „Zd„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(s3Miscellaneous utility functions for use with Swift.iÿÿÿÿNttruet1tyestontttyt d41d8cd98f00b204e9800998ecf8427ecCs0|tjp#t|tiƒo|iƒtjS(s¯ Returns True if the value is either True or a string in TRUE_VALUES. Returns False otherwise. This function comes from swift.common.utils.config_true_value() (tTruet isinstancetsixt string_typestlowert TRUE_VALUES(tvalue((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytconfig_true_values cCsî|oÙd}tdƒ}t|ƒ}|djoxF|djo8y|idƒ}Wntj oPnX|d:}q5W|djo5|djod||f}q½d||f}qÁn|djod |}qên d |}|S( s convert a number > 1024 to printable format, either in 4 char -h format as with ls -lh or return as 12 char right justified string ttKMGTPEZYiiÿg@i s%3d%ss%.1f%ss%4ss%12s(tlisttfloattpopt IndexError(tbytest human_flagtsuffixtmodsttemp((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt prt_bytes&s(        c Cs+|djotdƒ‚ny1|pttiƒ|ƒ}n t|ƒ}Wntj otdƒ‚nXdddddg}|iƒ|jo)tid ƒ}|id |iƒƒnd i|iƒt |ƒ|gƒ}t i |i ƒ|i ƒt iƒiƒ} d id |d| d|ƒS(s³Generates a temporary URL that gives unauthenticated access to the Swift object. :param path: The full path to the Swift object. Example: /v1/AUTH_account/c/o. :param seconds: The amount of time in seconds the temporary URL will be valid for. :param key: The secret temporary URL key set on the Swift cluster. To set a key, run 'swift post -m "Temp-URL-Key:b3968d0207b54ece87cccc06515a89d4"' :param method: A HTTP method, typically either GET or PUT, to allow for this temporary URL. :raises: ValueError if seconds is not a positive integer :raises: TypeError if seconds is not an integer :return: the path portion of a temporary URL is"seconds must be a positive integersseconds must be an integertGETtPUTtHEADtPOSTtDELETEt swiftclientsCNon default HTTP method %s for tempurl specified, possibly an errors s0{path}?temp_url_sig={sig}&temp_url_expires={exp}tpathtsigtexp(t ValueErrortintttimet TypeErrortuppertloggingt getLoggertwarningtjointstrthmactnewtencodethashlibtsha1t hexdigesttformat( R!tsecondstkeytmethodtabsolutet expirationtstandard_methodstloggert hmac_bodyR"((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytgenerate_temp_urlDs*  $  cCsed}|iddƒ}d|jo*|iddƒdiddƒd}nti|i|ƒƒS(Nsutf-8s content-typeRs ; charset=it;i(tgettsplittjsontloadstdecode(theaderstbodytcharsett content_type((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytparse_api_responsess  *cCsAy&tiƒ}tiƒ}||fSWntj odSXdS(ss Reports a timestamp and full traceback for a given exception. :return: Full traceback and timestamp. N(NN(t tracebackt format_excR&tAttributeErrortNone(tformatted_linestnow((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytreport_traceback}s   tNoopMD5cBs#eZd„Zd„Zd„ZRS(cOsdS(N((tselftatkw((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt__init__ŒscOsdS(N((RQRRRS((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytupdatescOsdS(NR((RQRRRS((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyR3’s(t__name__t __module__RTRUR3(((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyRP‹s  tReadableToIterablecBsAeZdZded„Zd„Zd„Zd„Zd„ZRS(s— Wrap a filelike object and act as an iterator. It is recommended to use this class only on files opened in binary mode. Due to the Unicode changes in python 3 files are now opened using an encoding not suitable for use with the md5 class and because of this hit the exception on every call to next. This could cause problems, especially with large files and small chunk sizes. icCs6|o tiƒntƒ|_||_||_dS(sõ :param content: The filelike object that is yielded from. :param chunk_size: The max size of each yielded item. :param md5: Flag to enable calculating the MD5 of the content as it is yielded. N(R1tmd5RPtmd5sumtcontentt chunk_size(RQR[R\RY((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyRT¡s  cCs |iiƒS(N(RZR3(RQ((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt get_md5sum¬scCsj|ii|iƒ}|p t‚ny|ii|ƒWn)tj o|ii|iƒƒnX|S(sÉ Both ``__next__`` and ``next`` are provided to allow compatibility with python 2 and python 3 and their use of ``iterable.next()`` and ``next(iterable)`` respectively. (R[treadR\t StopIterationRZRUR'R0(RQtchunk((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt__next__¯s cCs |iƒS(N(Ra(RQ((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pytnextÀscCs|S(N((RQ((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt__iter__Ãs( RVRWt__doc__tFalseRTR]RaRbRc(((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyRX–s     t LengthWrappercBs5eZdZed„Zd„Zd„Zd„ZRS(sÆ Wrap a filelike object with a maximum length. Fix for https://github.com/kennethreitz/requests/issues/1648 It is recommended to use this class only on files opened in binary mode. cCs=|o tiƒntƒ|_||_|_||_dS(sa :param readable: The filelike object to read from. :param length: The maximum amount of content to that can be read from the filelike object before it is simulated to be empty. :param md5: Flag to enable calculating the MD5 of the content as it is read. N(R1RYRPRZt_lengtht _remainingt _readable(RQtreadabletlengthRY((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyRTÎs cCs|iS(N(Rg(RQ((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyt__len__ÛscCs |iiƒS(N(RZR3(RQ((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyR]ÞscOsŠ|idjodS|ii||Ž|i }|it|ƒ8_y|ii|ƒWn)tj o|ii|iƒƒnX|S(NiR(RhRiR^tlenRZRUR'R0(RQtargstkwargsR`((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyR^ás(RVRWRdReRTRlR]R^(((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyRfÇs   (strueRsyessonRR(RdR1R.RAR)R R&RItsetR t EMPTY_ETAGRRReR=RHROtobjectRPRXRf(((s=/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/utils.pyts"          /  1