Docs for IS_IPV4.__subclasshook__

[ Python Tutorial ] [ Python Libraries ] [ web2py epydoc ]

Description


<type 'builtin_function_or_method'>








Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__().
It should return True, False or NotImplemented. If it returns
NotImplemented, the normal algorithm is used. Otherwise, it
overrides the normal algorithm (and the outcome is cached).


Attributes


IS_IPV4.__subclasshook__.__call__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__call__(...) <==> x(...)

IS_IPV4.__subclasshook__.__class__ <type 'type'> extends (<type 'object'>,) belongs to class <type 'type'>
<attribute '__doc__' of 'builtin_function_or_method' objects>

IS_IPV4.__subclasshook__.__cmp__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__cmp__(y) <==> cmp(x,y)

IS_IPV4.__subclasshook__.__delattr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__delattr__('name') <==> del x.name

IS_IPV4.__subclasshook__.__doc__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

IS_IPV4.__subclasshook__.__eq__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__eq__(y) <==> x==y

IS_IPV4.__subclasshook__.__format__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
default object formatter

IS_IPV4.__subclasshook__.__ge__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__ge__(y) <==> x>=y

IS_IPV4.__subclasshook__.__getattribute__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__getattribute__('name') <==> x.name

IS_IPV4.__subclasshook__.__gt__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__gt__(y) <==> x>y

IS_IPV4.__subclasshook__.__hash__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__hash__() <==> hash(x)

IS_IPV4.__subclasshook__.__init__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__init__(...) initializes x; see help(type(x)) for signature

IS_IPV4.__subclasshook__.__le__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__le__(y) <==> x<=y

IS_IPV4.__subclasshook__.__lt__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__lt__(y) <==> x<y

IS_IPV4.__subclasshook__.__module__ <type 'NoneType'> belongs to class <type 'NoneType'>

IS_IPV4.__subclasshook__.__name__ <type 'str'> belongs to class <type 'str'>
str(object='') -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

IS_IPV4.__subclasshook__.__ne__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__ne__(y) <==> x!=y

IS_IPV4.__subclasshook__.__new__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
T.__new__(S, ...) -> a new object with type S, a subtype of T

IS_IPV4.__subclasshook__.__reduce__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
helper for pickle

IS_IPV4.__subclasshook__.__reduce_ex__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
helper for pickle

IS_IPV4.__subclasshook__.__repr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__repr__() <==> repr(x)

IS_IPV4.__subclasshook__.__self__ <type 'type'> extends (<class 'gluon.validators.Validator'>,) belongs to class <type 'type'>
Checks if field's value is an IP version 4 address in decimal form. Can be set to force addresses from certain range. IPv4 regex taken from: http://regexlib.com/REDetails.aspx?regexp_id=1411 Args: minip: lowest allowed address; accepts: - str, eg. 192.168.0.1 - list or tuple of octets, eg. [192, 168, 0, 1] maxip: highest allowed address; same as above invert: True to allow addresses only from outside of given range; note that range boundaries are not matched this way is_localhost: localhost address treatment: - None (default): indifferent - True (enforce): query address must match localhost address (127.0.0.1) - False (forbid): query address must not match localhost address is_private: same as above, except that query address is checked against two address ranges: 172.16.0.0 - 172.31.255.255 and 192.168.0.0 - 192.168.255.255 is_automatic: same as above, except that query address is checked against one address range: 169.254.0.0 - 169.254.255.255 Minip and maxip may also be lists or tuples of addresses in all above forms (str, int, list / tuple), allowing setup of multiple address ranges:: minip = (minip1, minip2, ... minipN) | | | | | | maxip = (maxip1, maxip2, ... maxipN) Longer iterable will be truncated to match length of shorter one. Examples: Check for valid IPv4 address: INPUT(_type='text', _name='name', requires=IS_IPV4()) Check for valid IPv4 address belonging to specific range: INPUT(_type='text', _name='name', requires=IS_IPV4(minip='100.200.0.0', maxip='100.200.255.255')) Check for valid IPv4 address belonging to either 100.110.0.0 - 100.110.255.255 or 200.50.0.0 - 200.50.0.255 address range: INPUT(_type='text', _name='name', requires=IS_IPV4(minip=('100.110.0.0', '200.50.0.0'), maxip=('100.110.255.255', '200.50.0.255'))) Check for valid IPv4 address belonging to private address space: INPUT(_type='text', _name='name', requires=IS_IPV4(is_private=True)) Check for valid IPv4 address that is not a localhost address: INPUT(_type='text', _name='name', requires=IS_IPV4(is_localhost=False)) >>> IS_IPV4()('1.2.3.4') ('1.2.3.4', None) >>> IS_IPV4()('255.255.255.255') ('255.255.255.255', None) >>> IS_IPV4()('1.2.3.4 ') ('1.2.3.4 ', 'enter valid IPv4 address') >>> IS_IPV4()('1.2.3.4.5') ('1.2.3.4.5', 'enter valid IPv4 address') >>> IS_IPV4()('123.123') ('123.123', 'enter valid IPv4 address') >>> IS_IPV4()('1111.2.3.4') ('1111.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4()('0111.2.3.4') ('0111.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4()('256.2.3.4') ('256.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4()('300.2.3.4') ('300.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4(minip='1.2.3.4', maxip='1.2.3.4')('1.2.3.4') ('1.2.3.4', None) >>> IS_IPV4(minip='1.2.3.5', maxip='1.2.3.9', error_message='Bad ip')('1.2.3.4') ('1.2.3.4', 'bad ip') >>> IS_IPV4(maxip='1.2.3.4', invert=True)('127.0.0.1') ('127.0.0.1', None) >>> IS_IPV4(maxip='1.2.3.4', invert=True)('1.2.3.4') ('1.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4(is_localhost=True)('127.0.0.1') ('127.0.0.1', None) >>> IS_IPV4(is_localhost=True)('1.2.3.4') ('1.2.3.4', 'enter valid IPv4 address') >>> IS_IPV4(is_localhost=False)('127.0.0.1') ('127.0.0.1', 'enter valid IPv4 address') >>> IS_IPV4(maxip='100.0.0.0', is_localhost=True)('127.0.0.1') ('127.0.0.1', 'enter valid IPv4 address')

IS_IPV4.__subclasshook__.__setattr__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__setattr__('name', value) <==> x.name = value

IS_IPV4.__subclasshook__.__sizeof__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
__sizeof__() -> int size of object in memory, in bytes

IS_IPV4.__subclasshook__.__str__ <type 'method-wrapper'> belongs to class <type 'method-wrapper'>
x.__str__() <==> str(x)

IS_IPV4.__subclasshook__.__subclasshook__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
Abstract classes can override this to customize issubclass(). This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).