(self, uri)
return parsed
Convert urlparse from a python 2.4 layout to a python 2.7 layout
Convert urlparse from a python 2.4 layout to a python 2.7 layout
Convert urlparse from a python 2 . 4 layout to a python 2 . 7 layout
def parse_url(self, uri):
        """
        Convert urlparse from a python 2.4 layout to a python 2.7 layout
        """
        parsed = urlparse.urlparse(uri)
        if 'scheme' not in parsed:
            class Object(object):
                pass
            newparsed = Object()
            newparsed.scheme = parsed[0]
            newparsed.netloc = parsed[1]
            newparsed.path = parsed[2]
            newparsed.params = parsed[3]
            newparsed.query = parsed[4]
            newparsed.fragment = parsed[5]
            newparsed.username = ''
            newparsed.password = ''
            newparsed.hostname = ''
            newparsed.port = ''
            parsed = newparsed
        return parsed
def parse_url ( self , uri ) : parsed = urlparse . urlparse ( uri ) if 'scheme' not in parsed : class Object ( object ) : pass newparsed = Object ( ) newparsed . scheme = parsed [ 0 ] newparsed . netloc = parsed [ 1 ] newparsed . path = parsed [ 2 ] newparsed . params = parsed [ 3 ] newparsed . query = parsed [ 4 ] newparsed . fragment = parsed [ 5 ] newparsed . username = '' newparsed . password = '' newparsed . hostname = '' newparsed . port = '' parsed = newparsed return parsed