ok-script 0.0.7__tar.gz → 0.0.8__tar.gz
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.
- {ok-script-0.0.7 → ok-script-0.0.8}/PKG-INFO +1 -1
- ok-script-0.0.7/autohelper/AutoHelper.py → ok-script-0.0.8/ok/OK.py +14 -14
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/HwndWindow.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/ADBCaptureMethod.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/DeviceManager.py +9 -9
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/vbox.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/WindowsGraphicsCaptureMethod.py +11 -11
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/d3d11.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/config/Config.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/config/InfoDict.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/feature/FeatureSet.py +4 -4
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/feature/FindFeature.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/App.py +10 -10
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/MainWindow.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/__init__.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/DebugTab.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/FrameWidget.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/InfoWidget.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/LoggerWidget.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/loading/LoadingWindow.py +10 -10
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/overlay/OverlayWindow.py +4 -4
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/ConfigItemFactory.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/StartButton.py +6 -6
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/TaskOpButton.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/TaskTab.py +9 -9
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/util/Alert.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/util/InitWorker.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/ListTableWidgetItem.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/NumericTableWidgetItem.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/YesNonWidgetItem.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/interaction/ADBInteraction.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/interaction/BaseInteraction.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/interaction/Win32Interaction.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/logging/Logger.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/ocr/OCR.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Foundation/Collections.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Foundation/__init__.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Globalization/__init__.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Graphics/Capture/__init__.py +7 -7
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +4 -4
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Graphics/DirectX/__init__.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Graphics/Imaging/__init__.py +5 -5
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Media/Ocr/__init__.py +7 -7
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Security/Cryptography/__init__.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Storage/Streams/__init__.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/BlackBarProcessor.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/SaveByInterval.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/SaveByKeyPress.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/SaveMethodBase.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/scene/FeatureScene.py +2 -2
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/scene/Scene.py +3 -3
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/task/BaseTask.py +5 -5
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/task/ExecutorOperation.py +3 -3
- ok-script-0.0.8/ok/task/FindFeatureTask.py +6 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/task/TaskExecutor.py +5 -5
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/json.py +1 -1
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/yaml.py +1 -1
- {ok-script-0.0.7 → ok-script-0.0.8}/ok_script.egg-info/PKG-INFO +1 -1
- ok-script-0.0.8/ok_script.egg-info/SOURCES.txt +125 -0
- ok-script-0.0.8/ok_script.egg-info/top_level.txt +1 -0
- {ok-script-0.0.7 → ok-script-0.0.8}/setup.py +1 -1
- ok-script-0.0.7/autohelper/task/FindFeatureTask.py +0 -6
- ok-script-0.0.7/ok_script.egg-info/SOURCES.txt +0 -125
- ok-script-0.0.7/ok_script.egg-info/top_level.txt +0 -1
- {ok-script-0.0.7 → ok-script-0.0.8}/README.md +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/adb/targets.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/utils.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/window.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/color/Color.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/color/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/config/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/feature/Box.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/feature/Feature.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/feature/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/Communicate.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/TabTitles.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/debug/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/i18n/path.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/icon/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/icon/icon.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/loading/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/resources.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/util/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/RoundCornerContainer.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/gui/widget/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/interaction/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/logging/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/ocr/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/predict/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/predict/predict.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/delegate.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/export.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/idldsl.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/inspectable.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/roapi.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/types.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/rotypes/winstring.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/PostProcessor.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/save/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/scene/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/stats/StreamStats.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/stats/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/task/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/__init__.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/list.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/path.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/thread.py +0 -0
- {ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/util/win32_process.py +0 -0
- {ok-script-0.0.7 → ok-script-0.0.8}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.7 → ok-script-0.0.8}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.7 → ok-script-0.0.8}/setup.cfg +0 -0
|
@@ -5,19 +5,19 @@ from typing import Dict, Any
|
|
|
5
5
|
|
|
6
6
|
from PySide6.QtWidgets import QApplication
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
8
|
+
import ok
|
|
9
|
+
from ok.feature.FeatureSet import FeatureSet
|
|
10
|
+
from ok.gui.App import App
|
|
11
|
+
from ok.gui.Communicate import communicate
|
|
12
|
+
from ok.gui.overlay.OverlayWindow import OverlayWindow
|
|
13
|
+
from ok.gui.util.InitWorker import InitWorker
|
|
14
|
+
from ok.logging.Logger import get_logger, config_logger
|
|
15
|
+
from ok.task.TaskExecutor import TaskExecutor
|
|
16
16
|
|
|
17
17
|
logger = get_logger(__name__)
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class OK:
|
|
21
21
|
executor: TaskExecutor
|
|
22
22
|
adb = None
|
|
23
23
|
adb_device = None
|
|
@@ -37,7 +37,7 @@ class AutoHelper:
|
|
|
37
37
|
if config.get("use_gui"):
|
|
38
38
|
self.app = App(self.config.get('gui_icon'), self.debug, self.config.get('gui_title'),
|
|
39
39
|
self.config['tasks'], self.exit_event)
|
|
40
|
-
|
|
40
|
+
ok.gui.app = self.app
|
|
41
41
|
self.app.show_loading()
|
|
42
42
|
self.worker = InitWorker(self.do_init)
|
|
43
43
|
self.worker.start()
|
|
@@ -49,7 +49,7 @@ class AutoHelper:
|
|
|
49
49
|
self.task_executor.start()
|
|
50
50
|
if config.get("debug"):
|
|
51
51
|
self.app = QApplication(sys.argv)
|
|
52
|
-
self.overlay_window = OverlayWindow(
|
|
52
|
+
self.overlay_window = OverlayWindow(ok.gui.device_manager.hwnd)
|
|
53
53
|
self.app.exec()
|
|
54
54
|
else:
|
|
55
55
|
try:
|
|
@@ -101,7 +101,7 @@ class AutoHelper:
|
|
|
101
101
|
self.init_message("TaskExecutor init Done")
|
|
102
102
|
|
|
103
103
|
if self.app:
|
|
104
|
-
|
|
104
|
+
ok.gui.executor = self.task_executor
|
|
105
105
|
|
|
106
106
|
def wait_task(self):
|
|
107
107
|
while not self.exit_event.is_set():
|
|
@@ -109,8 +109,8 @@ class AutoHelper:
|
|
|
109
109
|
|
|
110
110
|
def init_device_manager(self):
|
|
111
111
|
if self.device_manager is None:
|
|
112
|
-
from
|
|
112
|
+
from ok.capture.adb.DeviceManager import DeviceManager
|
|
113
113
|
self.device_manager = DeviceManager(self.config.get("config_folder") or "config",
|
|
114
114
|
self.config.get('capture_window_title'), self.config.get("debug"),
|
|
115
115
|
self.exit_event)
|
|
116
|
-
|
|
116
|
+
ok.gui.device_manager = self.device_manager
|
|
@@ -5,9 +5,9 @@ import threading
|
|
|
5
5
|
from typing_extensions import override
|
|
6
6
|
from win32 import win32gui
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
8
|
+
from ok.capture.windows.window import is_foreground_window, get_window_bounds
|
|
9
|
+
from ok.gui.Communicate import communicate
|
|
10
|
+
from ok.logging.Logger import get_logger
|
|
11
11
|
|
|
12
12
|
logger = get_logger(__name__)
|
|
13
13
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import numpy as np
|
|
3
3
|
from typing_extensions import override
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from ok.capture.BaseCaptureMethod import BaseCaptureMethod
|
|
6
|
+
from ok.logging.Logger import get_logger
|
|
7
7
|
|
|
8
8
|
logger = get_logger(__name__)
|
|
9
9
|
|
|
@@ -4,15 +4,15 @@ import adbutils
|
|
|
4
4
|
import cv2
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
7
|
+
from ok.capture.HwndWindow import HwndWindow
|
|
8
|
+
from ok.capture.adb.ADBCaptureMethod import ADBCaptureMethod
|
|
9
|
+
from ok.capture.adb.vbox import installed_emulator
|
|
10
|
+
from ok.capture.windows.WindowsGraphicsCaptureMethod import WindowsGraphicsCaptureMethod
|
|
11
|
+
from ok.config.Config import Config
|
|
12
|
+
from ok.gui.Communicate import communicate
|
|
13
|
+
from ok.interaction.ADBInteraction import ADBBaseInteraction
|
|
14
|
+
from ok.interaction.Win32Interaction import Win32Interaction
|
|
15
|
+
from ok.logging.Logger import get_logger
|
|
16
16
|
|
|
17
17
|
logger = get_logger(__name__)
|
|
18
18
|
|
|
@@ -6,9 +6,9 @@ from dataclasses import dataclass
|
|
|
6
6
|
import adbutils
|
|
7
7
|
import win32com.client
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
9
|
+
from ok.capture.adb.targets import ADBControllerTarget
|
|
10
|
+
from ok.logging.Logger import get_logger
|
|
11
|
+
from ok.util import win32_process
|
|
12
12
|
|
|
13
13
|
logger = get_logger(__name__)
|
|
14
14
|
|
{ok-script-0.0.7/autohelper → ok-script-0.0.8/ok}/capture/windows/WindowsGraphicsCaptureMethod.py
RENAMED
|
@@ -6,20 +6,20 @@ import time
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
from typing_extensions import override
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
9
|
+
from ok.capture.BaseCaptureMethod import BaseCaptureMethod
|
|
10
|
+
from ok.capture.HwndWindow import HwndWindow
|
|
11
|
+
from ok.capture.windows import d3d11
|
|
12
|
+
from ok.capture.windows.utils import WINDOWS_BUILD_NUMBER
|
|
13
|
+
from ok.logging.Logger import get_logger
|
|
14
|
+
from ok.rotypes import IInspectable
|
|
15
|
+
from ok.rotypes.Windows.Foundation import TypedEventHandler
|
|
16
|
+
from ok.rotypes.Windows.Graphics.Capture import Direct3D11CaptureFramePool, IGraphicsCaptureItemInterop, \
|
|
17
17
|
IGraphicsCaptureItem, GraphicsCaptureItem
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from ok.rotypes.Windows.Graphics.DirectX import DirectXPixelFormat
|
|
19
|
+
from ok.rotypes.Windows.Graphics.DirectX.Direct3D11 import IDirect3DDevice, \
|
|
20
20
|
CreateDirect3D11DeviceFromDXGIDevice, \
|
|
21
21
|
IDirect3DDxgiInterfaceAccess
|
|
22
|
-
from
|
|
22
|
+
from ok.rotypes.roapi import GetActivationFactory
|
|
23
23
|
|
|
24
24
|
PBYTE = ctypes.POINTER(ctypes.c_ubyte)
|
|
25
25
|
WGC_NO_BORDER_MIN_BUILD = 20348
|
|
@@ -7,10 +7,10 @@ from typing import List
|
|
|
7
7
|
import cv2
|
|
8
8
|
import numpy as np
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
10
|
+
from ok.feature.Box import Box, sort_boxes
|
|
11
|
+
from ok.feature.Feature import Feature
|
|
12
|
+
from ok.gui.Communicate import communicate
|
|
13
|
+
from ok.logging.Logger import get_logger
|
|
14
14
|
|
|
15
15
|
logger = get_logger(__name__)
|
|
16
16
|
|
|
@@ -5,14 +5,14 @@ from PySide6.QtCore import QSize, QCoreApplication, QLocale, QTranslator
|
|
|
5
5
|
from PySide6.QtGui import QIcon
|
|
6
6
|
from PySide6.QtWidgets import QApplication, QStyleFactory, QMenu, QSystemTrayIcon
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
8
|
+
import ok
|
|
9
|
+
import ok.gui.resources
|
|
10
|
+
from ok.gui.Communicate import communicate
|
|
11
|
+
from ok.gui.MainWindow import MainWindow
|
|
12
|
+
from ok.gui.i18n.path import i18n_path
|
|
13
|
+
from ok.gui.loading.LoadingWindow import LoadingWindow
|
|
14
|
+
from ok.gui.overlay.OverlayWindow import OverlayWindow
|
|
15
|
+
from ok.logging.Logger import get_logger
|
|
16
16
|
|
|
17
17
|
logger = get_logger(__name__)
|
|
18
18
|
|
|
@@ -89,8 +89,8 @@ class App:
|
|
|
89
89
|
self.main_window = MainWindow(self.tasks, self.overlay, exit_event=self.exit_event)
|
|
90
90
|
self.main_window.setWindowTitle(self.title) # Set the window title here
|
|
91
91
|
self.main_window.setWindowIcon(self.icon)
|
|
92
|
-
if self.overlay and
|
|
93
|
-
self.overlay_window = OverlayWindow(
|
|
92
|
+
if self.overlay and ok.gui.device_manager.hwnd is not None:
|
|
93
|
+
self.overlay_window = OverlayWindow(ok.gui.device_manager.hwnd)
|
|
94
94
|
|
|
95
95
|
size = self.size_relative_to_screen(width=0.5, height=0.6)
|
|
96
96
|
self.main_window.resize(size)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from PySide6.QtCore import QObject, Signal, Slot
|
|
2
2
|
from PySide6.QtWidgets import QMessageBox, QTabWidget
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from ok.gui.debug.DebugTab import DebugTab
|
|
5
|
+
from ok.gui.tasks.TaskTab import TaskTab
|
|
6
|
+
from ok.logging.Logger import get_logger
|
|
7
7
|
|
|
8
8
|
logger = get_logger(__name__)
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from PySide6.QtCore import Qt
|
|
2
2
|
from PySide6.QtWidgets import QWidget, QGridLayout, QSplitter
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from ok.gui.debug.FrameWidget import FrameWidget
|
|
5
|
+
from ok.gui.debug.InfoWidget import InfoWidget
|
|
6
|
+
from ok.gui.debug.LoggerWidget import LoggerWidget
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class DebugTab(QWidget):
|
|
@@ -5,8 +5,8 @@ from PySide6.QtCore import Qt
|
|
|
5
5
|
from PySide6.QtGui import QPainter, QImage, QPixmap, QColor, QPen
|
|
6
6
|
from PySide6.QtWidgets import QWidget
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from
|
|
8
|
+
from ok.feature.Box import Box
|
|
9
|
+
from ok.gui.Communicate import communicate
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class FrameWidget(QWidget):
|
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
from PySide6.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QComboBox, QLineEdit, QTextEdit)
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from ok.gui.Communicate import communicate
|
|
6
6
|
|
|
7
7
|
level_map = {'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARNING': logging.WARNING, 'ERROR': logging.ERROR,
|
|
8
8
|
'CRITICAL': logging.CRITICAL}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from PySide6.QtCore import Qt, QTimer
|
|
2
2
|
from PySide6.QtWidgets import QWidget, QVBoxLayout, QMessageBox, QHBoxLayout, QListWidget, QPushButton
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
4
|
+
import ok
|
|
5
|
+
from ok.gui.Communicate import communicate
|
|
6
|
+
from ok.gui.util.Alert import show_alert
|
|
7
|
+
from ok.gui.widget.RoundCornerContainer import RoundCornerContainer
|
|
8
|
+
from ok.interaction.Win32Interaction import is_admin
|
|
9
|
+
from ok.logging.Logger import get_logger
|
|
10
10
|
|
|
11
11
|
logger = get_logger(__name__)
|
|
12
12
|
|
|
@@ -50,7 +50,7 @@ class LoadingWindow(QWidget):
|
|
|
50
50
|
self.update_capture()
|
|
51
51
|
|
|
52
52
|
def refresh_clicked(self):
|
|
53
|
-
|
|
53
|
+
ok.gui.device_manager.refresh()
|
|
54
54
|
self.refresh_button.setDisabled(True)
|
|
55
55
|
self.refresh_button.setText(self.tr("Refreshing"))
|
|
56
56
|
|
|
@@ -65,16 +65,16 @@ class LoadingWindow(QWidget):
|
|
|
65
65
|
show_alert(self.tr("Error"),
|
|
66
66
|
self.tr(f"PC version requires admin privileges, Please restart this app with admin privileges!"))
|
|
67
67
|
return
|
|
68
|
-
|
|
68
|
+
ok.gui.device_manager.start()
|
|
69
69
|
self.app.show_main_window()
|
|
70
70
|
|
|
71
71
|
def capture_index_changed(self): # i is an index
|
|
72
72
|
i = self.capture_list.currentRow()
|
|
73
73
|
imei = self.capture_list_data[i]["imei"]
|
|
74
|
-
|
|
74
|
+
ok.gui.device_manager.set_preferred_device(imei)
|
|
75
75
|
|
|
76
76
|
def update_capture(self):
|
|
77
|
-
devices =
|
|
77
|
+
devices = ok.gui.device_manager.get_devices()
|
|
78
78
|
selected = self.capture_list.currentRow()
|
|
79
79
|
self.capture_list.clear()
|
|
80
80
|
self.capture_list_data.clear()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from PySide6.QtCore import QObject, Signal, Qt
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
3
|
+
from ok.capture.HwndWindow import HwndWindow
|
|
4
|
+
from ok.gui.Communicate import communicate
|
|
5
|
+
from ok.gui.debug.FrameWidget import FrameWidget
|
|
6
|
+
from ok.logging.Logger import get_logger
|
|
7
7
|
|
|
8
8
|
logger = get_logger(__name__)
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
1
|
+
from ok.gui.widget.ListTableWidgetItem import ListTableWidgetItem
|
|
2
|
+
from ok.gui.widget.NumericTableWidgetItem import NumericTableWidgetItem
|
|
3
|
+
from ok.gui.widget.YesNonWidgetItem import YesNonWidgetItem
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def config_widget_item(table, row, col, config, key, value):
|
|
@@ -2,10 +2,10 @@ from PySide6.QtCore import Slot, QPropertyAnimation
|
|
|
2
2
|
from PySide6.QtGui import QColor
|
|
3
3
|
from PySide6.QtWidgets import QPushButton
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
5
|
+
import ok
|
|
6
|
+
from ok.gui.Communicate import communicate
|
|
7
|
+
from ok.gui.util.Alert import show_alert
|
|
8
|
+
from ok.logging.Logger import get_logger
|
|
9
9
|
|
|
10
10
|
logger = get_logger(__name__)
|
|
11
11
|
|
|
@@ -33,12 +33,12 @@ class StartButton(QPushButton):
|
|
|
33
33
|
def toggle_text(self):
|
|
34
34
|
if self.isChecked():
|
|
35
35
|
logger.info("Click Start Executor")
|
|
36
|
-
if not
|
|
36
|
+
if not ok.gui.executor.start():
|
|
37
37
|
show_alert("Error", "No Task to Run, Please Enable Task First!")
|
|
38
38
|
self.setChecked(False)
|
|
39
39
|
else:
|
|
40
40
|
logger.info("Click Pause Executor")
|
|
41
|
-
|
|
41
|
+
ok.gui.executor.pause()
|
|
42
42
|
|
|
43
43
|
def start_animation(self):
|
|
44
44
|
self.animation.setStartValue(QColor(0, 0, 0))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from PySide6.QtCore import Slot
|
|
2
2
|
from PySide6.QtWidgets import QPushButton
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
4
|
+
from ok.logging.Logger import get_logger
|
|
5
|
+
from ok.task.BaseTask import BaseTask
|
|
6
6
|
|
|
7
7
|
logger = get_logger(__name__)
|
|
8
8
|
|
|
@@ -4,15 +4,15 @@ from PySide6.QtCore import Qt, QTimer
|
|
|
4
4
|
from PySide6.QtGui import QColor
|
|
5
5
|
from PySide6.QtWidgets import QTableWidget, QTableWidgetItem, QVBoxLayout, QWidget, QHBoxLayout
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
7
|
+
from ok.gui.Communicate import communicate
|
|
8
|
+
from ok.gui.tasks.ConfigItemFactory import config_widget_item
|
|
9
|
+
from ok.gui.tasks.StartButton import StartButton
|
|
10
|
+
from ok.gui.tasks.TaskOpButton import TaskOpButton
|
|
11
|
+
from ok.gui.tasks.TooltipTableWidget import TooltipTableWidget
|
|
12
|
+
from ok.gui.widget.RoundCornerContainer import RoundCornerContainer
|
|
13
|
+
from ok.gui.widget.UpdateConfigWidgetItem import value_to_string
|
|
14
|
+
from ok.logging.Logger import get_logger
|
|
15
|
+
from ok.task.BaseTask import BaseTask
|
|
16
16
|
|
|
17
17
|
logger = get_logger(__name__)
|
|
18
18
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from PySide6.QtWidgets import QMessageBox
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ok
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def show_alert(title, message):
|
|
@@ -11,7 +11,7 @@ def show_alert(title, message):
|
|
|
11
11
|
msg.setWindowTitle(title)
|
|
12
12
|
msg.setText(message)
|
|
13
13
|
|
|
14
|
-
msg.setWindowIcon(
|
|
14
|
+
msg.setWindowIcon(ok.gui.app.icon)
|
|
15
15
|
|
|
16
16
|
# Add a confirm button
|
|
17
17
|
msg.setStandardButtons(QMessageBox.Ok)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from PySide6.QtCore import QThread
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
3
|
+
from ok.gui.Communicate import communicate
|
|
4
|
+
from ok.logging.Logger import get_logger
|
|
5
5
|
|
|
6
6
|
logger = get_logger(__name__)
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from PySide6.QtCore import Qt
|
|
2
2
|
from PySide6.QtWidgets import QTableWidgetItem
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from ok.gui.widget.UpdateConfigWidgetItem import UpdateConfigWidgetItem, value_to_string
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class ListTableWidgetItem(UpdateConfigWidgetItem, QTableWidgetItem):
|
|
@@ -2,7 +2,7 @@ from PySide6.QtCore import Qt
|
|
|
2
2
|
from PySide6.QtGui import QIntValidator, QDoubleValidator
|
|
3
3
|
from PySide6.QtWidgets import QTableWidgetItem
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from ok.gui.widget.UpdateConfigWidgetItem import UpdateConfigWidgetItem, value_to_string
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class NumericTableWidgetItem(UpdateConfigWidgetItem, QTableWidgetItem):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
1
|
+
from ok.feature.Box import Box
|
|
2
|
+
from ok.gui.Communicate import communicate
|
|
3
|
+
from ok.logging.Logger import get_logger
|
|
4
4
|
|
|
5
5
|
logger = get_logger(__name__)
|
|
6
6
|
|
|
@@ -3,9 +3,9 @@ import time
|
|
|
3
3
|
|
|
4
4
|
import pydirectinput
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
6
|
+
from ok.capture.BaseCaptureMethod import BaseCaptureMethod
|
|
7
|
+
from ok.interaction.BaseInteraction import BaseInteraction
|
|
8
|
+
from ok.logging.Logger import get_logger
|
|
9
9
|
|
|
10
10
|
logger = get_logger(__name__)
|
|
11
11
|
|
|
@@ -3,8 +3,8 @@ import os
|
|
|
3
3
|
import traceback
|
|
4
4
|
from logging.handlers import TimedRotatingFileHandler
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from ok.gui.Communicate import communicate
|
|
7
|
+
from ok.util.path import get_path_relative_to_exe, ensure_dir_for_file
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class CommunicateHandler(logging.Handler):
|
|
@@ -31,7 +31,7 @@ def get_substring_from_last_dot_exclusive(s):
|
|
|
31
31
|
return s[last_dot_index + 1:]
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
auto_helper_logger = logging.getLogger("
|
|
34
|
+
auto_helper_logger = logging.getLogger("ok")
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def config_logger(config):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import time
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
from
|
|
3
|
+
from ok.feature.Box import Box, sort_boxes, find_boxes_by_name
|
|
4
|
+
from ok.gui.Communicate import communicate
|
|
5
|
+
from ok.logging.Logger import get_logger
|
|
6
6
|
|
|
7
7
|
logger = get_logger(__name__)
|
|
8
8
|
|
|
@@ -3,8 +3,8 @@ from functools import lru_cache
|
|
|
3
3
|
|
|
4
4
|
from _ctypes import POINTER
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
6
|
+
from ok.rotypes.idldsl import define_winrt_com_method, pinterface_type
|
|
7
|
+
from ok.rotypes.inspectable import IInspectable
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class IIterator_helpers:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
from ctypes import Structure, c_float, HRESULT, c_int, windll, c_uint32, c_int32, WinError
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
from
|
|
4
|
+
from ok.rotypes import delegate, HSTRING
|
|
5
|
+
from ok.rotypes.idldsl import define_winrt_com_method, generics_cache, define_winrt_com_delegate, pinterface_type, \
|
|
6
6
|
GUID
|
|
7
|
-
from
|
|
7
|
+
from ok.rotypes.inspectable import IInspectable, IUnknown
|
|
8
8
|
|
|
9
9
|
_kernel32 = windll.LoadLibrary('kernel32.dll')
|
|
10
10
|
_CreateEvent = _kernel32.CreateEventW
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
1
|
+
from ok.rotypes.idldsl import define_winrt_com_method, runtimeclass, _static_method, GUID
|
|
2
|
+
from ok.rotypes.inspectable import IInspectable
|
|
3
|
+
from ok.rotypes.winstring import HSTRING
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
@GUID('EA79A752-F7C2-4265-B1BD-C4DEC4E4F080')
|