mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Removing the "see foo" referencing code as it is error-prone (it's really tough
to accurately track self-referencing leading to recursion and circular references leading to infinite looping) and I don't think it's all that useful. Fixing it would make the already-contorted code of this plugin even worse!
This commit is contained in:
parent
a79bc26201
commit
4e7d862373
@ -173,11 +173,6 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
elif newfact.startswith("<action>"):
|
elif newfact.startswith("<action>"):
|
||||||
newfact = newfact[8:]
|
newfact = newfact[8:]
|
||||||
type = "action"
|
type = "action"
|
||||||
elif newfact.startswith("see "):
|
|
||||||
newfact = newfact[4:]
|
|
||||||
type = "refer"
|
|
||||||
# shortcut the substitutions here
|
|
||||||
return (type, newfact)
|
|
||||||
newfact = newfact.strip()
|
newfact = newfact.strip()
|
||||||
newfact = plugins.standardSubstitute(irc, msg, newfact)
|
newfact = plugins.standardSubstitute(irc, msg, newfact)
|
||||||
return (type, newfact)
|
return (type, newfact)
|
||||||
@ -234,11 +229,6 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
irc.reply(text, prefixName=False)
|
irc.reply(text, prefixName=False)
|
||||||
elif type == "define":
|
elif type == "define":
|
||||||
irc.reply("%s is %s" % (key, text), prefixName=False)
|
irc.reply("%s is %s" % (key, text), prefixName=False)
|
||||||
elif type == "refer":
|
|
||||||
# text here is the new key to refer to
|
|
||||||
msg.args = [s.replace(key, text) for s in msg.args]
|
|
||||||
newtokens = [s.replace(key, text) for s in tokens]
|
|
||||||
self.invalidCommand(irc, msg, newtokens)
|
|
||||||
else:
|
else:
|
||||||
irc.error("Spurious type from _parseFactoid.")
|
irc.error("Spurious type from _parseFactoid.")
|
||||||
return True
|
return True
|
||||||
|
@ -115,11 +115,6 @@ if sqlite is not None:
|
|||||||
self.assertResponse('moo', 'foo')
|
self.assertResponse('moo', 'foo')
|
||||||
self.assertNotError('foo is bar _is_ baz')
|
self.assertNotError('foo is bar _is_ baz')
|
||||||
self.assertResponse('foo is bar', 'foo is bar is baz')
|
self.assertResponse('foo is bar', 'foo is bar is baz')
|
||||||
# Check the "see ..." referencing
|
|
||||||
self.assertNotError('bar is see moo')
|
|
||||||
self.assertResponse('bar', 'foo')
|
|
||||||
self.assertNotError('bar2 _is_ see foo is bar')
|
|
||||||
self.assertResponse('bar2', 'foo is bar is baz')
|
|
||||||
|
|
||||||
def testFactinfo(self):
|
def testFactinfo(self):
|
||||||
self.assertNotError('moo is <reply>foo')
|
self.assertNotError('moo is <reply>foo')
|
||||||
|
Loading…
Reference in New Issue
Block a user