ok-script 0.0.330__tar.gz → 0.0.332__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.330/ok_script.egg-info → ok_script-0.0.332}/PKG-INFO +1 -1
- ok_script-0.0.332/ok/Capture.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/OK.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/Task.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.332/ok/Util.cp312-win_amd64.pyd +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/analytics/Analytics.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/windows/dump.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/config/Config.py +2 -2
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/FeatureSet.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/App.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/StartController.py +16 -13
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/common/config.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/debug/DebugTab.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/debug/Screenshot.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/i18n/GettextTranslator.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/Launcher.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/LauncherWindow.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/start/SelectCaptureListView.py +2 -6
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/start/StartCard.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/start/StartTab.py +0 -2
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndDropDown.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/PyDirectInteraction.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/logging/Logger.py +1 -2
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/DownloadMonitor.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/GitUpdater.py +3 -3
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/gen_md5.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/package_full_with_profile.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/package_launcher.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/python_env.py +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332/ok_script.egg-info}/PKG-INFO +1 -1
- {ok_script-0.0.330 → ok_script-0.0.332}/ok_script.egg-info/SOURCES.txt +1 -10
- {ok_script-0.0.330 → ok_script-0.0.332}/setup.py +1 -1
- ok_script-0.0.330/ok/Capture.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.330/ok/OK.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.330/ok/Task.cp312-win_amd64.pyd +0 -0
- ok_script-0.0.330/ok/util/Handler.py +0 -82
- ok_script-0.0.330/ok/util/clazz.py +0 -7
- ok_script-0.0.330/ok/util/exit_event.py +0 -25
- ok_script-0.0.330/ok/util/json.py +0 -23
- ok_script-0.0.330/ok/util/list.py +0 -17
- ok_script-0.0.330/ok/util/path.py +0 -211
- ok_script-0.0.330/ok/util/thread.py +0 -12
- ok_script-0.0.330/ok/util/win.py +0 -9
- ok_script-0.0.330/ok/util/win32_process.py +0 -117
- ok_script-0.0.330/ok/util/yaml.py +0 -28
- {ok_script-0.0.330 → ok_script-0.0.332}/LICENSE.txt +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/MANIFEST.in +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/README.md +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/emulator_base.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/emulator_windows.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/platform_base.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/platform_windows.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/alas/utils.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/analytics/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/adb/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/adb/nemu_ipc.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/adb/nemu_utils.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/windows/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/windows/d3d11.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/windows/utils.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/capture/windows/window.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/color/Color.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/color/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/config/ConfigOption.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/config/GlobalConfig.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/config/InfoDict.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/config/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/custom_types.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/display.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/display_adapters.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/display_monitors.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/display/windows_types.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/Box.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/CompressCoco.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/Feature.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/FindFeature.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/feature/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/Communicate.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/MainWindow.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/MessageWindow.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/TabTitles.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/about/AboutTab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/about/VersionCard.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/about/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/common/OKIcon.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/common/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/common/style_sheet.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/debug/FrameWidget.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/debug/LogWindow.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/debug/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/i18n/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/i18n/path.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/i18n/update.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/icon/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/icon/icon.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/DownloadBar.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/LinksBar.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/RunBar.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/UpdateBar.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/launcher/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/overlay/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/qss/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/resources.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/settings/GlobalConfigCard.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/settings/SettingTab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/settings/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/start/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/ConfigCard.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndMultiSelection.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/StartButton.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/TaskCard.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/TaskTab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/tasks/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/util/Alert.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/util/InitWorker.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/util/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/util/app.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/util/pip_util.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/BaseWindow.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/Card.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/EmptyCard.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/FlowLayout.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/StartLoadingDialog.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/StatusBar.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/Tab.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/TabWidget.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/gui/widget/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/ADBInteraction.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/BaseInteraction.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/PostMessageInteraction.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/interaction/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/logging/LogTailer.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/logging/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/ocr/OCR.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/ocr/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/ocr/download_paddle_model.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/Windows/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/delegate.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/export.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/idldsl.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/inspectable.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/roapi.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/types.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/rotypes/winstring.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/scene/FeatureScene.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/scene/Scene.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/scene/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/stats/StreamStats.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/stats/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/test/TaskTestCase.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/test/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/GithubMultiDownloader.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/copy_ok_folder.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/init_launcher_env.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/update/push_repos.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok/util/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok_script.egg-info/requires.txt +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/ok_script.egg-info/top_level.txt +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/setup.cfg +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/tests/__init__.py +0 -0
- {ok_script-0.0.330 → ok_script-0.0.332}/tests/test_updater.py +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from ok.gui.Communicate import communicate
|
|
2
2
|
from ok.logging.Logger import get_logger
|
|
3
|
-
from ok.
|
|
4
|
-
from ok.
|
|
3
|
+
from ok.Util import read_json_file, write_json_file
|
|
4
|
+
from ok.Util import get_relative_path
|
|
5
5
|
|
|
6
6
|
logger = get_logger(__name__)
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ from ok.gui.overlay.OverlayWindow import OverlayWindow
|
|
|
15
15
|
from ok.gui.util.app import init_app_config
|
|
16
16
|
from ok.logging.Logger import get_logger
|
|
17
17
|
from ok.update.GitUpdater import GitUpdater
|
|
18
|
-
from ok.
|
|
18
|
+
from ok.Util import get_path_relative_to_exe
|
|
19
19
|
|
|
20
20
|
logger = get_logger(__name__)
|
|
21
21
|
|
|
@@ -2,14 +2,14 @@ import time
|
|
|
2
2
|
|
|
3
3
|
from PySide6.QtCore import QObject
|
|
4
4
|
from ok.Capture import BaseWindowsCaptureMethod
|
|
5
|
+
from ok.Util import Handler
|
|
6
|
+
from ok.Util import is_admin
|
|
5
7
|
|
|
6
8
|
import ok.gui
|
|
7
9
|
from ok.alas.platform_windows import execute
|
|
8
10
|
from ok.gui.Communicate import communicate
|
|
9
11
|
from ok.gui.util.Alert import alert_error
|
|
10
12
|
from ok.logging.Logger import get_logger
|
|
11
|
-
from ok.util.Handler import Handler
|
|
12
|
-
from ok.util.win import is_admin
|
|
13
13
|
|
|
14
14
|
logger = get_logger(__name__)
|
|
15
15
|
|
|
@@ -113,19 +113,22 @@ class StartController(QObject):
|
|
|
113
113
|
'supported_resolution', {})
|
|
114
114
|
supported_ratio = supported_resolution.get('ratio')
|
|
115
115
|
min_size = supported_resolution.get('min_size')
|
|
116
|
+
resize_to_ratio = supported_resolution.get('resize_to_ratio')
|
|
116
117
|
supported, resolution = ok.gui.executor.check_frame_and_resolution(supported_ratio, min_size)
|
|
117
118
|
if not supported:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if
|
|
122
|
-
error
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
resize_success = False
|
|
120
|
+
if resize_to_ratio and isinstance(ok.gui.device_manager.capture_method, BaseWindowsCaptureMethod):
|
|
121
|
+
resize_success = ok.gui.device_manager.capture_method.hwnd_window.try_resize_to(supported_ratio)
|
|
122
|
+
if not resize_success:
|
|
123
|
+
error = self.tr(
|
|
124
|
+
'Resolution {resolution} check failed, some tasks might not work correctly!').format(
|
|
125
|
+
resolution=resolution)
|
|
126
|
+
if supported_ratio:
|
|
127
|
+
error += self.tr(', the supported ratio is {supported_ratio}').format(
|
|
128
|
+
supported_ratio=supported_ratio)
|
|
129
|
+
if min_size:
|
|
130
|
+
error += self.tr(', the supported min resolution is {min_size}').format(
|
|
131
|
+
min_size=f'{min_size[0]}x{min_size[1]}')
|
|
129
132
|
if device and device['device'] == "windows" and not is_admin():
|
|
130
133
|
return self.tr(
|
|
131
134
|
f"PC version requires admin privileges, Please restart this app with admin privileges!")
|
|
@@ -4,7 +4,7 @@ from enum import Enum
|
|
|
4
4
|
|
|
5
5
|
from PySide6.QtCore import QLocale
|
|
6
6
|
|
|
7
|
-
from ok.
|
|
7
|
+
from ok.Util import get_relative_path
|
|
8
8
|
from qfluentwidgets import (qconfig, QConfig, ConfigItem, OptionsConfigItem, BoolValidator,
|
|
9
9
|
OptionsValidator, RangeConfigItem, RangeValidator,
|
|
10
10
|
ConfigSerializer, Theme, EnumSerializer)
|
|
@@ -17,7 +17,7 @@ from ok.gui.widget.Tab import Tab
|
|
|
17
17
|
from ok.interaction.DoNothingInteraction import DoNothingInteraction
|
|
18
18
|
from ok.logging.Logger import get_logger, exception_to_str
|
|
19
19
|
from ok.ocr.OCR import OCR
|
|
20
|
-
from ok.
|
|
20
|
+
from ok.Util import Handler
|
|
21
21
|
|
|
22
22
|
logger = get_logger(__name__)
|
|
23
23
|
|
|
@@ -13,7 +13,7 @@ import ok.gui
|
|
|
13
13
|
from ok.feature.Box import Box
|
|
14
14
|
from ok.gui.Communicate import communicate
|
|
15
15
|
from ok.logging.Logger import get_logger
|
|
16
|
-
from ok.
|
|
16
|
+
from ok.Util import find_first_existing_file, clear_folder, sanitize_filename, \
|
|
17
17
|
get_relative_path
|
|
18
18
|
|
|
19
19
|
logger = get_logger(__name__)
|
|
@@ -5,7 +5,7 @@ from ok.gui.launcher.LauncherWindow import LauncherWindow
|
|
|
5
5
|
from ok.gui.util.app import init_app_config, center_window
|
|
6
6
|
from ok.logging.Logger import get_logger, config_logger
|
|
7
7
|
from ok.update.GitUpdater import GitUpdater
|
|
8
|
-
from ok.
|
|
8
|
+
from ok.Util import ExitEvent
|
|
9
9
|
|
|
10
10
|
logger = get_logger(__name__)
|
|
11
11
|
|
|
@@ -10,7 +10,7 @@ from ok.gui.launcher.UpdateBar import UpdateBar
|
|
|
10
10
|
from ok.gui.util.app import show_info_bar
|
|
11
11
|
from ok.gui.widget.BaseWindow import BaseWindow
|
|
12
12
|
from ok.logging.Logger import get_logger
|
|
13
|
-
from ok.
|
|
13
|
+
from ok.Util import get_path_relative_to_exe
|
|
14
14
|
|
|
15
15
|
logger = get_logger(__name__)
|
|
16
16
|
|
|
@@ -22,17 +22,13 @@ class SelectCaptureListView(ListWidget):
|
|
|
22
22
|
elif device.get('emulator') is not None:
|
|
23
23
|
title = self.tr("ADB(Supports Background, Slow, High Compatibility, High Latency)")
|
|
24
24
|
if self.count() == 1:
|
|
25
|
-
item = QListWidgetItem(self.tr("Emulator Window(Supports Background, Fast, Low Latency)"))
|
|
26
|
-
self.addItem(item)
|
|
27
25
|
from ok.alas.emulator_windows import Emulator
|
|
28
26
|
if device.get('emulator') and device.get('emulator').type == Emulator.MuMuPlayer12:
|
|
29
27
|
item = QListWidgetItem(self.tr("Ipc (MuMuPlayer12 version >= 4.0)"))
|
|
30
28
|
self.addItem(item)
|
|
31
|
-
selected =
|
|
32
|
-
if ok.gui.device_manager.get_preferred_capture() == "
|
|
29
|
+
selected = 1
|
|
30
|
+
if ok.gui.device_manager.get_preferred_capture() == "ipc":
|
|
33
31
|
selected = 1
|
|
34
|
-
elif ok.gui.device_manager.get_preferred_capture() == "ipc":
|
|
35
|
-
selected = 2
|
|
36
32
|
else:
|
|
37
33
|
title = self.tr("ADB(Supports Background, Slow, High Compatibility, High Latency)")
|
|
38
34
|
self.reduce_row_to_1()
|
|
@@ -10,7 +10,7 @@ from ok.gui.Communicate import communicate
|
|
|
10
10
|
from ok.gui.debug.DebugTab import capture
|
|
11
11
|
from ok.gui.widget.StatusBar import StatusBar
|
|
12
12
|
from ok.logging.Logger import get_logger
|
|
13
|
-
from ok.
|
|
13
|
+
from ok.Util import Handler
|
|
14
14
|
|
|
15
15
|
logger = get_logger(__name__)
|
|
16
16
|
|
|
@@ -63,8 +63,6 @@ class StartTab(Tab):
|
|
|
63
63
|
if i == 0:
|
|
64
64
|
ok.gui.device_manager.set_capture("adb")
|
|
65
65
|
elif i == 1:
|
|
66
|
-
ok.gui.device_manager.set_capture("windows")
|
|
67
|
-
elif i == 2:
|
|
68
66
|
ok.gui.device_manager.set_capture("ipc")
|
|
69
67
|
elif device.get('device') == 'windows':
|
|
70
68
|
ok.gui.device_manager.set_capture("windows")
|
|
@@ -5,7 +5,7 @@ import pydirectinput
|
|
|
5
5
|
from ok.Capture import BaseCaptureMethod
|
|
6
6
|
from ok.interaction.BaseInteraction import BaseInteraction
|
|
7
7
|
from ok.logging.Logger import get_logger
|
|
8
|
-
from ok.
|
|
8
|
+
from ok.Util import is_admin
|
|
9
9
|
|
|
10
10
|
logger = get_logger(__name__)
|
|
11
11
|
|
|
@@ -5,8 +5,6 @@ import sys
|
|
|
5
5
|
import traceback
|
|
6
6
|
from logging.handlers import TimedRotatingFileHandler, QueueHandler, QueueListener
|
|
7
7
|
|
|
8
|
-
from ok.util.path import ensure_dir_for_file, get_relative_path
|
|
9
|
-
|
|
10
8
|
|
|
11
9
|
class CommunicateHandler(logging.Handler):
|
|
12
10
|
def __init__(self):
|
|
@@ -45,6 +43,7 @@ def log_exception_handler(exc_type, exc_value, exc_traceback):
|
|
|
45
43
|
|
|
46
44
|
|
|
47
45
|
def config_logger(config=None, name='ok-script'):
|
|
46
|
+
from ok.Util import ensure_dir_for_file, get_relative_path
|
|
48
47
|
if not config:
|
|
49
48
|
config = {'debug': True}
|
|
50
49
|
if config.get('debug'):
|
|
@@ -19,8 +19,8 @@ from ok.logging.LogTailer import LogTailer
|
|
|
19
19
|
from ok.logging.Logger import get_logger
|
|
20
20
|
from ok.update.DownloadMonitor import DownloadMonitor
|
|
21
21
|
from ok.update.python_env import create_venv, find_line_in_requirements, get_env_path, modify_venv_cfg
|
|
22
|
-
from ok.
|
|
23
|
-
from ok.
|
|
22
|
+
from ok.Util import Handler
|
|
23
|
+
from ok.Util import get_relative_path, delete_if_exists, delete_folders_starts_with
|
|
24
24
|
|
|
25
25
|
logger = get_logger(__name__)
|
|
26
26
|
|
|
@@ -399,7 +399,7 @@ class GitUpdater:
|
|
|
399
399
|
import git
|
|
400
400
|
repo = git.Repo.clone_from(self.url, path, branch=version, depth=depth)
|
|
401
401
|
else:
|
|
402
|
-
repo.git.fetch('origin', f'refs/tags/{version}:refs/tags/{version}', '--depth=1')
|
|
402
|
+
repo.git.fetch('origin', f'refs/tags/{version}:refs/tags/{version}', '--depth=1', '--force')
|
|
403
403
|
repo.git.checkout(version, force=True)
|
|
404
404
|
fix_version_in_repo(path, version)
|
|
405
405
|
|
|
@@ -6,7 +6,7 @@ import json
|
|
|
6
6
|
import subprocess
|
|
7
7
|
from ok.logging.Logger import config_logger, get_logger
|
|
8
8
|
from ok.update.init_launcher_env import create_app_env
|
|
9
|
-
from ok.
|
|
9
|
+
from ok.Util import delete_if_exists
|
|
10
10
|
|
|
11
11
|
logger = get_logger(__name__)
|
|
12
12
|
|
|
@@ -9,7 +9,7 @@ from ok.config.Config import Config
|
|
|
9
9
|
from ok.logging.Logger import config_logger, get_logger
|
|
10
10
|
from ok.update.GitUpdater import copy_exe_files, fix_version_in_repo
|
|
11
11
|
from ok.update.init_launcher_env import create_launcher_env
|
|
12
|
-
from ok.
|
|
12
|
+
from ok.Util import dir_checksum, delete_if_exists
|
|
13
13
|
|
|
14
14
|
logger = get_logger(__name__)
|
|
15
15
|
|
|
@@ -5,6 +5,7 @@ setup.py
|
|
|
5
5
|
ok/Capture.cp312-win_amd64.pyd
|
|
6
6
|
ok/OK.cp312-win_amd64.pyd
|
|
7
7
|
ok/Task.cp312-win_amd64.pyd
|
|
8
|
+
ok/Util.cp312-win_amd64.pyd
|
|
8
9
|
ok/__init__.py
|
|
9
10
|
ok/alas/__init__.py
|
|
10
11
|
ok/alas/emulator_base.py
|
|
@@ -179,17 +180,7 @@ ok/update/package_full_with_profile.py
|
|
|
179
180
|
ok/update/package_launcher.py
|
|
180
181
|
ok/update/push_repos.py
|
|
181
182
|
ok/update/python_env.py
|
|
182
|
-
ok/util/Handler.py
|
|
183
183
|
ok/util/__init__.py
|
|
184
|
-
ok/util/clazz.py
|
|
185
|
-
ok/util/exit_event.py
|
|
186
|
-
ok/util/json.py
|
|
187
|
-
ok/util/list.py
|
|
188
|
-
ok/util/path.py
|
|
189
|
-
ok/util/thread.py
|
|
190
|
-
ok/util/win.py
|
|
191
|
-
ok/util/win32_process.py
|
|
192
|
-
ok/util/yaml.py
|
|
193
184
|
ok_script.egg-info/PKG-INFO
|
|
194
185
|
ok_script.egg-info/SOURCES.txt
|
|
195
186
|
ok_script.egg-info/dependency_links.txt
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import heapq
|
|
2
|
-
import threading
|
|
3
|
-
import time
|
|
4
|
-
from dataclasses import dataclass, field
|
|
5
|
-
|
|
6
|
-
from ok.logging.Logger import get_logger
|
|
7
|
-
from ok.util.exit_event import ExitEvent
|
|
8
|
-
|
|
9
|
-
logger = get_logger(__name__)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@dataclass(order=True)
|
|
13
|
-
class ScheduledTask:
|
|
14
|
-
execute_at: float
|
|
15
|
-
task: callable = field(compare=False)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Handler:
|
|
19
|
-
def __init__(self, event: ExitEvent, name=None):
|
|
20
|
-
self.task_queue = []
|
|
21
|
-
self.executing = None
|
|
22
|
-
self.condition = threading.Condition()
|
|
23
|
-
self.exit_event = event
|
|
24
|
-
self.exit_event.bind_stop(self)
|
|
25
|
-
self.thread = threading.Thread(target=self._process_tasks, name=name)
|
|
26
|
-
self.thread.start()
|
|
27
|
-
|
|
28
|
-
def _process_tasks(self):
|
|
29
|
-
while not self.exit_event.is_set():
|
|
30
|
-
with self.condition:
|
|
31
|
-
while not self.task_queue:
|
|
32
|
-
self.condition.wait()
|
|
33
|
-
|
|
34
|
-
now = time.time()
|
|
35
|
-
self.condition.acquire()
|
|
36
|
-
if self.task_queue and self.task_queue[0].execute_at <= now:
|
|
37
|
-
scheduled_task = heapq.heappop(self.task_queue)
|
|
38
|
-
self.condition.release()
|
|
39
|
-
if scheduled_task.task is None:
|
|
40
|
-
logger.debug(f'stopping handler {self.thread.name}')
|
|
41
|
-
return
|
|
42
|
-
self.executing = scheduled_task.task
|
|
43
|
-
try:
|
|
44
|
-
scheduled_task.task()
|
|
45
|
-
except Exception as e:
|
|
46
|
-
logger.error(f'handler {self.thread.name} raised exception', e)
|
|
47
|
-
self.executing = None
|
|
48
|
-
else:
|
|
49
|
-
if self.task_queue:
|
|
50
|
-
next_time = self.task_queue[0].execute_at
|
|
51
|
-
timeout = next_time - now
|
|
52
|
-
if timeout > 0:
|
|
53
|
-
self.condition.wait(timeout=timeout)
|
|
54
|
-
self.condition.release()
|
|
55
|
-
|
|
56
|
-
def post(self, task, delay=0, remove_existing=False, skip_if_running=False):
|
|
57
|
-
with self.condition:
|
|
58
|
-
if self.exit_event.is_set():
|
|
59
|
-
logger.error(f'post handler {self.thread.name} already exits')
|
|
60
|
-
self.condition.notify_all()
|
|
61
|
-
return
|
|
62
|
-
if remove_existing and len(self.task_queue) > 0:
|
|
63
|
-
for obj in self.task_queue.copy():
|
|
64
|
-
if obj.task == task:
|
|
65
|
-
self.task_queue.remove(obj)
|
|
66
|
-
logger.debug(f'removing duplicate task {task}')
|
|
67
|
-
if skip_if_running and self.executing == task:
|
|
68
|
-
logger.debug(f'skipping duplicate task {task}')
|
|
69
|
-
return
|
|
70
|
-
if delay > 0:
|
|
71
|
-
scheduled_task = ScheduledTask(time.time() + delay, task)
|
|
72
|
-
else:
|
|
73
|
-
scheduled_task = ScheduledTask(0, task)
|
|
74
|
-
heapq.heappush(self.task_queue, scheduled_task)
|
|
75
|
-
self.condition.notify_all()
|
|
76
|
-
return True
|
|
77
|
-
|
|
78
|
-
def stop(self):
|
|
79
|
-
with self.condition:
|
|
80
|
-
self.task_queue.clear()
|
|
81
|
-
heapq.heappush(self.task_queue, ScheduledTask(0, None))
|
|
82
|
-
self.condition.notify_all()
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import threading
|
|
2
|
-
|
|
3
|
-
from ok.logging.Logger import get_logger
|
|
4
|
-
|
|
5
|
-
logger = get_logger(__name__)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ExitEvent(threading.Event):
|
|
9
|
-
queues = set()
|
|
10
|
-
to_stops = set()
|
|
11
|
-
|
|
12
|
-
def bind_queue(self, queue):
|
|
13
|
-
self.queues.add(queue)
|
|
14
|
-
|
|
15
|
-
def bind_stop(self, to_stop):
|
|
16
|
-
self.to_stops.add(to_stop)
|
|
17
|
-
|
|
18
|
-
def set(self):
|
|
19
|
-
super(ExitEvent, self).set()
|
|
20
|
-
logger.debug(f"ExitEvent set event empty queues {self.queues} to_stops: {self.to_stops}")
|
|
21
|
-
for queue in self.queues:
|
|
22
|
-
queue.put(None)
|
|
23
|
-
|
|
24
|
-
for to_stop in self.to_stops:
|
|
25
|
-
to_stop.stop()
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
from ok.util.path import ensure_dir_for_file
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def read_json_file(file_path) -> dict | None:
|
|
8
|
-
if not os.path.exists(file_path):
|
|
9
|
-
return None
|
|
10
|
-
|
|
11
|
-
try:
|
|
12
|
-
with open(file_path, 'r', encoding='utf-8') as f:
|
|
13
|
-
data = json.load(f)
|
|
14
|
-
return data
|
|
15
|
-
except json.JSONDecodeError:
|
|
16
|
-
return None
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def write_json_file(file_path, data):
|
|
20
|
-
ensure_dir_for_file(file_path)
|
|
21
|
-
with open(file_path, 'w', encoding='utf-8') as f:
|
|
22
|
-
json.dump(data, f, indent=4, ensure_ascii=False)
|
|
23
|
-
return True
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
def get_first_item(lst, default=None):
|
|
2
|
-
return next(iter(lst), default) if lst is not None else default
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def safe_get(lst, idx, default=None):
|
|
6
|
-
try:
|
|
7
|
-
return lst[idx]
|
|
8
|
-
except IndexError:
|
|
9
|
-
return default
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def find_index_in_list(my_list, target_string, default_index=-1):
|
|
13
|
-
try:
|
|
14
|
-
index = my_list.index(target_string)
|
|
15
|
-
return index
|
|
16
|
-
except ValueError:
|
|
17
|
-
return default_index
|