Author: gwadavel
Date: 2009-09-15 16:13:54 +0200 (Tue, 15 Sep 2009)
New Revision: 5401
Modified:
software_suite_v3/software/plugin/plugin-battery/trunk/executables/plugin-battery.py
software_suite_v3/software/plugin/plugin-charger/trunk/executables/plugin-charger.py
Log:
test connexion with tux.server.connect()
Modified:
software_suite_v3/software/plugin/plugin-battery/trunk/executables/plugin-battery.py
===================================================================
---
software_suite_v3/software/plugin/plugin-battery/trunk/executables/plugin-battery.py
2009-09-15 13:55:58 UTC (rev 5400)
+++
software_suite_v3/software/plugin/plugin-battery/trunk/executables/plugin-battery.py
2009-09-15 14:13:54 UTC (rev 5401)
@@ -61,15 +61,16 @@
if "tgp_ip" in os.environ:
self.tgp_ip = os.environ["tgp_ip"]
- if os.name != "nt":
- if os.geteuid() != 0:
- self.tgp_port = 54321
-
if "tgp_port" in os.environ:
self.tgp_port = int(os.environ["tgp_port"])
self.tux = TuxAPI(self.tgp_ip, self.tgp_port)
-
+
+ if self.tux.server.connect(CLIENT_LEVEL_RESTRICTED, 'batterylevel',
'plugin-battery'):
+ self.tux.server.disconnect()
+ else:
+ self.tgp_port = 54321
+ self.tux = TuxAPI(self.tgp_ip, self.tgp_port)
def tuxConnect(self):
'''
Modified:
software_suite_v3/software/plugin/plugin-charger/trunk/executables/plugin-charger.py
===================================================================
---
software_suite_v3/software/plugin/plugin-charger/trunk/executables/plugin-charger.py
2009-09-15 13:55:58 UTC (rev 5400)
+++
software_suite_v3/software/plugin/plugin-charger/trunk/executables/plugin-charger.py
2009-09-15 14:13:54 UTC (rev 5401)
@@ -29,7 +29,6 @@
import os
import sys
-
import locale
import gettext
@@ -61,16 +60,17 @@
if "tgp_ip" in os.environ:
self.tgp_ip = os.environ["tgp_ip"]
- if os.name != "nt":
- if os.geteuid() != 0:
- self.tgp_port = 54321
-
if "tgp_port" in os.environ:
self.tgp_port = int(os.environ["tgp_port"])
self.tux = TuxAPI(self.tgp_ip, self.tgp_port)
+ if self.tux.server.connect(CLIENT_LEVEL_RESTRICTED, 'chargerstate',
'plugin-charger'):
+ self.tux.server.disconnect()
+ else:
+ self.tgp_port = 54321
+ self.tux = TuxAPI(self.tgp_ip, self.tgp_port)
+
-
def tuxConnect(self):
'''
Wait connected
------------------------------------------------------------------------------
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