(self, want)
Prints Prefixlen/Netmask.

        Not really. In fact it is our universal Netmask/Prefixlen printer.
        This is considered an internel function.

        want == 0 / None        don't return anything    1.2.3.0
        want == 1               /prefix                  1.2.3.0/24
        want == 2               /netmask                 1.2.3.0/255.255.255.0
        want == 3               -lastip                  1.2.3.0-1.2.3.255
Prints Prefixlen/Netmask.
Prints Prefixlen / Netmask .
def _printPrefix(self, want):
        """Prints Prefixlen/Netmask.

        Not really. In fact it is our universal Netmask/Prefixlen printer.
        This is considered an internel function.

        want == 0 / None        don't return anything    1.2.3.0
        want == 1               /prefix                  1.2.3.0/24
        want == 2               /netmask                 1.2.3.0/255.255.255.0
        want == 3               -lastip                  1.2.3.0-1.2.3.255
        """

        if (self._ipversion == 4 and self._prefixlen == 32) or \
           (self._ipversion == 6 and self._prefixlen == 128):
            if self.NoPrefixForSingleIp:
                want = 0
        if want is None:
            want = self.WantPrefixLen
            if want is None:
                want = 1
        if want:
            if want == 2:
                # this should work wit IP and IPint
                netmask = self.netmask()
                if not isinstance(netmask, types.IntType) and not isinstance(netmask, types.LongType):
                    netmask = netmask.int()
                return "/%s" % (intToIp(netmask, self._ipversion))
            elif want == 3:
                return (
                    "-%s" % (intToIp(self.ip + self.len() - 1, self._ipversion))
                )
            else:
                # default
                return "/%d" % (self._prefixlen)
        else:
            return ''
def _printPrefix ( self , want ) : if ( self . _ipversion == 4 and self . _prefixlen == 32 ) or ( self . _ipversion == 6 and self . _prefixlen == 128 ) : if self . NoPrefixForSingleIp : want = 0 if want is None : want = self . WantPrefixLen if want is None : want = 1 if want : if want == 2 : # this should work wit IP and IPint netmask = self . netmask ( ) if not isinstance ( netmask , types . IntType ) and not isinstance ( netmask , types . LongType ) : netmask = netmask . int ( ) return "/%s" % ( intToIp ( netmask , self . _ipversion ) ) elif want == 3 : return ( "-%s" % ( intToIp ( self . ip + self . len ( ) - 1 , self . _ipversion ) ) ) else : # default return "/%d" % ( self . _prefixlen ) else : return ''