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()
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to