Author: ks156
Date: 2009-09-17 08:48:08 +0200 (Thu, 17 Sep 2009)
New Revision: 5420

Modified:
   
software_suite_v3/software/plugin/plugin-maxlight/trunk/executables/plugin-maxlight.py
Log:
* Fixed the plugin to switch from port 270 to 54321 if needed.
  The previous version has problems when it was started as normal user.


Modified: 
software_suite_v3/software/plugin/plugin-maxlight/trunk/executables/plugin-maxlight.py
===================================================================
--- 
software_suite_v3/software/plugin/plugin-maxlight/trunk/executables/plugin-maxlight.py
      2009-09-17 06:36:36 UTC (rev 5419)
+++ 
software_suite_v3/software/plugin/plugin-maxlight/trunk/executables/plugin-maxlight.py
      2009-09-17 06:48:08 UTC (rev 5420)
@@ -34,26 +34,26 @@
     tgp_language = "en"
     tgp_ip = "127.0.0.1"
     tgp_port = 270
-    tux = TuxAPI("127.0.0.1", 270)
     
     def __init__(self, plug):
         '''
         '''
         self.plugin = plug 
+        
+        self.tux = TuxAPI("127.0.0.1", 270)
+
+        if not self.tux.server.connect(CLIENT_LEVEL_RESTRICTED, 'TuxMaxLight', 
'plugin-maxlight'):
+        #    self.tux.server.disconnect()
+        #else:
+            self.tgp_port = 54321
+            self.tux = TuxAPI(self.tgp_ip, self.tgp_port)     
     
         
-        
     def tuxConnect(self):
         '''
         Wait connected
         '''
-
         self.tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 'TuxMaxLight', 
'plugin-maxlight')
-        if os.name != 'nt':
-            sleep(0.5)
-            if not self.tux.server.getConnected():
-                self.tux = TuxAPI("127.0.0.1", 54321)
-                self.tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 
'TuxMaxLight', 'plugin-maxlight')
 
         self.tux.server.waitConnected(5.0)
         self.tux.dongle.waitConnected(5.0)


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to