def parse(self, url):
        """
        Return a configuration dict from a URL
        """
        parsed_url = urlparse.urlparse(url)
        try:
            default_config = self.CONFIG[parsed_url.scheme]
        except KeyError:
            raise ValueError(
                'unrecognised URL scheme for {}: {}'.format(
                    self.__class__.__name__, url))
        handler = self.get_handler_for_scheme(parsed_url.scheme)
        config = copy.deepcopy(default_config)
        return handler(parsed_url, config)
def parse ( self , url ) : parsed_url = urlparse . urlparse ( url ) try : default_config = self . CONFIG [ parsed_url . scheme ] except KeyError : raise ValueError ( 'unrecognised URL scheme for {}: {}' . format ( self . __class__ . __name__ , url ) ) handler = self . get_handler_for_scheme ( parsed_url . scheme ) config = copy . deepcopy ( default_config ) return handler ( parsed_url , config )
Return a configuration dict from a URL