Small fix to my proposal above: pass the flags to re.compile
REPL = dict([(re.compile(k, flags=re.IGNORECASE), lambda m: random.choice(v) if
isinstance(v, list) else v) for k, v in REPL.iteritems()])
And you can then replace the loop by:
for k, v in REPL.iteritems():
s = k.sub(v, s)
I has a bug ;-)
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-lolcat/+merge/113264
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-lolcat.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp