From e5ddf9d4f47ea9c9fdc001eddc0a38f7d1c438a3 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 23 Mar 2016 23:58:49 -0400 Subject: [PATCH] utils: res_template() supports extra params for interpolation --- webagg/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webagg/utils.py b/webagg/utils.py index 79c8bcbc..67f1d6a6 100644 --- a/webagg/utils.py +++ b/webagg/utils.py @@ -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