def __init__(self, url):
        """Initializes a URL object. The passed url must be an absolute url that can be parsed by urllib.

        Keyword arguments:
        url -- An absolute URL.
        """
        m_url = urlparse.urlparse(url)
        self.scheme = m_url.scheme
        self.host = m_url.netloc
        if not self.validate():
            raise ValueError("This class may only represent absolute URLs.")
        self.path = m_url.path
        self.rawquery = m_url.query
        self.query = collections.OrderedDict(sorted(urlparse.parse_qs(self.rawquery).items())) if self.rawquery is not None and self.rawquery != '' else None
        self.fragment = m_url.fragment
        self.form = {}
def __init__ ( self , url ) : m_url = urlparse . urlparse ( url ) self . scheme = m_url . scheme self . host = m_url . netloc if not self . validate ( ) : raise ValueError ( "This class may only represent absolute URLs." ) self . path = m_url . path self . rawquery = m_url . query self . query = collections . OrderedDict ( sorted ( urlparse . parse_qs ( self . rawquery ) . items ( ) ) ) if self . rawquery is not None and self . rawquery != '' else None self . fragment = m_url . fragment self . form = { }
Initializes a URL object. The passed url must be an absolute url that can be parsed by urllib.

        Keyword arguments:
        url -- An absolute URL.