'Finds the URL for the next lowest version with a URL.
If there is no lower version with a URL, uses the
package url property. If that isn\'t there, uses a
*higher* URL, and if that isn\'t there raises an error.'

def nearest_url(self, version):

    version_urls = self.version_urls()
    url = getattr(self.__class__, 'url', None)
    for v in version_urls:
        if ((v > version) and url):
            break
        if version_urls[v]:
            url = version_urls[v]
    return url
