Skip to content

Commit

Permalink
perf(Python): 完善 Win32Controller 类型注释; 调整 AlgorithmEnum 继承方式 (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
weinibuliu authored Feb 21, 2025
1 parent 84cf6e2 commit 13d57de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/binding/Python/maa/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class Win32Controller(Controller):

def __init__(
self,
hWnd: Optional[ctypes.c_void_p],
hWnd: Union[ctypes.c_void_p, int, None],
screencap_method: int = MaaWin32ScreencapMethodEnum.DXGI_DesktopDup,
input_method: int = MaaWin32InputMethodEnum.Seize,
notification_handler: Optional[NotificationHandler] = None,
Expand Down
5 changes: 3 additions & 2 deletions source/binding/Python/maa/define.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import ctypes
import platform
from dataclasses import dataclass
from enum import IntEnum, Enum
from enum import IntEnum
from typing import List, Tuple, Union, Dict, Optional

import numpy
from strenum import StrEnum # For Python 3.9/3.10

MaaBool = ctypes.c_uint8
MaaSize = ctypes.c_size_t
Expand Down Expand Up @@ -446,7 +447,7 @@ def roi(self):
]


class AlgorithmEnum(str, Enum):
class AlgorithmEnum(StrEnum):
DirectHit = "DirectHit"
TemplateMatch = "TemplateMatch"
FeatureMatch = "FeatureMatch"
Expand Down
1 change: 1 addition & 0 deletions source/binding/Python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy
strenum

0 comments on commit 13d57de

Please sign in to comment.