From 11979f1e220587198ba05fd3c1f88d4f81195fff Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 24 May 2019 18:42:16 +0400 Subject: =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=B0=D1=8F=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B0,=20=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80.=20=D0=9F=D0=B0=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D0=BD=D0=B3=20HTTP=20=D0=B7=D0=B0=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=81=D0=BE=D0=B2=20=D1=81=D1=82=D0=B0=D0=BB=20=D0=B1?= =?UTF-8?q?=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=B3=D0=B8?= =?UTF-8?q?=D0=BC.=20=D0=A1=D0=B5=D1=80=D0=B2=D0=B5=D1=80=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BA=D0=B0=D0=BD=D1=87=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=83=20=D0=BF=D1=80=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=BD=D0=BE=D0=BC=20HTTP?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B5.=20=D0=9D=D0=B0?= =?UTF-8?q?=D1=87=D0=B0=D1=82=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=D0=B4=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D0=B5=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day7/templater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'day7/templater.py') diff --git a/day7/templater.py b/day7/templater.py index 92fb87f..ac9416e 100644 --- a/day7/templater.py +++ b/day7/templater.py @@ -2,4 +2,7 @@ def render_template(template_name, **kwargs): with open(f'templates/{template_name}.html') as f: data = f.read() - return data.format(**kwargs) + for name, value in kwargs.items(): + data = data.replace(f'%%{name}%%', value) + + return data -- cgit v1.2.3