|
@@ -232,7 +232,7 @@ class Utils(object):
|
|
# print "sentence to test %s" % sentence
|
|
# print "sentence to test %s" % sentence
|
|
pattern = r"{{|}}"
|
|
pattern = r"{{|}}"
|
|
# prog = re.compile(pattern)
|
|
# prog = re.compile(pattern)
|
|
- check_bool = re.search(pattern, sentence)
|
|
|
|
|
|
+ check_bool = re.search(pattern, str(sentence))
|
|
if check_bool is not None:
|
|
if check_bool is not None:
|
|
return True
|
|
return True
|
|
return False
|
|
return False
|
|
@@ -247,7 +247,7 @@ class Utils(object):
|
|
|
|
|
|
pattern = r"((?:{{\s*)[\w\.]+(?:\s*}}))"
|
|
pattern = r"((?:{{\s*)[\w\.]+(?:\s*}}))"
|
|
# find everything like {{ word }}
|
|
# find everything like {{ word }}
|
|
- return re.findall(pattern, sentence)
|
|
|
|
|
|
+ return re.findall(pattern, str(sentence))
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def remove_spaces_in_brackets(sentence):
|
|
def remove_spaces_in_brackets(sentence):
|
|
@@ -259,7 +259,7 @@ class Utils(object):
|
|
|
|
|
|
pattern = '\s+(?=[^\{\{\}\}]*\}\})'
|
|
pattern = '\s+(?=[^\{\{\}\}]*\}\})'
|
|
# Remove white spaces (if any) between the variable and the double brace then split
|
|
# Remove white spaces (if any) between the variable and the double brace then split
|
|
- return re.sub(pattern, '', sentence)
|
|
|
|
|
|
+ return re.sub(pattern, '', str(sentence))
|
|
|
|
|
|
##################
|
|
##################
|
|
#
|
|
#
|