From ad4ef00bc441d343bf7a3d6b1a2192645a0e28ff Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 24 Oct 2005 03:06:29 +0000 Subject: [PATCH] plugins/MoobotFactoids: Fix bug in OptionList. --- plugins/MoobotFactoids/plugin.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/plugins/MoobotFactoids/plugin.py b/plugins/MoobotFactoids/plugin.py index 11ac45a54..8d4c7dad3 100644 --- a/plugins/MoobotFactoids/plugin.py +++ b/plugins/MoobotFactoids/plugin.py @@ -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] + if '|' in ret: + L = map(''.join, + utils.iter.split('|'.__eq__, ret, + yieldEmpty=True)) + return utils.iter.choice(L) else: - return '()' + return '(%s)' % ''.join(ret) elif token == '(': ret.append(self._insideParens(lexer)) elif token == '|':