Commit Graph

13 Commits

Author SHA1 Message Date
Brian S. Stephan 6426df9ece Weather: dump json output in a prettier format 2012-10-05 10:20:34 -05:00
Brian S. Stephan 41c1a46bb2 Weather: give hints when results are ambiguous 2012-09-17 16:47:41 -05:00
Brian S. Stephan 2699396dd8 Weather: rewrite to use weather underground
this is still a work in progress, but the basic support is there
2012-09-17 16:26:29 -05:00
Brian S. Stephan 8b2269c441 pyflakes cleanups 2012-07-27 20:38:45 -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 5a81f4d1fc fix spaces in city name 2010-12-09 13:09:01 -06:00
Brian S. Stephan a19dcdb690 fix string concat thinko 2010-12-06 16:31:16 -06:00
Brian S. Stephan a8562f71a0 slight code cleanup, add windchill calculation 2010-12-06 16:01:49 -06:00
Brian S. Stephan aae4dfa062 remove a (hopefully) useless unicode() call 2010-10-27 22:48:52 -05:00
Brian S. Stephan ebd89d35cc (hopefully) properly catch/log URLError, IndexError 2010-10-25 18:23:25 -05:00
Brian S. Stephan d561d16e64 weather module. same output as in the irssi bot script. uses pywapi that was added a couple commits ago 2010-07-30 20:30:39 -05:00