MaaFw 2.3.0a3__py3-none-manylinux2014_aarch64.whl → 2.3.0b2__py3-none-manylinux2014_aarch64.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 MaaFw might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MaaFw
3
- Version: 2.3.0a3
3
+ Version: 2.3.0b2
4
4
  Summary: An automation black-box testing framework based on image recognition
5
5
  Author: MaaXYZ
6
6
  Project-URL: Homepage, https://github.com/MaaXYZ/MaaFramework
@@ -0,0 +1,27 @@
1
+ maa/__init__.py,sha256=JkhLdjqr1X69SYY2O3qoPhdYImQC_91XS5_eY1vbtEo,230
2
+ maa/buffer.py,sha256=JLxAF8esnAN4SlkZf2OMMlpv0SV3WK7OyMF8w7sTaC8,16617
3
+ maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
4
+ maa/controller.py,sha256=61R4asxDLChiZBSD1hEdGdbpoyOxHttOeflNuJ7DmqM,22381
5
+ maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
6
+ maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
7
+ maa/define.py,sha256=uvqM04p6NLfju1Zz-EMR-8Af8MZGpEImMAt3QdcYvIA,13114
8
+ maa/job.py,sha256=jXGQ4YV_G8sAi-B7OmUrbPCEIf4xZjWqCSr36LT6Qt0,1153
9
+ maa/library.py,sha256=AwdFx_zWHEah81NwOmD-SDzysSuVbsreDLIaxpWsXvY,1267
10
+ maa/notification_handler.py,sha256=KjQlu66fNVwGGli8kuhNdSZPj2vO_oXjaNt_B1i_5wA,5251
11
+ maa/resource.py,sha256=TAULVwajpPThbLreB0JbhMWTv82r8Y3fFLM2b2VC91Y,9349
12
+ maa/tasker.py,sha256=tYD-YvqRPwMzt-h8UToJ01CsN4mO2mJHEnjsj5tTkSU,14425
13
+ maa/toolkit.py,sha256=BE_o8XgznuW1d_7YairYHOrqOp5Ha9GYMcinsYYBgVM,11163
14
+ maa/bin/MaaNode.node,sha256=8pfDLlhvVBO3emVZl_9ZtIFTIoPohih72jd0ucmemHg,1049008
15
+ maa/bin/libMaaAdbControlUnit.so,sha256=pZdvtZkHGX6QUJsfgkt2tqwCZxUR58BmxX95BeKKeRg,1371720
16
+ maa/bin/libMaaDbgControlUnit.so,sha256=Y5xV3b1LQrYpF4rGhgh9YLfoeifZmVRgMkNDv7cBtT0,527664
17
+ maa/bin/libMaaFramework.so,sha256=qgSaAmtKi6NOp8yQ7QTXKQYDwEzOy1vVWeASD8cBl6g,3129240
18
+ maa/bin/libMaaToolkit.so,sha256=oEQNEFS5jFcZXSESQnMGCiTWqm_yxGRP2MVZka0HGUk,1082536
19
+ maa/bin/libMaaUtils.so,sha256=5RbsoV28t7sYHEV6_RkDMngd3UHFyoke2Oxu2-gqcS4,918360
20
+ maa/bin/libfastdeploy_ppocr.so,sha256=onQlZ9_VSIifDFaeLpRwqHEemalJJaCJCz0RkVyO-c0,5487856
21
+ maa/bin/libonnxruntime.so.1,sha256=RGCtVDSf6D2K8-eXTUckpRCSZQbHHrXlZTWUFVR8yDw,19227776
22
+ maa/bin/libopencv_world4.so.408,sha256=0T8LLfBerUbs-bPeVK4jRPGiMtDuflZ3T6nqQ5caBTM,15547272
23
+ MaaFw-2.3.0b2.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
24
+ MaaFw-2.3.0b2.dist-info/METADATA,sha256=e0CWwRoMQJi_d8T1WK0ULc2w8TjuxlqevWURCZ6cYk0,11041
25
+ MaaFw-2.3.0b2.dist-info/WHEEL,sha256=NKhwKPdlOAbZ859udgLkSMA9gaUh7CT-y1WwMhx29b8,107
26
+ MaaFw-2.3.0b2.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
27
+ MaaFw-2.3.0b2.dist-info/RECORD,,
maa/__init__.py CHANGED
@@ -1,10 +1,12 @@
1
1
  import os
