mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 13:33:23 +02:00
...
This commit is contained in:
parent
2d574c2b85
commit
2c0c9eec76
1 changed files with 4 additions and 2 deletions
|
|
@ -168,9 +168,11 @@ def quoted(x):
|
|||
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…
Reference in a new issue