Commit Graph

17 Commits

Author SHA1 Message Date
Brian S. Stephan 8d6d66333b Module: don't pass DrBotServerConnection to init
another "this is unnecessary" change, obviously impacting all the
modules that override __init__ as well as the base class. again, they
can use the DrBotIRC instance for anything, which is (with one
exception) only for add/remove_global_handler, which i'm planning on
working my way off of anyway
2012-12-19 21:06:53 -06:00
Brian S. Stephan 3e76f75bba Module: remove reply(), use DrBotIRC's
obviously this means all of the modules changed to accomodate. this is
one of many steps to reduce the number of times we pass connections and
servers and other such info around, when it's mostly unnecessary because
modules have a reference to DrBotIRC
2012-12-19 20:51:35 -06:00
Brian S. Stephan 8b2269c441 pyflakes cleanups 2012-07-27 20:38:45 -05:00
Brian S. Stephan 033631e5c2 no longer encode/decode UTF8 stuff when going to/from database
seems safe so far (famous last words)
2012-07-27 16:34:57 -05:00
Brian S. Stephan 7bd5558f05 ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin for case-sensitivity 2012-07-27 14:57:41 -05:00
Brian S. Stephan 1a36becead convert to a MySQL backend
WARNING!
there's no going back now. this change is *huge* but it was overdue.
WARNING!

the database backend is now mysql. modules that should use a database
but don't yet were left untouched, they'll come later. scripts haven't
been converted yet, though i'm pretty sure i'll need to soon.

while i was going through everything, connection/cursor idioms were
cleaned up, as were a bunch of log messages and exception handling. this
change is so gross i'm happy things appear to be working, which is
the case --- all modules are lightly tested.
2012-07-27 02:18:01 -05:00
Brian S. Stephan 9654f4de98 switch to use python's logging, with config file i'm not entirely happy about 2012-07-15 21:32:12 -05:00
Brian S. Stephan 731aec8c0c DrBotIRC, Facts: clean up some method header doc since it shows up in XML-RPC 2012-03-30 11:14:31 -05:00
Brian S. Stephan 4253c83694 Facts: expose _get_fact as an XML-RPC method 2012-03-30 10:19:16 -05:00
Brian S. Stephan 71688f2389 Facts: refactoring; move the database querying into its own method (for reuse) 2012-03-30 10:18:40 -05:00
Brian S. Stephan 097077174b close connections from get_db() 2011-06-20 22:20:41 -05:00
Brian S. Stephan 2aa369add7 rewrite recursion/alias code for the 500th time.
more of a moving of the code, actually, it now exists in (an overridden)
_handle_event, so that recursions happen against irc events directly,
rather than an already partially interpreted object.

with this change, modules don't need to implement do() nor do we have a
need for the internal_bus, which was doing an additional walk of the
modules after the irc event was already handled and turned into text. now
the core event handler does the recursion scans.

to support this, we bring back the old replypath trick and use it again,
so we know when to send a privmsg reply and when to return text so that
it may be chained in recursion. this feels old hat by now, but if you
haven't been following along, you should really look at the diff.

that's the meat of the change. the rest is updating modules to use
self.reply() and reimplementing (un)register_handlers where appropriate
2011-02-17 01:08:45 -06:00
Brian S. Stephan 359ca24856 remove replypath and all the places it was used.
with alias calling do() internally, there is no need for all this
replypath nonsense, and if there's ever a module that needs to reply
to stuff on its own outside of do(), it'd have to be implementing
all of this anyway, so it was pretty irrelevant.

this makes DrBotIRC alias/recursion stuff a bit cleaner.
2011-01-07 23:09:07 -06:00
Brian S. Stephan 0bd681c324 convert most modules to use ! commands.
okay, it's time. we got around for a while with all sorts of silly
config options and exceptions and common strings triggering bot
commands. but now it's time to man up and expect modules to be
more strict and less loosey-goosey.

convert the popular modules (i.e. the ones that still work) to
trigger on !pi rather than pi, etc. usually, this is achieved via
regex searches, although there are some weird bugs (ones i'm hoping
are caused by other recursion/alias bugs and not this commit).

more code around this will be gutted soon, but this, at least,
means you can't say 'tweet that shit, yo' and accidentally trigger
the bot.
2011-01-07 20:37:24 -06:00
Brian S. Stephan acca8723b3 convert to/standardize docstrings a bit.
this got boring fast, so it's only half done
2011-01-06 23:25:46 -06:00
Brian S. Stephan ae6eda2c6a encode facts coming out of Facts to python string 2010-12-20 22:22:37 -06:00
Brian S. Stephan b5e71d677f first cut at a database-driven fact storage module.
may still be a bit brittle
2010-10-29 00:00:55 -05:00