(base_url, path)
prepend url with hostname unless it's already an absolute URL
prepend url with hostname unless it's already an absolute URL
prepend url with hostname unless it s already an absolute URL
def build_url(base_url, path):
    """ prepend url with hostname unless it's already an absolute URL """
    if absolute_http_url_regexp.match(path):
        return path
    elif base_url:
        return "{}/{}".format(base_url.rstrip("/"), path.lstrip("/"))
    else:
        raise ParamsError("base url missed!")
def build_url ( base_url , path ) : if absolute_http_url_regexp . match ( path ) : return path elif base_url : return "{}/{}" . format ( base_url . rstrip ( "/" ) , path . lstrip ( "/" ) ) else : raise ParamsError ( "base url missed!" )