;ò
ådê@c           @   s\   d  k  Z  d  k Z d f  d „  ƒ  YZ d „  Z e d j o e ƒ  n d Z d Z d Z d  S(   Ns   IPCalcc           B   sA   t  Z d  Z e e d „ Z d „  Z d „  Z d „  Z d „  Z RS(   s«   A wrapper class that encapsulates the command line
    functionality of the ipcalc command, providing access to computing
    network prefixes, netmasks, etc. from python.c         C   s   | |  _ | |  _ | |  _ d S(   s·   Initialize an IPCalc object.  Address must be provided, and
        in order for most of the other calculations to be possible,
        one of prefix or netmask must also be provided.N(   s   addresss   selfs   _addresss   prefixs   _prefixs   netmasks   _netmask(   s   selfs   addresss   prefixs   netmask(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   __init__   s     		c         C   s®   |  i o |  i Sn– |  i o? t i d |  i ƒ i ƒ  } t i	 d | ƒ i
 ƒ  d |  _ n t i d |  i |  i f ƒ i ƒ  } t i	 d | ƒ i
 ƒ  d |  _ |  i Sd  S(   Ns   ipcalc -m %ss   NETMASK=(\S+)i    s   ipcalc -p %s %ss   PREFIX=(\d+)(   s   selfs   _prefixs   _netmasks   oss   popens   _addresss   reads   texts   res   matchs   groups(   s   selfs   text(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   prefix   s    
#%c         C   s‰   |  i o |  i Snq |  i o  t i d |  i ƒ i ƒ  } n  t i d |  i |  i f ƒ } t i	 d | ƒ i
 ƒ  d |  _ |  i Sd  S(   Ns   ipcalc -m %ss   ipcalc -m %s/%ss   NETMASK=(\S+)i    (   s   selfs   _netmasks   _prefixs   oss   popens   _addresss   reads   texts   res   matchs   groups(   s   selfs   text(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   netmask,   s    
 c         C   s\   |  i o |  i ƒ  n t i d |  i |  i f ƒ i ƒ  } t i	 d | ƒ i
 ƒ  d Sd  S(   Ns   ipcalc -n %s/%ss   NETWORK=(\S+)i    (   s   selfs   _prefixs   prefixs   oss   popens   _addresss   reads   texts   res   matchs   groups(   s   selfs   text(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   network8   s    %c         C   s\   |  i o |  i ƒ  n t i d |  i |  i f ƒ i ƒ  } t i	 d | ƒ i
 ƒ  d Sd  S(   Ns   ipcalc -b %s/%ss   BROADCAST=(\S+)i    (   s   selfs   _prefixs   prefixs   oss   popens   _addresss   reads   texts   res   matchs   groups(   s   selfs   text(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys	   broadcast>   s    %(	   s   __name__s
   __module__s   __doc__s   Nones   __init__s   prefixs   netmasks   networks	   broadcast(    (    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   IPCalc   s    			c          C   sR   t  d d d ƒ}  d G|  i ƒ  GHd G|  i ƒ  GHd G|  i ƒ  GHd G|  i ƒ  GHd S(	   s#   Test function for the IPCalc class.s   207.175.42.15s   netmasks   255.255.254.0s   prefix:s   netmask:s   bcast:s   network:N(   s   IPCalcs   ipcs   prefixs   netmasks	   broadcasts   network(   s   ipc(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   testD   s     s   __main__s    Harald Hoyer <harald@redhat.com>s   $Date: 2004/07/06 08:09:09 $s   $Revision: 1.4.4.1 $(   s   oss   res   IPCalcs   tests   __name__s
   __author__s   __date__s   __version__(   s   IPCalcs
   __author__s   __date__s   res   tests   __version__s   os(    (    sY   /usr/src/build/423651-noarch/install/usr/share/system-config-network/netconfpkg/ipcalc.pys   ?   s   		2	
