/usr/lib/python2.6/site-packages/netaddr
Edit: /usr/lib/python2.6/site-packages/netaddr/core.pyc (8008B)
Ñò
}DVc @ sD d Z d d k Z d d k Z d d k l Z l Z e i d j Z d Z
Z d Z Z
d Z Z d e f d „ ƒ YZ d
e f d „ ƒ YZ d e f d
„ ƒ YZ y d Z e i ƒ d „ Z Wn e j
o d „ Z n Xd e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d „ Z d S( s6 Common code shared between various netaddr sub modulesiÿÿÿÿN( t _callablet _iter_dict_keyst bigi i i t AddrFormatErrorc B s e Z d Z RS( sO
An Exception indicating a network address is not correctly formatted.
( t __name__t
__module__t __doc__( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR s t AddrConversionErrorc B s e Z d Z RS( s^
An Exception indicating a failure to convert between address types or
notations.
( R R R ( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR # s t NotRegisteredErrorc B s e Z d Z RS( s\
An Exception indicating that an OUI or IAB was not found in the IEEE
Registry.
( R R R ( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR + s i* c C s
| i ƒ S( s‡
:param int_val: an unsigned integer.
:return: the minimum number of bits needed to represent value provided.
( t
bit_length( t int_val( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt num_bits7 s c C s- d } x | o | d 7} | d L} q W| S( s‡
:param int_val: an unsigned integer.
:return: the minimum number of bits needed to represent value provided.
i i ( ( R
t numbits( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR @ s
t
Subscriberc B s e Z d Z d „ Z RS( sK
An abstract class defining the interface expected by a Publisher.
c C s t d ƒ ‚ d S( sµ
A callback method used by a Publisher to notify this Subscriber about
updates.
:param data: a Python object containing data provided by Publisher.
s cannot invoke virtual method!N( t NotImplementedError( t selft data( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt updateR s ( R R R R ( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR
M s t
PrettyPrinterc B s) e Z d Z e i e d „ Z d „ Z RS( sÅ
A concrete Subscriber that employs the pprint in the standard library to
format all data from updates received, writing them to a file-like
object.
Useful as a debugging aid.
c C s | | _ | | _ d S( sô
Constructor.
:param fh: a file-like object to write updates to.
Default: sys.stdout.
:param write_eol: if ``True`` this object will write newlines to
output, if ``False`` it will not.
N( t fht write_eol( R R R ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt __init__e s c C s; | i i t i | ƒ ƒ | i o | i i d ƒ n d S( sµ
A callback method used by a Publisher to notify this Subscriber about
updates.
:param data: a Python object containing data provided by Publisher.
s
N( R t writet _pprintt pformatR ( R R ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR s s
( R R R t _syst stdoutt TrueR R ( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR \ s t Publisherc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( s²
A 'push' Publisher that maintains a list of Subscriber objects notifying
them of state changes by passing them update data when it encounter events
of interest.
c C s
g | _ d S( t ConstructorN( t subscribers( R ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR † s c C s_ t | d ƒ o; t t d ƒ ƒ o( | | i j o | i i | ƒ q[ n t d | ƒ ‚ d S( s
Add a new subscriber.
:param subscriber: a new object that implements the Subscriber object
interface.
R s subscriber.updates' %r does not support required interface!N( t hasattrR t evalR t appendt TypeError( R t
subscriber( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt attachŠ s #c C s. y | i i | ƒ Wn t j
o n Xd S( s–
Remove an existing subscriber.
:param subscriber: a new object that implements the Subscriber object
interface.
N( R t removet
ValueError( R R# ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt detach— s c C s% x | i D] } | i | ƒ q
Wd S( s
Send update data to to all registered Subscribers.
:param data: the data to be passed to each registered Subscriber.
N( R R ( R R R# ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyt notify£ s
( R R R R R$ R' R( ( ( ( s- /tmp/pip-build-lt8jXN/netaddr/netaddr/core.pyR s
t
DictDotLookupc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( s
Creates objects that behave much like a dictionaries, but allow nested
key access using object '.' (dot) lookups.
Recipe 576586: Dot-style nested lookups over dictionary based data
structures - http://code.activestate.com/recipes/576586/
c C sÏ xÈ | D]À } t | | t ƒ o t | | ƒ | i |