Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

ý#“ݧ•«iã@sÀdZddlmZddlmZddlmZddlmmZddl	m
Z
ddl	mZmZm
Z
mZmZmZmZmZmZdd	„ZGd
d„deƒZedƒZed
ƒZe e¡Gdd„de
eefƒƒZdS)z
Direct Access dictionary.
é)Úabsolute_import)Úprint_function)ÚScapy_ExceptionN)Ú	plain_str)	ÚAnyÚDictÚGenericÚIteratorÚListÚTypeVarÚUnionÚcastÚ_Generic_metaclasscCs.t|ƒ}|r$t|dƒdkr$d|}| d¡S)zM
    Modifies a string to make sure it can be used as an attribute name.
    rÚ
0123456789Zn_A________________________________________________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz_____________________________________________________________________________________________________________________________________)rÚstrÚ	translate)Úx©rúŠ/build/wlanpi-profiler-FHoT2X/wlanpi-profiler-1.0.9/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/scapy/dadict.pyÚfixname!s
rc@seZdZdS)ÚDADict_ExceptionN)Ú__name__Ú
__module__Ú__qualname__rrrrr2srÚ_KÚ_Vc@s–eZdZdZd#dd„Zdd„Zdd„Zdd	„Zd
d„Zdd
„Z	dd„Z
dd„Zdd„Zdd„Z
dd„Zdd„Zdd„Zdd„ZeZdd„Zd d!„Zd"S)$ÚDADicta_
    Direct Access Dictionary

    This acts like a dict, but it provides a direct attribute access
    to its keys through its values. This is used to store protocols,
    manuf...

    For instance, scapy fields will use a DADict as an enum::

        ETHER_TYPES[2048] -> IPv4

    Whereas humans can access::

        ETHER_TYPES.IPv4 -> 2048
    cKs||_i|_| |¡dS)N)Ú_nameÚdÚupdate)ÚselfrZkargsrrrÚ__init__KszDADict.__init__cCst|ttfƒrt|ƒSdS)zH
        Return value that is used as key for the direct access
        Úunknown)Ú
isinstancerÚbytesr)r ÚvrrrÚidentQszDADict.identcOs*x$t t||Ž¡D]\}}|||<qWdS)N)ÚsixÚ	iteritemsÚdict)r ÚargsÚkwargsÚkr%rrrrZsz
DADict.updateccs6x0t |j¡D] }t|tƒr(|ddkr|VqWdS)NrÚ_)r'Úiterkeysrr#r)r rrrrr._szDADict.iterkeyscCst| ¡ƒS)N)Úlistr.)r rrrÚkeyseszDADict.keyscCs| ¡S)N)r.)r rrrÚ__iter__iszDADict.__iter__cCst |j¡S)N)r'Ú
itervaluesr)r rrrr2mszDADict.itervaluescCst| ¡ƒS)N)r/r2)r rrrÚvaluesqsz
DADict.valuescCs*x$| ¡D]}td|||fƒq
WdS)Nz	%10s = %r)r.Úprint)r r,rrrÚ_showuszDADict._showcCsd|jt|ƒfS)Nz<%s - %s elements>)rÚlen)r rrrÚ__repr__zszDADict.__repr__cCs
|j|S)N)r)r ÚattrrrrÚ__getitem__~szDADict.__getitem__cCs||j|<dS)N)r)r r8ÚvalrrrÚ__setitem__‚szDADict.__setitem__cCs
t|jƒS)N)r6r)r rrrÚ__len__†szDADict.__len__cCst|ƒdkS)Né)r6)r rrrÚ__nonzero__ŠszDADict.__nonzero__cCs\yt ||¡Stk
rRx0t |j¡D] \}}| |¡|kr*tt|ƒSq*WYnXt‚dS)N)	ÚobjectÚ__getattribute__ÚAttributeErrorr'r(rr&r
r)r r8r,r%rrrÚ__getattr__szDADict.__getattr__cs‡fdd„ˆ ¡DƒS)Ncsg|]}ˆ |¡‘qSr)r&)Ú.0r)r rrú
<listcomp>œsz"DADict.__dir__.<locals>.<listcomp>)r2)r r)r rÚ__dir__šszDADict.__dir__N)r)rrrÚ__doc__r!r&rr.r0r1r2r3r5r7r9r;r<r>Ú__bool__rBrErrrrr:s$
	
r)rFÚ
__future__rrZscapy.errorrZscapy.modules.sixÚmodulesr'Zscapy.compatrrrrr	r
rrr
rrrrrÚ
add_metaclassrrrrrÚ<module>s,