def __init__(self, url=None, scheme=None, user=None, password=None, host=None, port=None, path=None, params=None, query=None, fragment=None):
        """Construct a URL object.
        
        If arguments other than url are provided, they are used as defaults.  The parse result of the real URL overrides these.
        """
        
        self.scheme = scheme
        self.user = user
        self.password = password
        self.host = host
        self.port = port
        self.path = path
        self.params = params
        self.query = query
        self.fragment = fragment
        
        if url is None:
            return
        
        if ( url[0] == '/' or url[1] == ':' ):
            url = "file://" + url
        
        result = urlparse(url)
        
        self.scheme = result.scheme or self.scheme
        
        result = urlparse(url.replace(self.scheme + '://', 'http://'))
        
        self.user = result.username or self.user
        self.password = result.password or self.password
        self.host = result.hostname or self.host
        self.port = result.port or self.port
        self.path = result.path or self.path
        self.params = result.params or self.params
        self.query = result.query or self.query
        self.fragment = result.fragment or self.fragment
def __init__ ( self , url = None , scheme = None , user = None , password = None , host = None , port = None , path = None , params = None , query = None , fragment = None ) : self . scheme = scheme self . user = user self . password = password self . host = host self . port = port self . path = path self . params = params self . query = query self . fragment = fragment if url is None : return if ( url [ 0 ] == '/' or url [ 1 ] == ':' ) : url = "file://" + url result = urlparse ( url ) self . scheme = result . scheme or self . scheme result = urlparse ( url . replace ( self . scheme + '://' , 'http://' ) ) self . user = result . username or self . user self . password = result . password or self . password self . host = result . hostname or self . host self . port = result . port or self . port self . path = result . path or self . path self . params = result . params or self . params self . query = result . query or self . query self . fragment = result . fragment or self . fragment
Construct a URL object.
        
        If arguments other than url are provided, they are used as defaults.  The parse result of the real URL overrides these.