[tuxdroid-svn] r5901 - software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api
Status: Beta
Brought to you by:
ks156
From: ks156 <c2m...@c2...> - 2009-11-18 10:26:08
|
Author: ks156 Date: 2009-11-18 11:25:57 +0100 (Wed, 18 Nov 2009) New Revision: 5901 Modified: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/sh.py Log: * Merged user_mode branch from rev 5370. This branch is now done and discontinued. Modified: software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/sh.py =================================================================== --- software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/sh.py 2009-11-18 10:25:08 UTC (rev 5900) +++ software_suite_v3/smart-core/smart-api/python/trunk/tuxisalive/api/sh.py 2009-11-18 10:25:57 UTC (rev 5901) @@ -7,6 +7,7 @@ "Free" client mode. """ import os +import time if os.name == 'nt': from version import author, date, version, licence else: @@ -35,7 +36,15 @@ global tux +# Try to connect to the port 270 tux = TuxAPI("127.0.0.1", 270) +time.sleep(0.5) +# If the API is not connected to the port 270, then try the port 54321 (user +# mode) +if tux.server.connect(CLIENT_LEVEL_FREE, "TuxShell", "NoPasswd"): + tux.server.disconnect() +else: + tux = TuxAPI("127.0.0.1", 54321) verString = tux.getVersion() verH = "".join("=" * len(verString)) @@ -43,11 +52,6 @@ print verString print verH -if os.name != 'nt': - if not 'readline' in sys.modules: - print "For interctive use, run: python -i sh.py" - sys.exit(0) - tux.server.autoConnect(CLIENT_LEVEL_FREE, "TuxShell", "NoPasswd") tux.tts.isConsole() |