Fix pls?
This commit is contained in:
parent
483226d2ad
commit
5b1258f544
1 changed files with 4 additions and 4 deletions
|
@ -30,12 +30,12 @@ class TextGenerator(object):
|
||||||
required_parts = TEMPLATE_RE.findall(text)
|
required_parts = TEMPLATE_RE.findall(text)
|
||||||
|
|
||||||
for required_part in required_parts:
|
for required_part in required_parts:
|
||||||
_part = self.parts[required_part]
|
ppart = self.parts[required_part]
|
||||||
# check if the part is a single string or a list
|
# check if the part is a single string or a list
|
||||||
if not isinstance(_part, basestring):
|
if not isinstance(ppart, basestring):
|
||||||
part = random.choice(self.parts[_part])
|
part = random.choice(self.parts[required_part])
|
||||||
else:
|
else:
|
||||||
part = _part
|
part = self.parts[required_part]
|
||||||
text = text.replace("{%s}" % required_part, part)
|
text = text.replace("{%s}" % required_part, part)
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
Reference in a new issue