Repository URL to install this package:
Version:
1.0.9-2 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
scapy
/
__pycache__
/
dadict.cpython-37.pyc
|
---|
B ý#ݧ«iã @ sÀ d Z ddlmZ ddlmZ ddlmZ ddlm mZ ddl m Z ddl mZmZm Z mZmZmZmZmZmZ dd ZG d d deZedZed Ze e¡G dd de eef ZdS )z Direct Access dictionary. é )Úabsolute_import)Úprint_function)ÚScapy_ExceptionN)Ú plain_str) ÚAnyÚDictÚGenericÚIteratorÚListÚTypeVarÚUnionÚcastÚ_Generic_metaclassc C s. 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 r c @ s e Zd ZdS )ÚDADict_ExceptionN)Ú__name__Ú __module__Ú__qualname__r r r r r 2 s r Ú_KÚ_Vc @ s e Zd ZdZd#ddZdd Zdd Zdd Zd d Zdd Z dd Z dd Zdd Zdd 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 c K s || _ i | _| |¡ d S )N)Ú_nameÚdÚupdate)Úselfr Zkargsr r r Ú__init__K s zDADict.__init__c C s t |ttfrt|S dS )zH Return value that is used as key for the direct access Úunknown)Ú isinstancer Úbytesr )r Úvr r r ÚidentQ s zDADict.identc O s* x$t t||¡D ]\}}|| |<