mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 08:04:49 +01:00
utils: res_template() supports extra params for interpolation
This commit is contained in:
parent
ba66d0bb5e
commit
e5ddf9d4f4
@ -136,12 +136,12 @@ class ParamFormatter(string.Formatter):
|
||||
|
||||
|
||||
#=============================================================================
|
||||
def res_template(template, params):
|
||||
def res_template(template, params, **extra_params):
|
||||
formatter = params.get('_formatter')
|
||||
if not formatter:
|
||||
formatter = ParamFormatter(params)
|
||||
|
||||
res = formatter.format(template, url=params['url'])
|
||||
res = formatter.format(template, url=params['url'], **extra_params)
|
||||
|
||||
return res
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user