Author: ks156
Date: 2009-09-14 12:24:25 +0200 (Mon, 14 Sep 2009)
New Revision: 5371
Modified:
software_suite_v3/smart-core/smart-api/python/branches/user_mode/tuxisalive/api/sh.py
Log:
* Changed the way to connect the API to automatically determine which port
must be used.
Modified:
software_suite_v3/smart-core/smart-api/python/branches/user_mode/tuxisalive/api/sh.py
===================================================================
---
software_suite_v3/smart-core/smart-api/python/branches/user_mode/tuxisalive/api/sh.py
2009-09-14 10:22:24 UTC (rev 5370)
+++
software_suite_v3/smart-core/smart-api/python/branches/user_mode/tuxisalive/api/sh.py
2009-09-14 10:24:25 UTC (rev 5371)
@@ -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,13 @@
global tux
+# Try to connect to the port 270
tux = TuxAPI("127.0.0.1", 270)
+time.sleep(1)
+# If the API is not connected to the port 270, then try the port 54321 (user
+# mode)
+if not tux.server.getConnected():
+ tux = TuxAPI("127.0.0.1", 54321)
verString = tux.getVersion()
verH = "".join("=" * len(verString))
------------------------------------------------------------------------------
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