How to use the gc3pie.gc3libs.compat.urlparse.SplitResult function in gc3pie

To help you get started, we’ve selected a few gc3pie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gc3pie / gc3pie / gc3pie / gc3libs / compat / urlparse.py View on Github external
for c in url[:i]:
                    if c not in scheme_chars:
                        break
                else:
                    scheme, url = url[:i].lower(), url[i + 1:]

        if url[:2] == '//':
            netloc, url = _splitnetloc(url, 2)
            if (('[' in netloc and ']' not in netloc) or
                    (']' in netloc and '[' not in netloc)):
                raise ValueError("Invalid IPv6 URL")
        if allow_fragments and scheme in uses_fragment and '#' in url:
            url, fragment = url.split('#', 1)
        if scheme in uses_query and '?' in url:
            url, query = url.split('?', 1)
        v = SplitResult(scheme, netloc, url, query, fragment)
        _parse_cache[key] = v
        return v
github gc3pie / gc3pie / gc3pie / gc3libs / compat / urlparse.py View on Github external
netloc = query = fragment = ''
        i = url.find(':')
        if i > 0:
            if url[:i] == 'http':  # optimize the common case
                scheme = url[:i].lower()
                url = url[i + 1:]
                if url[:2] == '//':
                    netloc, url = _splitnetloc(url, 2)
                    if (('[' in netloc and ']' not in netloc) or
                            (']' in netloc and '[' not in netloc)):
                        raise ValueError("Invalid IPv6 URL")
                if allow_fragments and '#' in url:
                    url, fragment = url.split('#', 1)
                if '?' in url:
                    url, query = url.split('?', 1)
                v = SplitResult(scheme, netloc, url, query, fragment)
                _parse_cache[key] = v
                return v
            if url.endswith(':') or not url[i + 1].isdigit():
                for c in url[:i]:
                    if c not in scheme_chars:
                        break
                else:
                    scheme, url = url[:i].lower(), url[i + 1:]

        if url[:2] == '//':
            netloc, url = _splitnetloc(url, 2)
            if (('[' in netloc and ']' not in netloc) or
                    (']' in netloc and '[' not in netloc)):
                raise ValueError("Invalid IPv6 URL")
        if allow_fragments and scheme in uses_fragment and '#' in url:
            url, fragment = url.split('#', 1)