Ignore:
Timestamp:
2013-03-27T20:31:46Z (11 years ago)
Author:
Nick Murdoch <nick@…>
Parents:
1dcfd1f
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/python/examples/sampleplugin.py

    r1dcfd1f r76ca5cb  
    77import sys
    88import bpython
    9 print "hello, I'm a test plugin running on Python", sys.version_info
     9print ("hello, I'm a test plugin running on Python {}.{}.{}".format(
     10    sys.version_info.major, sys.version_info.minor, sys.version_info.micro))
    1011
    11 print bpython.Protocol
    12 print bpython.Protocol()
    13 print bpython.register_protocol
    14 
    15 try:
    16     class MyProtocol(bpython.Protocol):
    17         pass
    18 except Exception, e:
    19     print "error:", e
     12class MyProtocol(bpython.Protocol):
     13    pass
    2014
    2115myproto = MyProtocol()
    22 print "myproto: ", myproto
    2316
    24 bpython.register_protocol('echo "hello"')
     17bpython.register_protocol('myproto', myproto)
     18
Note: See TracChangeset for help on using the changeset viewer.