From 3c43ed9828902c5bf7d131742f10d507f64293cd Mon Sep 17 00:00:00 2001 From: aleherbau Date: Wed, 11 May 2011 13:49:52 +0000 Subject: TCF Python: Implemented LocatorService --- python/src/tcf/shell.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'python/src/tcf/shell.py') diff --git a/python/src/tcf/shell.py b/python/src/tcf/shell.py index 8d2b5ae28..dacd3d3fe 100644 --- a/python/src/tcf/shell.py +++ b/python/src/tcf/shell.py @@ -33,10 +33,16 @@ import tcf from tcf.util import sync, event from tcf import protocol, channel +class print_peers: + def __repr__(self): + peers = tcf.peers() + return '\n'.join(peers.keys()) + class Shell(code.InteractiveConsole, protocol.ChannelOpenListener, channel.ChannelListener): def __init__(self): locals = { - "connect" : tcf.connect + "connect" : tcf.connect, + "peers" : print_peers() } sys.ps1 = "tcf> " protocol.startEventQueue() -- cgit v1.2.3