add callback to example script
authorThomasV <thomasv@gitorious>
Sun, 28 Oct 2012 07:14:00 +0000 (08:14 +0100)
committerThomasV <thomasv@gitorious>
Sun, 28 Oct 2012 07:14:00 +0000 (08:14 +0100)
scripts/blocks

index 16aa5e7..0f21a45 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/env python
 
-import electrum
+import sys, electrum
 
 i = electrum.Interface()
+i.register_callback('connected', lambda: sys.stderr.write("Connected to %s\n" % i.connection_msg))
 i.start()
 i.send([('blockchain.numblocks.subscribe',[])])