ok-script 0.0.32__tar.gz → 0.0.34__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.32 → ok-script-0.0.34}/PKG-INFO +8 -8
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/DeviceManager.py +0 -17
- ok-script-0.0.34/ok/capture/windows/dump.py +27 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/MainWindow.py +5 -0
- ok-script-0.0.34/ok/gui/about/AboutTab.py +24 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/StartButton.py +2 -1
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/TaskExecutor.py +20 -17
- {ok-script-0.0.32 → ok-script-0.0.34}/ok_script.egg-info/PKG-INFO +8 -8
- {ok-script-0.0.32 → ok-script-0.0.34}/ok_script.egg-info/SOURCES.txt +1 -0
- ok-script-0.0.34/ok_script.egg-info/requires.txt +8 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/setup.py +8 -8
- ok-script-0.0.32/ok/gui/about/AboutTab.py +0 -15
- ok-script-0.0.32/ok_script.egg-info/requires.txt +0 -8
- {ok-script-0.0.32 → ok-script-0.0.34}/README.md +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/OK.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/HwndWindow.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/ADBCaptureMethod.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/targets.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/adb/vbox.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/color/Color.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/color/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/config/Config.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/config/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/feature/Box.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/feature/FeatureSet.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/feature/FindFeature.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/App.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/Communicate.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/about/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/common/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/DebugTab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/LoggerWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/debug/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/icon/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/qss/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/resources.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/settings/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/start/SelectHwndWindow.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/start/StartCard.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/start/StartTab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/start/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/TaskCard.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/util/Alert.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/util/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/Tab.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/gui/widget/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/interaction/ADBInteraction.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/interaction/BaseInteraction.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/interaction/Win32Interaction.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/interaction/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/logging/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/ocr/OCR.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/ocr/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/predict/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/predict/predict.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/save/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/scene/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/stats/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/BaseTask.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/ExecutorOperation.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/OneTimeTask.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/TriggerTask.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/task/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/__init__.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/json.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/list.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/path.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/thread.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok/util/yaml.py +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.32 → ok-script-0.0.34}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ok-script
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
4
4
|
Summary: Automation with Computer Vision for Python
|
|
5
5
|
Home-page: https://github.com/ok-oldking/ok-script
|
|
6
6
|
Author: ok-oldking
|
|
@@ -11,14 +11,14 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
11
11
|
Classifier: Operating System :: Microsoft :: Windows
|
|
12
12
|
Requires-Python: >=3.6
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: adbutils
|
|
15
|
-
Requires-Dist: numpy
|
|
16
|
-
Requires-Dist: PyDirectInput
|
|
14
|
+
Requires-Dist: adbutils==2.7.1
|
|
15
|
+
Requires-Dist: numpy==1.26.4
|
|
16
|
+
Requires-Dist: PyDirectInput==1.0.4
|
|
17
17
|
Requires-Dist: pywin32==306
|
|
18
|
-
Requires-Dist: typing-extensions
|
|
19
|
-
Requires-Dist: PySide6
|
|
20
|
-
Requires-Dist: PySide6-Fluent-Widgets
|
|
21
|
-
Requires-Dist: opencv-python
|
|
18
|
+
Requires-Dist: typing-extensions==4.11.0
|
|
19
|
+
Requires-Dist: PySide6==6.7.0
|
|
20
|
+
Requires-Dist: PySide6-Fluent-Widgets==1.5.6
|
|
21
|
+
Requires-Dist: opencv-python==4.9.0.80
|
|
22
22
|
|
|
23
23
|
# ok-script
|
|
24
24
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import subprocess
|
|
3
1
|
import threading
|
|
4
2
|
|
|
5
3
|
import adbutils
|
|
6
4
|
import win32gui
|
|
7
|
-
from adbutils import adb_path
|
|
8
|
-
from adbutils.errors import AdbConnectionError, AdbTimeout
|
|
9
5
|
|
|
10
6
|
from ok.capture.HwndWindow import HwndWindow, find_hwnd_by_title_and_exe
|
|
11
7
|
from ok.capture.adb.ADBCaptureMethod import ADBCaptureMethod, do_screencap
|
|
@@ -21,19 +17,6 @@ from ok.logging.Logger import get_logger
|
|
|
21
17
|
logger = get_logger(__name__)
|
|
22
18
|
|
|
23
19
|
|
|
24
|
-
def fix_adbutils_safe_connect(self):
|
|
25
|
-
try:
|
|
26
|
-
return self._create_socket()
|
|
27
|
-
except (AdbConnectionError, AdbTimeout):
|
|
28
|
-
flags = subprocess.CREATE_NO_WINDOW if os.name == 'nt' else 0
|
|
29
|
-
subprocess.run([adb_path(), "start-server"], timeout=20.0,
|
|
30
|
-
creationflags=flags) # 20s should enough for adb start
|
|
31
|
-
return self._create_socket()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
adbutils._adb.AdbConnection._safe_connect = fix_adbutils_safe_connect
|
|
35
|
-
|
|
36
|
-
|
|
37
20
|
class DeviceManager:
|
|
38
21
|
|
|
39
22
|
def __init__(self, config_folder, hwnd_title=None, exe_name=None, debug=False, exit_event=None):
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import traceback
|
|
3
|
+
import threading
|
|
4
|
+
|
|
5
|
+
from ok.util.path import get_path_relative_to_exe
|
|
6
|
+
|
|
7
|
+
def get_thread_name(thread_id):
|
|
8
|
+
for thread in threading.enumerate():
|
|
9
|
+
if thread.ident == thread_id:
|
|
10
|
+
return thread.name
|
|
11
|
+
return "" # Return empty string if the thread name is not found
|
|
12
|
+
|
|
13
|
+
def dump_threads():
|
|
14
|
+
# Get the stack trace for each thread
|
|
15
|
+
thread_dumps = []
|
|
16
|
+
for thread_id, frame in sys._current_frames().items():
|
|
17
|
+
thread_name = get_thread_name(thread_id)
|
|
18
|
+
thread_dump = f"Stack for thread {thread_id} (Name: {thread_name}):\n"
|
|
19
|
+
thread_dump += "".join(traceback.format_stack(frame))
|
|
20
|
+
thread_dumps.append(thread_dump)
|
|
21
|
+
|
|
22
|
+
# Write the thread dumps to a file
|
|
23
|
+
output_file = get_path_relative_to_exe("thread_dumps.txt")
|
|
24
|
+
print(f'Dumping threads to {output_file}')
|
|
25
|
+
|
|
26
|
+
with open(output_file, "w") as file:
|
|
27
|
+
file.write("\n\n".join(thread_dumps))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from PySide6.QtCore import QObject, Signal, Qt
|
|
2
|
+
from PySide6.QtGui import QKeySequence, QShortcut
|
|
2
3
|
from qfluentwidgets import FluentIcon, NavigationItemPosition, MSFluentWindow, InfoBar, InfoBarPosition, MessageBox
|
|
3
4
|
|
|
4
5
|
import ok.gui
|
|
6
|
+
from ok.capture.windows.dump import dump_threads
|
|
5
7
|
from ok.gui.Communicate import communicate
|
|
6
8
|
from ok.gui.about.AboutTab import AboutTab
|
|
7
9
|
from ok.gui.start.StartTab import StartTab
|
|
@@ -48,6 +50,9 @@ class MainWindow(MSFluentWindow):
|
|
|
48
50
|
communicate.executor_paused.connect(self.executor_paused)
|
|
49
51
|
communicate.tab.connect(self.navigate_tab)
|
|
50
52
|
|
|
53
|
+
self.shortcut = QShortcut(QKeySequence("Ctrl+Alt+D"), self)
|
|
54
|
+
self.shortcut.activated.connect(dump_threads)
|
|
55
|
+
|
|
51
56
|
def navigate_tab(self, index):
|
|
52
57
|
if index == "start":
|
|
53
58
|
self.switchTo(self.start_tab)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from PySide6.QtWidgets import QTextEdit
|
|
2
|
+
from qfluentwidgets import TextEdit, PushButton
|
|
3
|
+
|
|
4
|
+
import ok.gui
|
|
5
|
+
from ok.capture.windows.dump import dump_threads
|
|
6
|
+
from ok.gui.widget.Tab import Tab
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AboutTab(Tab):
|
|
10
|
+
def __init__(self, text=""):
|
|
11
|
+
super().__init__()
|
|
12
|
+
# Create a QTextEdit instance
|
|
13
|
+
text_edit = TextEdit()
|
|
14
|
+
text_edit.setHtml(text)
|
|
15
|
+
text_edit.setReadOnly(True)
|
|
16
|
+
|
|
17
|
+
# Set the layout on the widget
|
|
18
|
+
self.addWidget(text_edit)
|
|
19
|
+
if ok.gui.ok.debug:
|
|
20
|
+
dump_button = PushButton(self.tr("Dump Threads(HotKey:Ctrl+Alt+D)"))
|
|
21
|
+
dump_button.clicked.connect(dump_threads)
|
|
22
|
+
self.addWidget(dump_button)
|
|
23
|
+
|
|
24
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from PySide6.QtCore import Slot, QPropertyAnimation
|
|
2
2
|
from PySide6.QtGui import QColor
|
|
3
3
|
from PySide6.QtWidgets import QPushButton
|
|
4
|
+
from qfluentwidgets import PushButton
|
|
4
5
|
|
|
5
6
|
import ok
|
|
6
7
|
from ok.gui.Communicate import communicate
|
|
@@ -10,7 +11,7 @@ from ok.logging.Logger import get_logger
|
|
|
10
11
|
logger = get_logger(__name__)
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class StartButton(
|
|
14
|
+
class StartButton(PushButton):
|
|
14
15
|
def __init__(self):
|
|
15
16
|
super().__init__("Start")
|
|
16
17
|
self.setCheckable(True)
|
|
@@ -196,14 +196,13 @@ class TaskExecutor:
|
|
|
196
196
|
processing_time = 0
|
|
197
197
|
while not self.exit_event.is_set():
|
|
198
198
|
try:
|
|
199
|
-
|
|
200
|
-
if not
|
|
199
|
+
self.current_task, cycled = self.next_task()
|
|
200
|
+
if not self.current_task:
|
|
201
201
|
time.sleep(1)
|
|
202
202
|
continue
|
|
203
|
-
self.current_task
|
|
204
|
-
|
|
205
|
-
task.
|
|
206
|
-
communicate.task.emit(task)
|
|
203
|
+
if isinstance(self.current_task, OneTimeTask):
|
|
204
|
+
self.current_task.running = True
|
|
205
|
+
communicate.task.emit(self.current_task)
|
|
207
206
|
if cycled or self._frame is None:
|
|
208
207
|
self.next_frame()
|
|
209
208
|
processing_time = 0
|
|
@@ -213,14 +212,14 @@ class TaskExecutor:
|
|
|
213
212
|
self.next_frame()
|
|
214
213
|
self.detect_scene()
|
|
215
214
|
start = time.time()
|
|
216
|
-
result =
|
|
215
|
+
result = self.current_task.run()
|
|
217
216
|
processing_time += time.time() - start
|
|
218
|
-
if result and isinstance(
|
|
219
|
-
|
|
220
|
-
communicate.task.emit(
|
|
221
|
-
elif isinstance(
|
|
222
|
-
|
|
223
|
-
communicate.task.emit(
|
|
217
|
+
if result and isinstance(self.current_task, TriggerTask):
|
|
218
|
+
self.current_task.trigger_count += 1
|
|
219
|
+
communicate.task.emit(self.current_task)
|
|
220
|
+
elif isinstance(self.current_task, OneTimeTask):
|
|
221
|
+
self.current_task.set_done()
|
|
222
|
+
communicate.task.emit(self.current_task)
|
|
224
223
|
self.current_task = None
|
|
225
224
|
except TaskDisabledException:
|
|
226
225
|
logger.info(f"task is disabled, go to next task")
|
|
@@ -228,13 +227,17 @@ class TaskExecutor:
|
|
|
228
227
|
logger.info(f"FinishedException, breaking")
|
|
229
228
|
break
|
|
230
229
|
except Exception as e:
|
|
230
|
+
name = ""
|
|
231
|
+
if self.current_task is not None:
|
|
232
|
+
self.current_task.disable()
|
|
233
|
+
name = self.current_task.name
|
|
231
234
|
traceback.print_exc()
|
|
232
235
|
stack_trace_str = traceback.format_exc()
|
|
233
|
-
logger.error(f"{
|
|
236
|
+
logger.error(f"{name} exception: {e}, traceback: {stack_trace_str}")
|
|
234
237
|
self.current_task = None
|
|
235
|
-
if isinstance(
|
|
236
|
-
|
|
237
|
-
communicate.task.emit(
|
|
238
|
+
if isinstance(self.current_task, OneTimeTask):
|
|
239
|
+
self.current_task.running = False
|
|
240
|
+
communicate.task.emit(self.current_task)
|
|
238
241
|
logger.debug(f'exit_event is set, destroy all tasks')
|
|
239
242
|
for task in self.onetime_tasks:
|
|
240
243
|
task.on_destroy()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ok-script
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
4
4
|
Summary: Automation with Computer Vision for Python
|
|
5
5
|
Home-page: https://github.com/ok-oldking/ok-script
|
|
6
6
|
Author: ok-oldking
|
|
@@ -11,14 +11,14 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
11
11
|
Classifier: Operating System :: Microsoft :: Windows
|
|
12
12
|
Requires-Python: >=3.6
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: adbutils
|
|
15
|
-
Requires-Dist: numpy
|
|
16
|
-
Requires-Dist: PyDirectInput
|
|
14
|
+
Requires-Dist: adbutils==2.7.1
|
|
15
|
+
Requires-Dist: numpy==1.26.4
|
|
16
|
+
Requires-Dist: PyDirectInput==1.0.4
|
|
17
17
|
Requires-Dist: pywin32==306
|
|
18
|
-
Requires-Dist: typing-extensions
|
|
19
|
-
Requires-Dist: PySide6
|
|
20
|
-
Requires-Dist: PySide6-Fluent-Widgets
|
|
21
|
-
Requires-Dist: opencv-python
|
|
18
|
+
Requires-Dist: typing-extensions==4.11.0
|
|
19
|
+
Requires-Dist: PySide6==6.7.0
|
|
20
|
+
Requires-Dist: PySide6-Fluent-Widgets==1.5.6
|
|
21
|
+
Requires-Dist: opencv-python==4.9.0.80
|
|
22
22
|
|
|
23
23
|
# ok-script
|
|
24
24
|
|
|
@@ -14,6 +14,7 @@ ok/capture/adb/bin/__init__.py
|
|
|
14
14
|
ok/capture/windows/WindowsGraphicsCaptureMethod.py
|
|
15
15
|
ok/capture/windows/__init__.py
|
|
16
16
|
ok/capture/windows/d3d11.py
|
|
17
|
+
ok/capture/windows/dump.py
|
|
17
18
|
ok/capture/windows/utils.py
|
|
18
19
|
ok/capture/windows/window.py
|
|
19
20
|
ok/color/Color.py
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="ok-script",
|
|
8
|
-
version="0.0.
|
|
8
|
+
version="0.0.34",
|
|
9
9
|
author="ok-oldking",
|
|
10
10
|
author_email="firedcto@gmail.com",
|
|
11
11
|
description="Automation with Computer Vision for Python",
|
|
@@ -20,14 +20,14 @@ setuptools.setup(
|
|
|
20
20
|
"Operating System :: Microsoft :: Windows",
|
|
21
21
|
],
|
|
22
22
|
install_requires=[
|
|
23
|
-
'adbutils
|
|
24
|
-
'numpy
|
|
25
|
-
'PyDirectInput
|
|
23
|
+
'adbutils==2.7.1',
|
|
24
|
+
'numpy==1.26.4',
|
|
25
|
+
'PyDirectInput==1.0.4',
|
|
26
26
|
'pywin32==306',
|
|
27
|
-
'typing-extensions
|
|
28
|
-
'PySide6
|
|
29
|
-
'PySide6-Fluent-Widgets
|
|
30
|
-
'opencv-python
|
|
27
|
+
'typing-extensions==4.11.0',
|
|
28
|
+
'PySide6==6.7.0',
|
|
29
|
+
'PySide6-Fluent-Widgets==1.5.6',
|
|
30
|
+
'opencv-python==4.9.0.80'
|
|
31
31
|
],
|
|
32
32
|
python_requires='>=3.6',
|
|
33
33
|
)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from PySide6.QtWidgets import QTextEdit
|
|
2
|
-
|
|
3
|
-
from ok.gui.widget.Tab import Tab
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class AboutTab(Tab):
|
|
7
|
-
def __init__(self, text=""):
|
|
8
|
-
super().__init__()
|
|
9
|
-
# Create a QTextEdit instance
|
|
10
|
-
text_edit = QTextEdit()
|
|
11
|
-
text_edit.setHtml(text)
|
|
12
|
-
text_edit.setReadOnly(True)
|
|
13
|
-
|
|
14
|
-
# Set the layout on the widget
|
|
15
|
-
self.addWidget(text_edit)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.32 → ok-script-0.0.34}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|