Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyroute2/ndb/__pycache__/view.cpython-39.pyc
Ðазад
a ]�hB � @ s" d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZm Z ddlmZ ddlmZ dd lmZ dd lmZ ddlmZmZ ddlmZmZ dd lmZ ddlmZ ddl m!Z! ddl"m#Z#m$Z$ ddl%m&Z&m'Z' G dd� d�Z(G dd� de)�Z*G dd� de*�Z+dS )a� Accessing objects ================= NDB objects are grouped into "views": * interfaces * addresses * routes * neighbours * rules * netns * ... Views are dictionary-like objects that accept strings or dict selectors:: # access eth0 ndb.interfaces["eth0"] # access eth0 in the netns test01 ndb.sources.add(netns="test01") ndb.interfaces[{"target": "test01", "ifname": "eth0"}] # access a route to 10.4.0.0/24 ndb.routes["10.4.0.0/24"] # same with a dict selector ndb.routes[{"dst": "10.4.0.0", "dst_len": 24}] Objects cache ============= NDB create objects on demand, it doesn't create thousands of route objects for thousands of routes by default. The object is being created only when accessed for the first time, and stays in the cache as long as it has any not committed changes. To inspect cached objects, use views' `.cache`:: >>> ndb.interfaces.cache.keys() [(('target', u'localhost'), ('tflags', 0), ('index', 1)), # lo (('target', u'localhost'), ('tflags', 0), ('index', 5))] # eth3 There is no asynchronous cache invalidation, the cache is being cleaned up every time when an object is accessed. API === � N)�OrderedDict)�partial)�cli�config)� basestring� )� check_auth)�RSLV_DELETE)�Address)� Interface�Vlan)� FDBRecord� Neighbour)�NetNS)�Route)�Rule)�Record� RecordSet)�Source�SourceProxyc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )� TmpHandlerc C s || _ || _|| _d S �N)�ndb�event�handler)�selfr r r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyroute2/ndb/view.py�__init__L s zTmpHandler.__init__c C s"