source: protocols/python/examples/sampleplugin.py @ 1dcfd1f

Last change on this file since 1dcfd1f was 1dcfd1f, checked in by Nick Murdoch <nick@…>, at 2013-03-19T20:30:24Z

Protocol class now has a name attribute and can be subclassed.

  • Property mode set to 100644
File size: 546 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
[e38c6d8]9print "hello, I'm a test plugin running on Python", sys.version_info
10
[1dcfd1f]11print bpython.Protocol
12print bpython.Protocol()
[93302ef]13print bpython.register_protocol
14
[26f3b5f]15try:
[1dcfd1f]16    class MyProtocol(bpython.Protocol):
[26f3b5f]17        pass
18except Exception, e:
19    print "error:", e
20
21myproto = MyProtocol()
22print "myproto: ", myproto
23
[93302ef]24bpython.register_protocol('echo "hello"')
Note: See TracBrowser for help on using the repository browser.