mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +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')
|
formatter = params.get('_formatter')
|
||||||
if not formatter:
|
if not formatter:
|
||||||
formatter = ParamFormatter(params)
|
formatter = ParamFormatter(params)
|
||||||
|
|
||||||
res = formatter.format(template, url=params['url'])
|
res = formatter.format(template, url=params['url'], **extra_params)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user