Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(6)  |  Derive(2)  |  Import(2)
This is a sick-minded hack of dict, intended to be an eye-candy.
It allows to get dict's items byt dot reference:

ipdb["lo"] == ipdb.lo
ipdb["eth0"] == ipdb.eth0

Obviously, it will not work for some cases, like unicode names
of interfaces and so on. Beside of that, it introduces some
complexity.
(more...)

src/p/y/pyroute2-HEAD/pyroute2/netlink/ipdb/__init__.py   pyroute2(Download)
from socket import AF_INET
from socket import AF_INET6
from pyroute2.common import Dotkeys
from pyroute2.netlink import NetlinkError
from pyroute2.netlink.ipdb import compat
class Transactional(Dotkeys):
    '''
    An utility class that implements common transactional logic.
    '''
    _fields_cmp = {}
 
        # resolvers
        self.interfaces = Dotkeys()
        self.routes = RoutingTables(ipdb=self)
        self.by_name = Dotkeys()
        self.by_index = Dotkeys()

src/p/y/pyroute2-0.2.8/pyroute2/netlink/ipdb.py   pyroute2(Download)
from socket import AF_INET
from socket import AF_INET6
from pyroute2.common import Dotkeys
from pyroute2.netlink import NetlinkError
from pyroute2.netlink.iproute import IPRoute
class Transactional(Dotkeys):
    '''
    An utility class that implements common transactional logic.
    '''
    def __init__(self, ipdb, mode=None):
 
        # resolvers
        self.interfaces = Dotkeys()
        self.routes = RoutingTables(ipdb=self)
        self.by_name = Dotkeys()
        self.by_index = Dotkeys()