????
| Current Path : /usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/rfc3986/ |
| Current File : //usr/lib/python2.7/site-packages/pip/_vendor/urllib3/packages/rfc3986/validators.pyc |
�
}�\]c @ s d Z d d l m Z d d l m Z d d l m Z d e f d � � YZ d � Z d � Z d � Z d
� Z
d e d � Z
e d � Z e d
� Z e d � Z e d � Z e d � Z d � Z i e d 6e d 6e d 6e d 6Z e d d d g � Z d � Z d � Z d S( s3 Module containing the validation logic for rfc3986.i ( t
exceptions( t misc( t normalizerst Validatorc B s� e Z d Z e d d d d d d d g � Z d � Z d � Z d
� Z d � Z d � Z d
� Z
d � Z d � Z d � Z
RS( s� Object used to configure validation of all objects in rfc3986.
.. versionadded:: 1.0
Example usage::
>>> from rfc3986 import api, validators
>>> uri = api.uri_reference('https://github.com/')
>>> validator = validators.Validator().require_presence_of(
... 'scheme', 'host', 'path',
... ).allow_schemes(
... 'http', 'https',
... ).allow_hosts(
... '127.0.0.1', 'github.com',
... )
>>> validator.validate(uri)
>>> invalid_uri = rfc3986.uri_reference('imap://mail.google.com')
>>> validator.validate(invalid_uri)
Traceback (most recent call last):
...
rfc3986.exceptions.MissingComponentError: ('path was required but
missing', URIReference(scheme=u'imap', authority=u'mail.google.com',
path=None, query=None, fragment=None), ['path'])
t schemet userinfot hostt portt patht queryt fragmentc C s} t � | _ t � | _ t � | _ t | _ i t d 6t d 6t d 6t d 6t d 6t d 6t d 6| _ | j j � | _ d S( s# Initialize our default validations.R R R R R R R
N(
t sett allowed_schemest
allowed_hostst
allowed_portst Truet allow_passwordt Falset required_componentst copyt validated_components( t self( ( sN /tmp/pip-install-ewDPok/pip/pip/_vendor/urllib3/packages/rfc3986/validators.pyt __init__: s
c G s. x'