mythmon/hamper — pull request #62 by mythmon (2014-01-31 04:29:34+00:00)
Title: External plugins

This allows for plugins to come from packages besides hamper. This could be used to make plugins that could be pip installed along side hamper, and to write plugins without necessarily getting them merged into hamper.

To test:

* Make a module somewhere on your import path (I suggest `mkdir -p $PYTHONPATH/hamperext`, assuming you have a PYTHONPATH set)
* In that, create two files: `__init__.py` and `test.py`
* In `test.py` put the below code
* in `hamper.conf`, add `hamperext/test` to your plugins list.
* Start up hamper, and make sure the `!test` command works.
* Run the tests. (I didn't add or change any, but this is still a good idea).

A really simple test Plugin, for testing.

```python
from hamper.interfaces import ChatCommandPlugin, Command

class Test(ChatCommandPlugin):
name = 'test'

class TestCommand(Command):

regex = 'test'

def command(self, bot, comm, groups):
bot.reply(comm, 'oh hai!')

test = Test()
```