mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
...
This commit is contained in:
parent
2d574c2b85
commit
2c0c9eec76
@ -168,9 +168,11 @@ class Route(object):
|
|||||||
if isinstance(x, unicode):
|
if isinstance(x, unicode):
|
||||||
x = x.encode('utf-8')
|
x = x.encode('utf-8')
|
||||||
return urlquote(x, '')
|
return urlquote(x, '')
|
||||||
args = {k:quoted(v) for k, v in kwargs.iteritems()}
|
args = {k:'' for k in self.defaults}
|
||||||
|
args.update(kwargs)
|
||||||
|
args = {k:quoted(v) for k, v in args.iteritems()}
|
||||||
route = self.var_pat.sub(lambda m:'{%s}' % m.group(1).partition('=')[0].lstrip('+'), self.endpoint.route)
|
route = self.var_pat.sub(lambda m:'{%s}' % m.group(1).partition('=')[0].lstrip('+'), self.endpoint.route)
|
||||||
return route.format(**args)
|
return route.format(**args).rstrip('/')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.endpoint.route
|
return self.endpoint.route
|
||||||
|
Loading…
x
Reference in New Issue
Block a user