Viewing File: /usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyc

ó
ö
5Xc$@sœdZddlZejdckZejddkZejdeks^dfejkoYdgknrmedƒ‚nejdhkZejjd	ƒZ	e
ed
ƒZerÁejdikrÁedƒ‚ndej
kZddlZejeƒZerddlZnddlZd
„Zddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g!ZeƒZer´eZd/„ZeefZefZn$ejZd0„ZefZefZeZ eZ!ed1ƒj"Z#d1j"Z$erNd2„Z%d3„Z&d4„Z'd5„Z(eZ)Z*d6„Z+d7„Z,d8„Z-nKd9„Z%d:„Z&d;„Z'd<„Z(d=„Z)e$Z*e.Z+d>„Z,d?„Z-ee%d@ƒee&dAƒee'dBƒee(dCƒee,dDƒee-dEƒere/fZ0e/e1fZ2ne/e3fZ0e/e3e1fZ2er_e4Z5dF„Z6e7Z8dG„Z9dH„Z:dI„Z;e<Z=n=e>Z5e7Z6ddJl?m8Z8m=Z=dK„Z9dL„Z:dM„Z;ee;dNƒer¸dOZ@ndPZ@dQ„ZAdR„ZBdS„ZCereddTdUdVddVddWƒZeDedXƒZEn*eddYdUdZddYdd[ƒZd\„ZEerOd]ed,<n
d^ed,<dd_lFmGZGd`„ZHdaeGfdb„ƒYZIeIjJeeƒdS(js7passlib.utils.compat - python 2/3 compatibility helpersiÿÿÿÿNiiiis?Passlib requires Python 2.6, 2.7, or >= 3.2 (as of passlib 1.7)itjavatpypy_version_infos0passlib requires pypy >= 2.0 (as of passlib 1.7)tPystoncCs
||_dS(sadd docstring to an objectN(t__doc__(tobjtdoc((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pytadd_doc)stPY2tPY3tPY26tBytesIOtStringIOtNativeStringIOtSafeConfigParsertprint_t	int_typest	num_typestunicode_or_bytes_typestnative_string_typestutunicodet
uascii_to_strt
bascii_to_strt
str_to_uasciit
str_to_basciitjoin_unicodet
join_bytestjoin_byte_valuestjoin_byte_elemstbyte_elem_valuetiter_byte_valuestirangetimaptlmapt	iteritemst
itervaluestnexttOrderedDicttget_method_functionRcCst|tƒst‚|S(N(t
isinstancetstrtAssertionError(ts((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRascCs"t|tƒst‚|jdƒS(Ntunicode_escape(R'R(R)tdecode(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRkstcCst|tƒst‚|S(N(R'RR)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR…scCs"t|tƒst‚|jdƒS(Ntascii(R'tbytesR)R,(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR‰scCst|tƒst‚|S(N(R'R(R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRscCs"t|tƒst‚|jdƒS(NR.(R'R(R)tencode(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR‘scCst|tƒst‚|S(N(R'tintR)(telem((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR—scCst|tƒst‚|S(N(R'R/R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR›scCs#t|tƒst‚d„|DƒS(Ncss|]}t|gƒVqdS(N(R/(t.0tc((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pys	<genexpr>¢s(R'R/R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pytiter_byte_charsŸscCs"t|tƒst‚|jdƒS(NR.(R'RR)R0(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR¥scCst|tƒst‚|S(N(R'R/R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR©scCs"t|tƒst‚|jdƒS(NR.(R'R(R)R,(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR­scCst|tƒst‚|S(N(R'R(R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR±scCstd„|DƒƒS(Ncss|]}t|ƒVqdS(N(tchr(R3tv((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pys	<genexpr>¶s(R(tvalues((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRµscCs#t|tƒst‚d„|DƒS(Ncss|]}t|ƒVqdS(N(tord(R3R4((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pys	<genexpr>¾s(R'R/R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR¼scCst|tƒst‚|S(N(R'R/R)(R*((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR5Àss-helper to convert ascii unicode -> native strs+helper to convert ascii bytes -> native strs-helper to convert ascii native str -> unicodes+helper to convert ascii native str -> bytess2iterate over byte string as sequence of ints 0-255s6iterate over byte string as sequence of 1-byte stringscOstt||ŽƒS(N(tlisttmap(tatk((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR!ìscCs
|jƒS(N(titems(td((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR"ðscCs
|jƒS(N(R8(R?((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR#òscCs|jS(N(t__next__(R((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyt
nextgetterõs(R tizipcCs
|jƒS(N(R"(R?((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR"scCs
|jƒS(N(R#(R?((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR#scCs|jS(N(R$(R((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRAss;return function that yields successive values from iterablet__func__tim_funccCst|t|ƒS(s4given (potential) method, return underlying function(tgetattrtmethod_function_attr(tfunc((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR&scCstr
|S|jS(s0given unbound method, return underlying function(RRC(RG((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pytget_unbound_method_functionscCs
d|_|S(s¢
    backward compat hack to suppress exception cause in python3.3+

    one python < 3.3 support is dropped, can replace all uses with "raise exc from None"
    N(tNonet	__cause__(texc((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pytsuppress_cause"s	s
io.BytesIOt	UnicodeIOsio.StringIOsconfigparser.ConfigParsertprintscStringIO.StringIOsStringIO.StringIOsConfigParser.SafeConfigParserc	Os‹|jdtjƒ}|jddƒ}|jddƒ}|rNtdƒ‚n|dkr^dSt|tƒpt|tƒptd„|Dƒƒ}|dkr¹|r°tdƒnd}nt|t	ƒs×tdƒ‚n|dkrþ|rõtd	ƒnd	}nt|t	ƒstd
ƒ‚nt
}|j}xO|D]G}|rGt}n
||ƒt|t
ƒsot|ƒ}n||ƒq2W||ƒdS(sThe new-style print function.tfiletseptendsinvalid keyword argumentsNcss|]}t|tƒVqdS(N(R'R(R3targ((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pys	<genexpr>Oss
send must be None or a stringt ssep must be None or a string(tpoptsyststdoutRIt	TypeErrorR'RtanyRRtTruetwritetFalset
basestringR((	targstkwdstfpRPRQtwant_unicodetfirstRZRR((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR@s6	
	
s.passlib.utils.compat._ordered_dict.OrderedDictscollections.OrderedDict(t
ModuleTypecCs@|jddƒ\}}t|d|gddƒ}t||ƒS(sChelper to import object from module; accept format `path.to.object`t.itfromlisttleveli(trsplitt
__import__RE(tsourcetmodnametmodattrtmod((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyt_import_objectwst_LazyOverlayModulecBsDeZdZed„ƒZdd„Zd„Zd„Zd„Z	RS(sgproxy module which overlays original module,
    and lazily imports specified attributes.

    this is mainly used to prevent importing of resources
    that are only needed by certain password hashes,
    yet allow them to be imported from a single location.

    used by :mod:`passlib.utils`, :mod:`passlib.crypto`,
    and :mod:`passlib.utils.compat`.
    cCs0tj|}||||ƒ}|tj|<|S(N(RUtmodules(tclstnametattrmaptorigtself((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pytreplace_module‰s

cCs8tj||ƒ||_||_tj|ƒ|_dS(N(Rbt__init__t_LazyOverlayModule__attrmapt_LazyOverlayModule__proxytloggingt	getLoggert_LazyOverlayModule__log(RsRpRqtproxy((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRus		cCs¯|j}|r+t||ƒr+t||ƒS|j}||kr˜||}t|ƒrb|ƒ}nt|ƒ}t|||ƒ|jjd||ƒ|St	d|fƒ‚dS(Nsloaded lazy attr %r: %rs%'module' object has no attribute '%s'(
RwthasattrRERvtcallableRltsetattrRztdebugtAttributeError(RstattrR{RqRhtvalue((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyt__getattr__–s	
	
cCs*|j}|rt|ƒStj|ƒSdS(N(RwtreprRbt__repr__(RsR{((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyR…¦s	
cCsjtt|jƒƒ}|j|jƒ|j|jƒ|j}|dk	r`|jt|ƒƒnt|ƒS(N(	tsettdirt	__class__tupdatet__dict__RvRwRIR:(RstattrsR{((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyt__dir__­s	N(
t__name__t
__module__RtclassmethodRtRIRuRƒR…RŒ(((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyRm}s
		(ii(ii(ii(ii(ii(ii(ii(KRRUtversion_infoRRtRuntimeErrorR	tplatformt
startswithtJYTHONR|tPYPYRtversiontPYSTONRxRyRtlogtbuiltinst__builtin__Rt__all__tdictt_lazy_attrsR(RRR/RRR\tunicode_or_bytestunicode_or_strtjoinRRRRRRRRRRR5R9R1RtfloatRtlongtrangeRR!R;R R"R#RAtzipRBtxranget	itertoolsRFR&RHRLRERttypesRbRlRmRt(((sA/usr/lib/python2.7/site-packages/passlib/utils/compat/__init__.pyt<module>sô.														
									





									
							-

	:
Back to Directory File Manager