python-audio-autotest-3.10 1.5.12rc1__py3-none-any.whl → 1.6rc0__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.
- pyaatlibs/__init__.py +3 -2
- pyaatlibs/aatapp.py +92 -26
- pyaatlibs/activitystatemachine.py +4 -1
- pyaatlibs/adbutils.py +63 -35
- pyaatlibs/apk/audioworker.apk +0 -0
- pyaatlibs/appinterface.py +57 -22
- pyaatlibs/argutils.py +2 -0
- pyaatlibs/audiofunction.py +59 -27
- pyaatlibs/audiosignalframelogger.py +10 -9
- pyaatlibs/audiothread.py +32 -25
- pyaatlibs/audioworker.py +211 -90
- pyaatlibs/logcatlistener.py +19 -8
- pyaatlibs/logger.py +21 -8
- pyaatlibs/signalanalyzer.py +3 -1
- pyaatlibs/signalmatcher.py +14 -9
- pyaatlibs/tests/audioworker_test.py +168 -162
- pyaatlibs/timeutils.py +14 -5
- pyaatlibs/trials.py +9 -3
- {python_audio_autotest_3_10-1.5.12rc1.dist-info → python_audio_autotest_3_10-1.6rc0.dist-info}/METADATA +1 -1
- python_audio_autotest_3_10-1.6rc0.dist-info/RECORD +25 -0
- python_audio_autotest_3_10-1.5.12rc1.dist-info/RECORD +0 -25
- {python_audio_autotest_3_10-1.5.12rc1.dist-info → python_audio_autotest_3_10-1.6rc0.dist-info}/WHEEL +0 -0
- {python_audio_autotest_3_10-1.5.12rc1.dist-info → python_audio_autotest_3_10-1.6rc0.dist-info}/licenses/LICENSE +0 -0
- {python_audio_autotest_3_10-1.5.12rc1.dist-info → python_audio_autotest_3_10-1.6rc0.dist-info}/top_level.txt +0 -0
pyaatlibs/timeutils.py
CHANGED
@@ -2,7 +2,9 @@ import datetime
|
|
2
2
|
import time
|
3
3
|
import threading
|
4
4
|
|
5
|
+
|
5
6
|
class Timer(threading.Thread):
|
7
|
+
|
6
8
|
def __init__(self, period_ms=1):
|
7
9
|
super(Timer, self).__init__()
|
8
10
|
self.timer = TicToc()
|
@@ -48,11 +50,12 @@ class Timer(threading.Thread):
|
|
48
50
|
running = self.running
|
49
51
|
|
50
52
|
if not running:
|
51
|
-
time.sleep(self.period_ms / 1000.)
|
53
|
+
time.sleep(self.period_ms / 1000.0)
|
52
54
|
continue
|
53
55
|
|
54
56
|
self._update()
|
55
|
-
time.sleep(self.period_ms / 1000.)
|
57
|
+
time.sleep(self.period_ms / 1000.0)
|
58
|
+
|
56
59
|
|
57
60
|
def TicTocGenerator():
|
58
61
|
tf = datetime.datetime.now()
|
@@ -61,7 +64,9 @@ def TicTocGenerator():
|
|
61
64
|
tf = datetime.datetime.now()
|
62
65
|
yield (tf - ti).total_seconds()
|
63
66
|
|
67
|
+
|
64
68
|
class TicToc(object):
|
69
|
+
|
65
70
|
def __init__(self):
|
66
71
|
self.tictoc = TicTocGenerator()
|
67
72
|
|
@@ -71,6 +76,7 @@ class TicToc(object):
|
|
71
76
|
def tic(self):
|
72
77
|
next(self.tictoc)
|
73
78
|
|
79
|
+
|
74
80
|
class TimeUtils(object):
|
75
81
|
TIME_STR_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
|
76
82
|
TIME_UNITS = ["d", "h", "m", "s"]
|
@@ -92,8 +98,11 @@ class TimeUtils(object):
|
|
92
98
|
if ms <= 0:
|
93
99
|
return "0s"
|
94
100
|
t = datetime.datetime.fromtimestamp(ms / 1000.0) - datetime.datetime.fromtimestamp(0)
|
95
|
-
t = [
|
96
|
-
|
101
|
+
t = [
|
102
|
+
str(int(s)) if s.isdigit() else str(float(s))
|
103
|
+
for s in str(t).replace(" days, ", ":").split(":")
|
104
|
+
if float(s) > 0
|
105
|
+
]
|
97
106
|
s = "{} ".join(t) + "{}"
|
98
|
-
s = s.format(*TimeUtils.TIME_UNITS[-len(t):])
|
107
|
+
s = s.format(*TimeUtils.TIME_UNITS[-len(t) :])
|
99
108
|
return s
|
pyaatlibs/trials.py
CHANGED
@@ -4,16 +4,21 @@ from pyaatlibs.timeutils import TimeUtils
|
|
4
4
|
|
5
5
|
try:
|
6
6
|
import functools
|
7
|
+
|
7
8
|
reduce = functools.reduce
|
8
9
|
except ImportError:
|
9
10
|
pass
|
10
11
|
|
12
|
+
|
11
13
|
class TrialHelper(object):
|
14
|
+
|
12
15
|
@staticmethod
|
13
16
|
def _check_type(trials):
|
14
17
|
if not isinstance(trials, list):
|
15
18
|
raise ValueError("The input must be an instance of list")
|
16
|
-
if len(trials) > 0 and not reduce(
|
19
|
+
if len(trials) > 0 and not reduce(
|
20
|
+
lambda x, y: x & y, map(lambda trial: isinstance(trial, Trial), trials)
|
21
|
+
):
|
17
22
|
raise ValueError("The input contains elements which are not instances of Trial")
|
18
23
|
|
19
24
|
@staticmethod
|
@@ -49,7 +54,7 @@ class TrialHelper(object):
|
|
49
54
|
@staticmethod
|
50
55
|
def to_json(trials):
|
51
56
|
TrialHelper._check_type(trials)
|
52
|
-
return json.dumps(
|
57
|
+
return json.dumps(list(map(lambda trial: trial.ds, trials)), indent=4, ensure_ascii=False)
|
53
58
|
|
54
59
|
@staticmethod
|
55
60
|
def pass_fail_list(trials, check_func=None):
|
@@ -60,12 +65,13 @@ class TrialHelper(object):
|
|
60
65
|
|
61
66
|
|
62
67
|
class Trial(object):
|
68
|
+
|
63
69
|
def __init__(self, taskname=None, pass_check=None):
|
64
70
|
self.ds = {
|
65
71
|
"task": taskname,
|
66
72
|
"timestamp": TimeUtils.now_str(),
|
67
73
|
"status": "valid",
|
68
|
-
"error-msg": None
|
74
|
+
"error-msg": None,
|
69
75
|
}
|
70
76
|
self.pass_check = pass_check
|
71
77
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
pyaatlibs/__init__.py,sha256=lIVZ_OBtN6fxBE0MXf2Cqy3-BdrebaksMzOs_fWxHoY,356
|
2
|
+
pyaatlibs/aatapp.py,sha256=VdytLjApP8BHMudhQOs_nhhC44RhPeDAzeNUy_3SK_k,9644
|
3
|
+
pyaatlibs/activitystatemachine.py,sha256=q2AEkToQmVVcvOGt4jGWq0ryWqSGYGUELSVCECAU5Pk,323
|
4
|
+
pyaatlibs/adbutils.py,sha256=M7N-4uxIzs6krWwb7GhPvld2gPZPGAKWsRMRpgvzXX0,16002
|
5
|
+
pyaatlibs/appinterface.py,sha256=KITmStXwRBNidskKfeixR9SChGn58Q5NOV8k6uE4JpQ,4894
|
6
|
+
pyaatlibs/argutils.py,sha256=CnAREKQeXIgHc4iQC6YSm5cLhRc3UaB5uhxYYYFq4NU,453
|
7
|
+
pyaatlibs/audiofunction.py,sha256=k9OovKKhmo0MLtfpK201mPoaRJk6WYOgK1yGcNWS_zs,9987
|
8
|
+
pyaatlibs/audiosignalframelogger.py,sha256=UYn-AqFAk4NqKGKkMmaWTRTc43R0Gqch2eEKQA0b4ng,1400
|
9
|
+
pyaatlibs/audiothread.py,sha256=tv18eHCiuLzekCjCzHZWjKFv5OzpQh647RSw8hlEvUU,6498
|
10
|
+
pyaatlibs/audioworker.py,sha256=jfsEMawKuhXpi93uwLhvNDXUmFOBxO-QHGKuIIRi6yI,30688
|
11
|
+
pyaatlibs/logcatlistener.py,sha256=NIIRaMW85A1NwoNUN92zWBsxA3Fd9ByeXNnNB2Jdonk,6296
|
12
|
+
pyaatlibs/logger.py,sha256=j5xkDbKxCSc99tCita_YDafHO9gR4cH_k5b0x6gi7yI,5305
|
13
|
+
pyaatlibs/signalanalyzer.py,sha256=yjgky6_HmHv_NfoTc7yWP2y5u9hiEU6zSj1raxSK3Ws,310
|
14
|
+
pyaatlibs/signalmatcher.py,sha256=Zj8Kq4Iz5UNDFp9s6xffHVg_Rk6QkOuTEzt-dZm6gIA,1911
|
15
|
+
pyaatlibs/timeutils.py,sha256=PifZ1kmmTmfJB9VyhMyGHVKjuys0asQqF16RSWcYHkA,2651
|
16
|
+
pyaatlibs/trials.py,sha256=sksmFIU-FT787ztfyT1Rl7HW_j6ltd4pV56pyV9gR3g,2492
|
17
|
+
pyaatlibs/apk/audiofunctionsdemo.apk,sha256=GG06POXrPOphMNsm5pD4XPfzVF8FXQ1ruupJFO2V8iQ,3205247
|
18
|
+
pyaatlibs/apk/audioworker.apk,sha256=KWy4aTS70pOyv8GLPih4uGKplaeiAAuMo_gq02eIewE,28902988
|
19
|
+
pyaatlibs/tests/audioworker_test.py,sha256=Gvadajd1jW8Ob2zZ1kRFQf3WRe4WBeBKjc6e3EoQEHM,20865
|
20
|
+
pyaatlibs/tests/conftest.py,sha256=Ng_ClpNsY-62bo8O0zCl702jy9AcwdteakJ1vhlOCTk,293
|
21
|
+
python_audio_autotest_3_10-1.6rc0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
22
|
+
python_audio_autotest_3_10-1.6rc0.dist-info/METADATA,sha256=7kbCAD431GvOQptcNL31XQgi2a8VXT6yuMd3D9j6pjE,5239
|
23
|
+
python_audio_autotest_3_10-1.6rc0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
24
|
+
python_audio_autotest_3_10-1.6rc0.dist-info/top_level.txt,sha256=MyCr1MMMQB2sjxyhlZSJPG4Fx10ya00APmhY7r1fSoQ,10
|
25
|
+
python_audio_autotest_3_10-1.6rc0.dist-info/RECORD,,
|
@@ -1,25 +0,0 @@
|
|
1
|
-
pyaatlibs/__init__.py,sha256=FPtuBgCCcl-Rzj_szOsLhwv97jIF_dJxeLxuP0NG3QY,355
|
2
|
-
pyaatlibs/aatapp.py,sha256=2oTnHnTCd4oIk_Nb218S3rO6nQfujxfVOLbQM1jeAhA,8742
|
3
|
-
pyaatlibs/activitystatemachine.py,sha256=We5noxBtskgMUsdBOA34e8Rze8K-vuheuSBjL4RUo8Q,300
|
4
|
-
pyaatlibs/adbutils.py,sha256=pQ0mQep_JN9NthSn5LWEd8G36ng6tpSKQSBGst52DQY,15741
|
5
|
-
pyaatlibs/appinterface.py,sha256=cFy2agwnkSlO4iao9OxhImtx0M63OcoabnClHP2AQlc,4437
|
6
|
-
pyaatlibs/argutils.py,sha256=6jOccgQlftmhUEGc3dAZ9-j0Mdg45jrhAGE-CylYjno,451
|
7
|
-
pyaatlibs/audiofunction.py,sha256=7Lm_-dG88mK8ETRmu--vIyzXMPVPFiUbdwJmB4PQn9g,9640
|
8
|
-
pyaatlibs/audiosignalframelogger.py,sha256=K0byfkpPAoMNNl6YdyoSGSgWbYPK1m0cLpQIPkeQlto,1446
|
9
|
-
pyaatlibs/audiothread.py,sha256=GOEHPFtEK-P8SQNdgWeDxnHcs_vic2kTN68UCjWUiLM,6548
|
10
|
-
pyaatlibs/audioworker.py,sha256=GwkdvSbpZfCr7IQ1AUCSxEggS_r3YY8Ih9Y3g7jFP1Y,28588
|
11
|
-
pyaatlibs/logcatlistener.py,sha256=0Dz5wM1qOsxn-KcHspD2nCJnVu5g7rzbk5ycEDvxG08,6213
|
12
|
-
pyaatlibs/logger.py,sha256=13Kx86hzFTbynWG5hKrWiCsT8gYk0-6ER98aOLiMJfY,5224
|
13
|
-
pyaatlibs/signalanalyzer.py,sha256=F1TiLAqqSHLpm4KgslRgu7hjj4iRX1qyCZMDI21oxls,306
|
14
|
-
pyaatlibs/signalmatcher.py,sha256=6A4mLf6GLbQzdM0wFbHqDfyWvgpZRci90kaOrLeV8B0,1832
|
15
|
-
pyaatlibs/timeutils.py,sha256=yEgZGcHf_ASyXr0Mcef0toEa4zXX4j3FyQayaF1sN8I,2613
|
16
|
-
pyaatlibs/trials.py,sha256=hSYIvR1vsEqfu20eLDeh3oDCCTWvHQcvS6LKfScLB30,2469
|
17
|
-
pyaatlibs/apk/audiofunctionsdemo.apk,sha256=GG06POXrPOphMNsm5pD4XPfzVF8FXQ1ruupJFO2V8iQ,3205247
|
18
|
-
pyaatlibs/apk/audioworker.apk,sha256=crAALQtroYk-AKvGn_W8EDlZUCgNRZdhdYfWWI40l5Q,28921400
|
19
|
-
pyaatlibs/tests/audioworker_test.py,sha256=oKwi7TGh3apYG1SJlTYWTbCazJZya7wOCtYiytQvea8,20977
|
20
|
-
pyaatlibs/tests/conftest.py,sha256=Ng_ClpNsY-62bo8O0zCl702jy9AcwdteakJ1vhlOCTk,293
|
21
|
-
python_audio_autotest_3_10-1.5.12rc1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
22
|
-
python_audio_autotest_3_10-1.5.12rc1.dist-info/METADATA,sha256=NmHkkOyaJMCslnoDyZ5HKcDygYeNx16PUwXsaFw0e2E,5242
|
23
|
-
python_audio_autotest_3_10-1.5.12rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
24
|
-
python_audio_autotest_3_10-1.5.12rc1.dist-info/top_level.txt,sha256=MyCr1MMMQB2sjxyhlZSJPG4Fx10ya00APmhY7r1fSoQ,10
|
25
|
-
python_audio_autotest_3_10-1.5.12rc1.dist-info/RECORD,,
|
{python_audio_autotest_3_10-1.5.12rc1.dist-info → python_audio_autotest_3_10-1.6rc0.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|