Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
Validate the variable length subnet masking value.

>>> validateMask(50)
Traceback (most recent call last):
ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
>>> validateMask('45')
Traceback (most recent call last):
ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
>>> validateMask(32)
>>> validateMask('27')(more...)

        def validateMask(mask):
    '''
    Validate the variable length subnet masking value.

    >>> validateMask(50)
    Traceback (most recent call last):
    ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
    >>> validateMask('45')
    Traceback (most recent call last):
    ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
    >>> validateMask(32)
    >>> validateMask('27')
    >>> validateMask(17)
    >>> validateMask('0')
    >>> validateMask(-1)
    Traceback (most recent call last):
    ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
    >>> validateMask('-10')
    Traceback (most recent call last):
    ValueError: The subnet mask (prefix length) must be between 0 and 32, inclusive.
    '''
    if 0 > int(mask)  or int(mask) > 32:
        msg = ('The subnet mask (prefix length) must be between 0 and ' +
            '32, inclusive.')
        raise ValueError, msg
        


src/n/e/NetCIDR-0.0.4/netcidr/__init__.py   NetCIDR(Download)
            net, mask = net
            mask = int(mask)
            utils.validateMask(mask)
        elif len(net) > 2:
            msg = "There appear to be too many '/' in your network notation."

src/n/e/NetCIDR-0.0.4/netcidr/networks.py   NetCIDR(Download)
import itertools
 
import ipmath
from utils import validateMask, getIPList
 
            net, mask = net
            mask = int(mask)
            validateMask(mask)
        elif len(net) > 2:
            msg = "There appear to be too many '/' in your network notation."

src/n/e/NetCIDR-0.0.4/netcidr/blocks.py   NetCIDR(Download)
import itertools
 
import ipmath
from utils import validateMask, getIPList
 
            net, mask = net
            mask = int(mask)
            validateMask(mask)
        elif len(net) > 2:
            msg = "There appear to be too many '/' in your network notation."