Key-value query url builder (of the form: "base/v0/k1=v1/k2=v2").

def kvpath(self, base, *pa, **kw):
        """Key-value query url builder (of the form: "base/v0/k1=v1/k2=v2"). """
        def fmt(vtuple):
            typ, val = vtuple
            if not val is None:
                return safeformat("{:%s}"%typ, val)
            return None
        parts = [base]
        for v in pa:
            fv = fmt(v)
            if not fv is None:
                parts.append(quote(fv))
        for k,v in kw.items():
            fv = fmt(v)
            if not fv is None:
                parts.append(quote(k+"="+fv))
        return "/".join(parts)