2
+ from pathlib import Path
2
3
 
3
4
  from .library import Library
4
5
 
5
- __PATH = os.path.join(os.path.dirname(__file__), "bin")
6
+ env_path = os.environ.get("MAAFW_BINARY_PATH")
7
+ if env_path:
8
+ __PATH = Path(env_path)
9
+ else:
10
+ __PATH = Path(Path(__file__).parent, "bin")
6
11
 
7
- if os.path.exists(__PATH):
8
- ver = Library.open(__PATH)
9
- if ver:
10
- print(f"MaaFw version: {ver}")
12
+ Library.open(__PATH)
maa/bin/MaaNode.node CHANGED
Binary file
Binary file
Binary file
Binary file
maa/bin/libMaaToolkit.so CHANGED
Binary file
maa/bin/libMaaUtils.so CHANGED
Binary file
maa/buffer.py CHANGED
@@ -13,10 +13,6 @@ class StringBuffer:
13
13
  _own: bool
14
14
 
15
15
  def __init__(self, handle: Optional[MaaStringBufferHandle] = None):
16
- if not Library.initialized:
17
- raise RuntimeError(
18
- "Library not initialized, please call `library.open()` first."
19
- )
20
16
  self._set_api_properties()
21
17
 
22
18
  if handle:
@@ -97,10 +93,6 @@ class StringListBuffer:
97
93
  _own: bool
98
94
 
99
95
  def __init__(self, handle: Optional[MaaStringListBufferHandle] = None):
100
- if not Library.initialized:
101
- raise RuntimeError(
102
- "Library not initialized, please call `library.open()` first."
103
- )
104
96
  self._set_api_properties()
105
97
 
106
98
  if handle:
@@ -203,11 +195,6 @@ class ImageBuffer:
203
195
  _own: bool
204
196
 
205
197
  def __init__(self, c_handle: Optional[MaaImageBufferHandle] = None):
206
- if not Library.initialized:
207
- raise RuntimeError(
208
- "Library not initialized, please call `library.open()` first."
209
- )
210
-
211
198
  self._set_api_properties()
212
199
 
213
200
  if c_handle:
@@ -309,10 +296,6 @@ class ImageListBuffer:
309
296
  _own: bool
310
297
 
311
298
  def __init__(self, c_handle: Optional[MaaImageListBufferHandle] = None):
312
- if not Library.initialized:
313
- raise RuntimeError(
314
- "Library not initialized, please call `library.open()` first."
315
- )
316
299
  self._set_api_properties()
317
300
 
318
301
  if c_handle:
@@ -413,11 +396,6 @@ class RectBuffer:
413
396
  _own: bool
414
397
 
415
398
  def __init__(self, c_handle: Optional[MaaRectHandle] = None):
416
- if not Library.initialized:
417
- raise RuntimeError(
418
- "Library not initialized, please call `library.open()` first."
419
- )
420
-
421
399
  self._set_api_properties()
422
400
 
423
401
  if c_handle:
maa/controller.py CHANGED
@@ -28,11 +28,6 @@ class Controller:
28
28
  self,
29
29
  handle: Optional[MaaControllerHandle] = None,
30
30
  ):
31
- if not Library.initialized:
32
- raise RuntimeError(
33
- "Library not initialized, please call `library.open()` first."
34
- )
35
-
36
31
  self._set_api_properties()
37
32
 
38
33
  if handle:
@@ -152,7 +147,7 @@ class Controller:
152
147
  ctypes.sizeof(ctypes.c_int32),
153
148
  )
154
149
  )
155
-
150
+
156
151
  def set_screenshot_use_raw_size(self, enable: bool) -> bool:
157
152
  cbool = MaaBool(enable)
