From cfb99b335c0135e9fc834a30859409f120adf214 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Mon, 9 Nov 2020 20:33:34 -0600 Subject: [PATCH] Refactory render --- source/diff.py | 6 ------ source/easymacro2.py | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/diff.py b/source/diff.py index c992573..fbc9485 100644 --- a/source/diff.py +++ b/source/diff.py @@ -3480,12 +3480,6 @@ def get_size_screen(): return res.strip() -# ~ Export ok -def render(template, data): - s = Template(template) - return s.safe_substitute(**data) - - # ~ Export ok def format(template, data): """ diff --git a/source/easymacro2.py b/source/easymacro2.py index b9cb194..e182ff7 100644 --- a/source/easymacro2.py +++ b/source/easymacro2.py @@ -46,6 +46,7 @@ from enum import IntEnum from functools import wraps from pathlib import Path from pprint import pprint +from string import Template from typing import Any import smtplib @@ -666,6 +667,11 @@ def get_epoch(): return int(time.mktime(n.timetuple())) +def render(template, data): + s = Template(template) + return s.safe_substitute(**data) + + def _get_key(password): from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC