mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
...
This commit is contained in:
parent
2d574c2b85
commit
2c0c9eec76
@ -168,9 +168,11 @@ class Route(object):
|
||||
if isinstance(x, unicode):
|
||||
x = x.encode('utf-8')
|
||||
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)
|
||||
return route.format(**args)
|
||||
return route.format(**args).rstrip('/')
|
||||
|
||||
def __str__(self):
|
||||
return self.endpoint.route
|
||||
|
Loading…
x
Reference in New Issue
Block a user