Commit Graph

16 Commits

Author SHA1 Message Date
Daniel Folkinshteyn
a345262846 Factoids: fix bug when making an alias to a newkey that already has a factoid associated with it. 2011-08-14 14:58:11 -04:00
Daniel Folkinshteyn
e4c51ef517 Add --raw option to factoids.whatis, which disables variable substitution on the factoid.
also add test for this.
2010-04-28 15:27:08 -04:00
Daniel Folkinshteyn
976ad82d69 Use the ircutils.standardSubsitute function upon factoid output.
This allows inclusion of the usual standardSubstitute vars within factoids.

There is no config to disable this, since it is possible to escape the substitutions
by simply doubling the dollar signs, as per the python documentation:
http://docs.python.org/library/string.html#template-strings

Thus, if you want a factoid to output a literal "$channel", for example, all
you'd need to do is use "$$channel" in your factoid text, which will come out
as "$channel" when said by the bot.

Also added tests for this new behavior.
2010-04-28 00:10:48 -04:00
Daniel Folkinshteyn
f1517a7acc some enhancements Factoids.rank:
output options: plain key output, and alpha sorting for plain output.
allow an optional argument for how many ranked facts to show.
2010-04-25 02:58:43 -04:00
Daniel Folkinshteyn
022193b61b for Factoids: make approximate fuzzy key searches also when invoking whatis directly.
also add tests.
while there, remove useless config setting for replyinvalidcommand testing, since it is true by default.
2010-04-18 03:33:10 -04:00
Daniel Folkinshteyn
5d9273cd5a add damerau-levenshtein distance to supybot.utils.seq
use it in factoids invalid command to match possible typos
write tests for same.
2010-04-07 12:33:28 -04:00
Daniel Folkinshteyn
f988736ca6 add tests for factoids.alias 2010-04-02 00:55:02 -04:00
Daniel Folkinshteyn
97149b403a make 'factoids info' include usage count in output. add test for same. 2010-04-01 00:51:25 -04:00
nanotube
32c718ca66 don't give up too easily with invalid command, instead search factoid keys with wildcard first. 2010-03-23 16:44:33 -04:00
nanotube
2e043ce19f add rank test to factoids, update factoids test code to sqlite3 2010-03-23 13:54:31 -04:00
Daniel Folkinshteyn
c2b1c1b143 This merges an old branch i had for sqlite3 factoids+moobotfactoids.
fix up moobotfactoids+factoids to use the sqlite text_factory=str,
also fixed up a test for factoid search, since it now sorts keys alphabetically.
2010-03-21 02:44:07 -04:00
James Vega
10f5a12b7e Factoids: Prevent empty key or value when adding a factoid.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-02-05 18:50:48 -05:00
James Vega
1f3d9e64a3 Add test to ensure quoted factoids are preserved 2009-03-11 13:37:26 -04:00
James Vega
a3e4fc5b1d Change the modeline to use softtabstop instead of tabstop. 2006-02-11 15:52:51 +00:00
James Vega
979cbd551d Fix some bugs in the Factoids conversion. 2005-04-17 21:38:17 +00:00
James Vega
6b38346b5a Factoids should be under plugins/ 2005-04-17 21:01:12 +00:00