mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
plugins/MoobotFactoids: Fix bug in OptionList.
This commit is contained in:
parent
9883cb56ac
commit
ad4ef00bc4
@ -52,19 +52,13 @@ class OptionList(object):
|
||||
if not token:
|
||||
return '(%s' % ''.join(ret) #)
|
||||
elif token == ')':
|
||||
if len(ret) > 1:
|
||||
if '|' in ret:
|
||||
L = map(''.join,
|
||||
utils.iter.split('|'.__eq__, ret,
|
||||
yieldEmpty=True))
|
||||
return utils.iter.choice(L)
|
||||
else:
|
||||
return ''.join(ret)
|
||||
return [x for x in ret if x != '|']
|
||||
elif len(ret) == 1:
|
||||
return '(%s)' % ret[0]
|
||||
else:
|
||||
return '()'
|
||||
return '(%s)' % ''.join(ret)
|
||||
elif token == '(':
|
||||
ret.append(self._insideParens(lexer))
|
||||
elif token == '|':
|
||||
|
Loading…
Reference in New Issue
Block a user