source: protocols/python/examples/sampleplugin.py @ 76ca5cb

Last change on this file since 76ca5cb was 76ca5cb, checked in by Nick Murdoch <nick@…>, at 2013-03-27T20:31:46Z

bpython.register_protocl() actually takes meaningful args and does something.

  • Property mode set to 100644
File size: 464 bytes
RevLine 
[e38c6d8]1"""sampleplugin.py - sample plugin for bitlbee-python.
2
3Place this file in bitlbee's plugin directory. bitlbee-python
4will pick it up as long as it has a .py extension.
5"""
6
7import sys
[93302ef]8import bpython
[76ca5cb]9print ("hello, I'm a test plugin running on Python {}.{}.{}".format(
10    sys.version_info.major, sys.version_info.minor, sys.version_info.micro))
[e38c6d8]11
[76ca5cb]12class MyProtocol(bpython.Protocol):
13    pass
[26f3b5f]14
15myproto = MyProtocol()
16
[76ca5cb]17bpython.register_protocol('myproto', myproto)
18
Note: See TracBrowser for help on using the repository browser.