Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleherbau2011-05-31 09:20:47 -0400
committeraleherbau2011-05-31 09:20:47 -0400
commit6c66f7e4848a076f553c81bdb64dd85610af2d79 (patch)
tree23a07788884e728dbc5b7ad3e6eaef417a0837e4 /python/src/tcf/shell.py
parent0e77355b3f6d073cbf77d596308a5a679e7c6f13 (diff)
downloadorg.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.gz
org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.tar.xz
org.eclipse.tcf-6c66f7e4848a076f553c81bdb64dd85610af2d79.zip
TCF Python: Start discovery on demand only
Diffstat (limited to 'python/src/tcf/shell.py')
-rw-r--r--python/src/tcf/shell.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/src/tcf/shell.py b/python/src/tcf/shell.py
index aa3958603..8042abcd2 100644
--- a/python/src/tcf/shell.py
+++ b/python/src/tcf/shell.py
@@ -48,15 +48,25 @@ class Shell(code.InteractiveConsole, protocol.ChannelOpenListener, channel.Chann
"connect" : tcf.connect,
"peers" : print_peers()
}
- sys.ps1 = "tcf> "
protocol.startEventQueue()
+ protocol.startDiscovery()
protocol.invokeAndWait(protocol.addChannelOpenListener, self)
code.InteractiveConsole.__init__(self, locals)
def interact(self, banner=None):
try:
+ try:
+ ps1 = sys.ps1 #@UndefinedVariable
+ except AttributeError:
+ ps1 = None
+ sys.ps1 = "tcf> "
super(Shell, self).interact(banner)
finally:
+ if ps1:
+ sys.ps1 = ps1
+ else:
+ del sys.ps1
protocol.invokeLater(protocol.removeChannelOpenListener, self)
+ protocol.shutdownDiscovery()
protocol.getEventQueue().shutdown()
def onChannelOpen(self, channel):
wrapper = sync.DispatchWrapper(channel)

Back to the top