158
153
  return bool(
maa/library.py CHANGED
@@ -2,17 +2,17 @@ import ctypes
2
2
  import ctypes.util
3
3
  import pathlib
4
4
  import platform
5
- from typing import Optional, Union
6
5
 
7
6
  from .define import *
8
7
 
9
8
 
10
9
  class Library:
11
10
 
12
- initialized = False
13
-
14
11
  @staticmethod
15
- def open(path: Union[pathlib.Path, str]) -> Optional[str]:
12
+ def open(path: pathlib.Path):
13
+ if not path.exists():
14
+ raise FileNotFoundError(f"`{path}` does not exist.")
15
+
16
16
  platform_values = {
17
17
  "windows": ("MaaFramework.dll", "MaaToolkit.dll"),
18
18
  "darwin": ("libMaaFramework.dylib", "libMaaToolkit.dylib"),
@@ -26,40 +26,16 @@ class Library:
26
26
  else:
27
27
  lib_import = ctypes.CDLL
28
28
 
29
- try:
30
- Library.framework_libpath = (
31
- pathlib.Path(path) / platform_values[platform_type][0]
32
- )
33
- Library.framework = lib_import(str(Library.framework_libpath))
34
- except OSError:
35
- Library.framework_libpath = ctypes.util.find_library("MaaFramework")
36
- Library.framework = lib_import(str(Library.framework_libpath))
37
-
38
- try:
39
- Library.toolkit_libpath = (
40
- pathlib.Path(path) / platform_values[platform_type][1]
41
- )
42
- Library.toolkit = lib_import(str(Library.toolkit_libpath))
43
- except OSError:
44
- Library.toolkit_libpath = ctypes.util.find_library("MaaToolkit")
45
- Library.toolkit = lib_import(str(Library.toolkit_libpath))
29
+ Library.framework_libpath = path / platform_values[platform_type][0]
30
+ Library.framework = lib_import(str(Library.framework_libpath))
46
31
 
47
- if not Library.framework or not Library.toolkit:
48
- Library.initialized = False
49
- return None
32
+ Library.toolkit_libpath = path / platform_values[platform_type][1]
33
+ Library.toolkit = lib_import(str(Library.toolkit_libpath))
50
34
 
51
35
  Library._set_api_properties()
52
- Library.initialized = True
53
-
54
- return Library.version()
55
36
 
56
37
  @staticmethod
57
38
  def version() -> str:
58
- if not Library.initialized:
59
- raise RuntimeError(
60
- "Library not initialized, please call `library.open()` first."
61
- )
62
-
63
39
  return Library.framework.MaaVersion().decode()
64
40
 
65
41
  @staticmethod
maa/resource.py CHANGED
@@ -21,12 +21,6 @@ class Resource:
21
21
  notification_handler: Optional[NotificationHandler] = None,
22
22
  handle: Optional[MaaResourceHandle] = None,
23
23
  ):
24
-
25
- if not Library.initialized:
26
- raise RuntimeError(
27
- "Library not initialized, please call `library.open()` first."
28
- )
29
-
30
24
  self._set_api_properties()
31
25
 
32
26
  if handle:
maa/tasker.py CHANGED
@@ -1,6 +1,5 @@
1
1
  import ctypes
2
2
  import json
3
- import time
4
3
  from pathlib import Path
5
4
  from typing import Any, Dict, Optional, Union
6
5
 
@@ -25,11 +24,6 @@ class Tasker:
25
24
  notification_handler: Optional[NotificationHandler] = None,
26
25
  handle: Optional[MaaTaskerHandle] = None,
27
26
  ):
28
- if not Library.initialized:
29
- raise RuntimeError(
30
- "Library not initialized, please call `library.open()` first."
31
- )
32
-
33
27
  self._set_api_properties()
34
28
 
35
29
  if handle:
maa/toolkit.py CHANGED
@@ -189,11 +189,6 @@ class Toolkit:
189
189
  return
190
190
  Toolkit._api_properties_initialized = True
191
191
 
