[tuxdroid-svn] r5401 - in software_suite_v3/software/plugin: plugin-battery/trunk/executables plugi
Status: Beta
Brought to you by:
ks156
|
From: gwadavel <c2m...@c2...> - 2009-09-15 14:14:10
|
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
|