Kea2-python 0.0.1b2__py3-none-any.whl → 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Kea2-python might be problematic. Click here for more details.
- kea2/__init__.py +1 -4
- kea2/adbUtils.py +0 -1
- kea2/assets/fastbot_configs/widget.block.py +27 -7
- kea2/assets/fastbot_libs/arm64-v8a/libfastbot_native.so +0 -0
- kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so +0 -0
- kea2/assets/monkeyq.jar +0 -0
- kea2/bug_report_generator.py +477 -0
- kea2/fastbotManager.py +144 -0
- kea2/keaUtils.py +188 -169
- kea2/kea_launcher.py +16 -4
- kea2/logWatcher.py +15 -11
- kea2/resultSyncer.py +56 -0
- kea2/templates/bug_report_template.html +937 -0
- kea2/u2Driver.py +90 -0
- kea2/utils.py +8 -1
- kea2_python-0.1.0.dist-info/METADATA +254 -0
- kea2_python-0.1.0.dist-info/RECORD +35 -0
- kea2/assets/u2.jar +0 -0
- kea2_python-0.0.1b2.dist-info/METADATA +0 -464
- kea2_python-0.0.1b2.dist-info/RECORD +0 -32
- {kea2_python-0.0.1b2.dist-info → kea2_python-0.1.0.dist-info}/WHEEL +0 -0
- {kea2_python-0.0.1b2.dist-info → kea2_python-0.1.0.dist-info}/entry_points.txt +0 -0
- {kea2_python-0.0.1b2.dist-info → kea2_python-0.1.0.dist-info}/licenses/LICENSE +0 -0
- {kea2_python-0.0.1b2.dist-info → kea2_python-0.1.0.dist-info}/top_level.txt +0 -0
kea2/resultSyncer.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import threading
|
|
2
|
+
from .adbUtils import adb_shell, pull_file
|
|
3
|
+
from .utils import getLogger
|
|
4
|
+
|
|
5
|
+
logger = getLogger(__name__)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResultSyncer:
|
|
9
|
+
|
|
10
|
+
def __init__(self, device_output_dir, output_dir):
|
|
11
|
+
self.device_output_dir = device_output_dir
|
|
12
|
+
self.output_dir = output_dir
|
|
13
|
+
self.running = False
|
|
14
|
+
self.thread = None
|
|
15
|
+
self.sync_event = threading.Event()
|
|
16
|
+
|
|
17
|
+
def run(self):
|
|
18
|
+
"""Start a background thread to sync device data when triggered"""
|
|
19
|
+
self.running = True
|
|
20
|
+
self.thread = threading.Thread(target=self._sync_thread, daemon=True)
|
|
21
|
+
self.thread.start()
|
|
22
|
+
|
|
23
|
+
def _sync_thread(self):
|
|
24
|
+
"""Thread function that waits for sync event and then syncs data"""
|
|
25
|
+
while self.running:
|
|
26
|
+
# Wait for sync event with a timeout to periodically check if still running
|
|
27
|
+
if self.sync_event.wait(timeout=3):
|
|
28
|
+
self._sync_device_data()
|
|
29
|
+
self.sync_event.clear()
|
|
30
|
+
|
|
31
|
+
def close(self):
|
|
32
|
+
self.running = False
|
|
33
|
+
self.sync_event.set()
|
|
34
|
+
if self.thread and self.thread.is_alive():
|
|
35
|
+
self.thread.join(timeout=10)
|
|
36
|
+
self._sync_device_data()
|
|
37
|
+
try:
|
|
38
|
+
logger.debug(f"Removing device output directory: {self.device_output_dir}")
|
|
39
|
+
remove_device_dir = ["rm", "-rf", self.device_output_dir]
|
|
40
|
+
adb_shell(remove_device_dir)
|
|
41
|
+
except Exception as e:
|
|
42
|
+
logger.error(f"Error removing device output directory: {e}", flush=True)
|
|
43
|
+
|
|
44
|
+
def _sync_device_data(self):
|
|
45
|
+
"""
|
|
46
|
+
Sync the device data to the local directory.
|
|
47
|
+
"""
|
|
48
|
+
try:
|
|
49
|
+
logger.debug("Syncing data")
|
|
50
|
+
|
|
51
|
+
pull_file(self.device_output_dir, str(self.output_dir))
|
|
52
|
+
|
|
53
|
+
remove_pulled_screenshots = ["find", self.device_output_dir, "-name", "\"*.png\"", "-delete"]
|
|
54
|
+
adb_shell(remove_pulled_screenshots)
|
|
55
|
+
except Exception as e:
|
|
56
|
+
logger.error(f"Error in data sync: {e}", flush=True)
|