summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTal Karbachinsky <talka@amdocs.com>2018-01-25 13:59:15 +0200
committerTal Karbachinsky <talka@amdocs.com>2018-01-31 09:36:32 +0000
commit990806759e3270e7718b0c4c2828430e62056832 (patch)
tree0bad3a4fb2e74c1a3e2de54f93066a6a1d973f3c
parent9e09020241a8b29297d2a07ce967bd96ea2ad2e0 (diff)
Adding string encoder supportamsterdam
Issue-ID: TEST-76 Change-Id: I805da261cd7ebb4ed4111f333cd3cd6225d87352 Signed-off-by: Tal Karbachinsky <talka@amdocs.com> (cherry picked from commit d543b6489bd975f6261cdf31efbf3c9b4ac931b4)
-rw-r--r--eteutils/StringTemplater.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/eteutils/StringTemplater.py b/eteutils/StringTemplater.py
index 680600f..36ddfab 100644
--- a/eteutils/StringTemplater.py
+++ b/eteutils/StringTemplater.py
@@ -1,3 +1,4 @@
+import json
from string import Template
class StringTemplater:
@@ -5,4 +6,8 @@ class StringTemplater:
def template_string(self, template, values):
"""Template String takes in a string and its values and converts it using the string.Template class"""
- return Template(template).substitute(values) \ No newline at end of file
+ return Template(template).substitute(values)
+
+ def string_Encoder(self,data):
+ data = json.dumps(data)
+ return data \ No newline at end of file