1
0
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:
Ilya Kreymer 2016-03-23 23:58:49 -04:00
parent ba66d0bb5e
commit e5ddf9d4f4

View File

@ -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