jk0/pyhole — pull request #43 by pschwartz (2013-08-26 06:34:35+00:00)
Title: Subprocess msgs

This pull request contains 2 commits. The first is to facilitate better modularization of the bot based around pep8. This allowed for better code layout to achieve gh-42.

The second commit adds the Message class with 2 subclasses Notify, Reply.

This will require a change to all plugins to no longer call self.irc.notice() or self.irc.reply() directly.

The new correct method is to import:

'''from pyhole.core import Message'''

and in function that would call reply:

'''
_msg = Message.getMessage(**kwargs)
_msg.reply = "Message to return to irc"
_msg.dispatch(self.irc)
'''

TODO(pshcwartz): Simplify the building of a reply (maybe function that does .getMessage + reply = in one step and returns the message object)

TODO(pschwartz): Add irc connection to Factory so user does not need to pass it to dispatch().

TODO(pschwartz): Update current plugins to use new api.

TODO(pschwartz): further clean up client code to move irc hooks (client related not plugin) to seperate modules allowing better plugin actions based on irc hook.