192
- if not Library.initialized:
193
- raise RuntimeError(
194
- "Library not initialized, please call `library.open()` first."
195
- )
196
-
197
192
  Library.toolkit.MaaToolkitConfigInitOption.restype = MaaBool
198
193
  Library.toolkit.MaaToolkitConfigInitOption.argtypes = [
199
194
  ctypes.c_char_p,
@@ -1,27 +0,0 @@
1
- maa/__init__.py,sha256=rBIC5X_VsfFXOMJRdKjgDyO428XHgeWAT3t6ZYmqO1M,207
2
- maa/buffer.py,sha256=E0tuasXPm6A_4r22PGSwObgGXb2qCMJrT5yrAvcgk6I,17424
3
- maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
4
- maa/controller.py,sha256=VOz4Und15toq6oehHR0BHC10LMhFVqKAcImQNXCqHxQ,22547
5
- maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
6
- maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
7
- maa/define.py,sha256=uvqM04p6NLfju1Zz-EMR-8Af8MZGpEImMAt3QdcYvIA,13114
8
- maa/job.py,sha256=jXGQ4YV_G8sAi-B7OmUrbPCEIf4xZjWqCSr36LT6Qt0,1153
9
- maa/library.py,sha256=nDTBUFC6_91gmyy8SfkTTccMZET9XGU8IxvuVUEwQ6E,2099
10
- maa/notification_handler.py,sha256=KjQlu66fNVwGGli8kuhNdSZPj2vO_oXjaNt_B1i_5wA,5251
11
- maa/resource.py,sha256=74mQvWr4ZYkE2Y3g7ranbai5XEYhQdUAP7SW_U8GrgI,9512
12
- maa/tasker.py,sha256=NZQOdJ9BKHQp4sfc0pKbXtF_m8ddnMPYng0KsGK9mbg,14599
13
- maa/toolkit.py,sha256=TlF8MoaGcWLklpISIlQNvc_rpTFBFrpDbLgctfQ_zqo,11325
14
- maa/bin/MaaNode.node,sha256=MNEa9-TtBLbuLTMaILzCeIqC5Q18X9XCVglaE-oXnHU,1049456
15
- maa/bin/libMaaAdbControlUnit.so,sha256=XecMx9ZL7ZyNSMPYnohDvLmutLA78hPQAsJGuRq_fTE,1371720
16
- maa/bin/libMaaDbgControlUnit.so,sha256=H7FSwe1p08jw7XYEhXc7wNvjd64SZ8__X42bX6PbEdA,527664
17
- maa/bin/libMaaFramework.so,sha256=sY_ukZV3v-AT6mGN_JO9t59WyhyN6vd5w39JaUdxfJs,3129240
18
- maa/bin/libMaaToolkit.so,sha256=mENup9Pj2TUgTYNTca1Tf812ndbkxKv0ohW3LbooC2o,1082536
19
- maa/bin/libMaaUtils.so,sha256=YmApsw64ZJr_SL_CjZy1kvEAieg3cyrnxh3uDvIz3bw,918360
20
- maa/bin/libfastdeploy_ppocr.so,sha256=onQlZ9_VSIifDFaeLpRwqHEemalJJaCJCz0RkVyO-c0,5487856
21
- maa/bin/libonnxruntime.so.1,sha256=RGCtVDSf6D2K8-eXTUckpRCSZQbHHrXlZTWUFVR8yDw,19227776
22
- maa/bin/libopencv_world4.so.408,sha256=0T8LLfBerUbs-bPeVK4jRPGiMtDuflZ3T6nqQ5caBTM,15547272
23
- MaaFw-2.3.0a3.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
24
- MaaFw-2.3.0a3.dist-info/METADATA,sha256=e1JhURwF5jYLc2T7QehlwHdR2ZJSwY1pyMfVv2CZLUU,11041
25
- MaaFw-2.3.0a3.dist-info/WHEEL,sha256=NKhwKPdlOAbZ859udgLkSMA9gaUh7CT-y1WwMhx29b8,107
26
- MaaFw-2.3.0a3.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
27
- MaaFw-2.3.0a3.dist-info/RECORD,,