ok-script 0.0.60__tar.gz → 0.0.62__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.60 → ok-script-0.0.62}/PKG-INFO +1 -1
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/OK.py +2 -1
- ok-script-0.0.62/ok/firebase/FireBaseAnalytics.py +120 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/App.py +2 -2
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/MainWindow.py +2 -2
- ok-script-0.0.62/ok/gui/debug/DebugTab.py +92 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/task/TaskExecutor.py +3 -0
- ok-script-0.0.62/ok/util/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok_script.egg-info/PKG-INFO +1 -1
- {ok-script-0.0.60 → ok-script-0.0.62}/ok_script.egg-info/SOURCES.txt +2 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/setup.py +1 -1
- ok-script-0.0.60/ok/gui/debug/DebugTab.py +0 -53
- {ok-script-0.0.60 → ok-script-0.0.62}/README.md +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/HwndWindow.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/ADBCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/DeviceManager.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/WindowsCaptureFactory.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/targets.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/adb/vbox.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/BaseWindowsCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/BitBltCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/DesktopDuplicationCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/dump.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/color/Color.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/color/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/config/Config.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/config/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/feature/Box.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/feature/FeatureSet.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/feature/FindFeature.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.60/ok/gui/about → ok-script-0.0.62/ok/firebase}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/Communicate.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/MessageWindow.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/about/AboutTab.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/about/VersionCard.py +0 -0
- {ok-script-0.0.60/ok/gui/common → ok-script-0.0.62/ok/gui/about}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.60/ok/gui/debug → ok-script-0.0.62/ok/gui/common}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/debug/LoggerWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.60/ok/gui/i18n → ok-script-0.0.62/ok/gui/debug}/__init__.py +0 -0
- {ok-script-0.0.60/ok/gui/icon → ok-script-0.0.62/ok/gui/i18n}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.60/ok/gui/overlay → ok-script-0.0.62/ok/gui/icon}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.60/ok/gui/qss → ok-script-0.0.62/ok/gui/overlay}/__init__.py +0 -0
- {ok-script-0.0.60/ok/gui/settings → ok-script-0.0.62/ok/gui/qss}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/resources.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.60/ok/gui/start → ok-script-0.0.62/ok/gui/settings}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/start/SelectHwndWindow.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/start/StartCard.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/start/StartTab.py +0 -0
- {ok-script-0.0.60/ok/gui/tasks → ok-script-0.0.62/ok/gui/start}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/StartButton.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/TaskCard.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.60/ok/gui/util → ok-script-0.0.62/ok/gui/tasks}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/util/Alert.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.60/ok/gui/widget → ok-script-0.0.62/ok/gui/util}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/EmptyCard.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/Tab.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.60/ok/interaction → ok-script-0.0.62/ok/gui/widget}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/interaction/ADBInteraction.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/interaction/BaseInteraction.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/interaction/Win32Interaction.py +0 -0
- {ok-script-0.0.60/ok/logging → ok-script-0.0.62/ok/interaction}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.60/ok/ocr → ok-script-0.0.62/ok/logging}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/ocr/OCR.py +0 -0
- {ok-script-0.0.60/ok/rotypes/Windows/Media → ok-script-0.0.62/ok/ocr}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.60/ok/rotypes/Windows/Security → ok-script-0.0.62/ok/rotypes/Windows/Media}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.60/ok/rotypes/Windows/Storage → ok-script-0.0.62/ok/rotypes/Windows/Security}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.60/ok/rotypes/Windows → ok-script-0.0.62/ok/rotypes/Windows/Storage}/__init__.py +0 -0
- {ok-script-0.0.60/ok/save → ok-script-0.0.62/ok/rotypes/Windows}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.60/ok/scene → ok-script-0.0.62/ok/save}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.60/ok/stats → ok-script-0.0.62/ok/scene}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.60/ok/task → ok-script-0.0.62/ok/stats}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/task/BaseTask.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/task/ExecutorOperation.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/task/OneTimeTask.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/task/TriggerTask.py +0 -0
- {ok-script-0.0.60/ok/update → ok-script-0.0.62/ok/task}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/update/GithubMultiDownloader.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/update/Updater.py +0 -0
- {ok-script-0.0.60/ok/util → ok-script-0.0.62/ok/update}/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/update/gen_md5.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/Handler.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/json.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/list.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/path.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/thread.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok/util/yaml.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/setup.cfg +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/tests/__init__.py +0 -0
- {ok-script-0.0.60 → ok-script-0.0.62}/tests/test_updater.py +0 -0
|
@@ -30,6 +30,7 @@ class OK:
|
|
|
30
30
|
|
|
31
31
|
def __init__(self, config: Dict[str, Any]):
|
|
32
32
|
print(f"AutoHelper init, config: {config}")
|
|
33
|
+
config["config_folder"] = config.get("config_folder") or 'configs'
|
|
33
34
|
config_logger(config)
|
|
34
35
|
logger.info(f"AutoHelper init, config: {config}")
|
|
35
36
|
ok.gui.ok = self
|
|
@@ -113,7 +114,7 @@ class OK:
|
|
|
113
114
|
trigger_tasks=self.config.get('trigger_tasks', []),
|
|
114
115
|
scenes=self.config['scenes'],
|
|
115
116
|
feature_set=self.feature_set,
|
|
116
|
-
ocr=self.ocr, config_folder=self.config.get("config_folder")
|
|
117
|
+
ocr=self.ocr, config_folder=self.config.get("config_folder"))
|
|
117
118
|
|
|
118
119
|
if self.app:
|
|
119
120
|
ok.gui.executor = self.task_executor
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import uuid
|
|
3
|
+
|
|
4
|
+
import requests
|
|
5
|
+
import wmi
|
|
6
|
+
|
|
7
|
+
from ok.config.Config import Config
|
|
8
|
+
from ok.logging.Logger import get_logger
|
|
9
|
+
from ok.util.Handler import Handler
|
|
10
|
+
|
|
11
|
+
FIREBASE_ENDPOINT = 'https://www.google-analytics.com/mp/collect'
|
|
12
|
+
|
|
13
|
+
logger = get_logger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class FireBaseAnalytics:
|
|
17
|
+
def __init__(self, app_config, exit_event):
|
|
18
|
+
self.measurement_id = app_config.get('firebase').get('measurement_id')
|
|
19
|
+
self.api_secret = app_config.get('firebase').get('api_secret')
|
|
20
|
+
self.app_config = app_config
|
|
21
|
+
self._config = None
|
|
22
|
+
self._handler = Handler(exit_event, __name__)
|
|
23
|
+
self._handler.post(self.report_open, 10)
|
|
24
|
+
self._user_properties = None
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def user_properties(self):
|
|
28
|
+
if self._user_properties is None:
|
|
29
|
+
c = wmi.WMI()
|
|
30
|
+
|
|
31
|
+
# Get OS information
|
|
32
|
+
os_info = c.Win32_OperatingSystem()[0]
|
|
33
|
+
os_version = os_info.Version.split(".")[0]
|
|
34
|
+
os_build = int(os_info.BuildNumber)
|
|
35
|
+
|
|
36
|
+
if os_version == "10" and os_build >= 22000: # Windows 11 starts from build 22000
|
|
37
|
+
os_version = "11"
|
|
38
|
+
|
|
39
|
+
# Get CPU information
|
|
40
|
+
cpu_info = c.Win32_Processor()[0]
|
|
41
|
+
cpu_name = cpu_info.Name.strip()
|
|
42
|
+
|
|
43
|
+
# Get total memory (in GB)
|
|
44
|
+
total_memory = float(os_info.TotalVisibleMemorySize) / 1048576 # KB to GB
|
|
45
|
+
|
|
46
|
+
# Get graphics card information
|
|
47
|
+
gpu_info = c.Win32_VideoController()
|
|
48
|
+
gpu_name = None
|
|
49
|
+
for gpu in reversed(gpu_info):
|
|
50
|
+
if "intel" not in gpu.Name.lower() and "microsoft" not in gpu.Name.lower():
|
|
51
|
+
gpu_name = gpu.Name
|
|
52
|
+
break
|
|
53
|
+
if not gpu_name and gpu_info:
|
|
54
|
+
gpu_name = gpu_info[0].Name
|
|
55
|
+
|
|
56
|
+
# Put the information into a dictionary
|
|
57
|
+
self._user_properties = {
|
|
58
|
+
"os": 'windows',
|
|
59
|
+
"os_version": os_version,
|
|
60
|
+
"os_build": os_build,
|
|
61
|
+
"cpu": cpu_name,
|
|
62
|
+
"memory": int(total_memory),
|
|
63
|
+
"gpu": gpu_name
|
|
64
|
+
}
|
|
65
|
+
return self._user_properties
|
|
66
|
+
|
|
67
|
+
def report_open(self):
|
|
68
|
+
logger.debug(f'send app_open {self.user_properties}')
|
|
69
|
+
self.send_event('app_open')
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def client_id(self):
|
|
73
|
+
if self._config is None:
|
|
74
|
+
self._config = Config({}, self.app_config.get("config_folder") or "config", 'statistics')
|
|
75
|
+
if not self._config.get('client_id'):
|
|
76
|
+
self._config['client_id'] = get_unique_client_id()
|
|
77
|
+
return self._config.get('client_id')
|
|
78
|
+
|
|
79
|
+
def send_event(self, event_name, params=None):
|
|
80
|
+
if params is None:
|
|
81
|
+
params = dict()
|
|
82
|
+
payload = {
|
|
83
|
+
'client_id': self.client_id,
|
|
84
|
+
'events': [
|
|
85
|
+
{
|
|
86
|
+
'name': event_name,
|
|
87
|
+
'params': params
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
'user_properties': self.user_properties
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
headers = {
|
|
94
|
+
'Content-Type': 'application/json'
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
response = requests.post(
|
|
98
|
+
f'{FIREBASE_ENDPOINT}?measurement_id={self.measurement_id}&api_secret={self.api_secret}',
|
|
99
|
+
data=json.dumps(payload),
|
|
100
|
+
headers=headers
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
if response.status_code == 204:
|
|
104
|
+
logger.debug(f'Successfully sent event: {event_name}')
|
|
105
|
+
else:
|
|
106
|
+
logger.debug(f'Failed to send event: {response.status_code} - {response.text}')
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def get_unique_client_id():
|
|
110
|
+
return str(uuid.uuid4())
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if __name__ == '__main__':
|
|
114
|
+
# Generate a unique client ID (UUID)
|
|
115
|
+
client_id = str(uuid.uuid4())
|
|
116
|
+
analytics = FireBaseAnalytics('G-9W3F3EQ19G', api_secret='eAkNmhrERiGg8Q3Riuxerw')
|
|
117
|
+
# Send a test event
|
|
118
|
+
analytics.send_event('app_open')
|
|
119
|
+
analytics.send_event('test1')
|
|
120
|
+
analytics.send_event('test2')
|
|
@@ -83,8 +83,8 @@ class App:
|
|
|
83
83
|
self.show_message_window(title, content)
|
|
84
84
|
|
|
85
85
|
def show_main_window(self):
|
|
86
|
-
self.main_window = MainWindow(self.icon, self.title, self.version, self.overlay, self.about,
|
|
87
|
-
|
|
86
|
+
self.main_window = MainWindow(self.config, self.icon, self.title, self.version, self.overlay, self.about,
|
|
87
|
+
self.exit_event)
|
|
88
88
|
# Set the window title here
|
|
89
89
|
self.main_window.setWindowIcon(self.icon)
|
|
90
90
|
if self.overlay and ok.gui.device_manager.hwnd is not None:
|
|
@@ -21,7 +21,7 @@ class Communicate(QObject):
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
class MainWindow(MSFluentWindow):
|
|
24
|
-
def __init__(self, icon, title, version, debug=False, about=None, exit_event=None):
|
|
24
|
+
def __init__(self, config, icon, title, version, debug=False, about=None, exit_event=None):
|
|
25
25
|
super().__init__()
|
|
26
26
|
self.exit_event = exit_event
|
|
27
27
|
self.start_tab = StartTab()
|
|
@@ -43,7 +43,7 @@ class MainWindow(MSFluentWindow):
|
|
|
43
43
|
# self.addSubInterface(debug_tab, FluentIcon.COMMAND_PROMPT, self.tr('Debug'))
|
|
44
44
|
# ... Add other tabs similarly
|
|
45
45
|
if debug:
|
|
46
|
-
debug_tab = DebugTab(exit_event)
|
|
46
|
+
debug_tab = DebugTab(config, exit_event)
|
|
47
47
|
self.addSubInterface(debug_tab, FluentIcon.DEVELOPER_TOOLS, self.tr('Debug'),
|
|
48
48
|
position=NavigationItemPosition.BOTTOM)
|
|
49
49
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
from PySide6.QtWidgets import QWidget, QFileDialog
|
|
4
|
+
from qfluentwidgets import PushButton, FlowLayout, ComboBox
|
|
5
|
+
|
|
6
|
+
import ok.gui
|
|
7
|
+
from ok.capture.windows.dump import dump_threads
|
|
8
|
+
from ok.config.Config import Config
|
|
9
|
+
from ok.gui.widget.Tab import Tab
|
|
10
|
+
from ok.logging.Logger import get_logger
|
|
11
|
+
from ok.util.Handler import Handler
|
|
12
|
+
|
|
13
|
+
logger = get_logger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class DebugTab(Tab):
|
|
17
|
+
def __init__(self, app_config, exit_event):
|
|
18
|
+
super().__init__()
|
|
19
|
+
|
|
20
|
+
self.config = Config({'target_task': None, 'target_image': None, 'target_function': None},
|
|
21
|
+
app_config.get('config_folder'), 'debug')
|
|
22
|
+
tool_widget = QWidget()
|
|
23
|
+
layout = FlowLayout(tool_widget, False)
|
|
24
|
+
|
|
25
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
26
|
+
layout.setVerticalSpacing(20)
|
|
27
|
+
layout.setHorizontalSpacing(10)
|
|
28
|
+
self.handler = Handler(exit_event, "DebugTab")
|
|
29
|
+
|
|
30
|
+
self.addCard(self.tr("Debug Tool"), tool_widget)
|
|
31
|
+
|
|
32
|
+
dump_button = PushButton(self.tr("Dump Threads(HotKey:Ctrl+Alt+D)"))
|
|
33
|
+
dump_button.clicked.connect(lambda: self.handler.post(dump_threads))
|
|
34
|
+
layout.addWidget(dump_button)
|
|
35
|
+
|
|
36
|
+
capture_button = PushButton(self.tr("Capture Screenshot"))
|
|
37
|
+
capture_button.clicked.connect(lambda: self.handler.post(self.capture))
|
|
38
|
+
layout.addWidget(capture_button)
|
|
39
|
+
|
|
40
|
+
open_log_folder = PushButton(self.tr("Open Logs"))
|
|
41
|
+
|
|
42
|
+
call_task_widget = QWidget()
|
|
43
|
+
call_task_layout = FlowLayout(call_task_widget, False)
|
|
44
|
+
self.addCard(self.tr("Debug Task Function"), call_task_widget)
|
|
45
|
+
|
|
46
|
+
self.select_screenshot_button = PushButton(
|
|
47
|
+
self.config.get('target_image') or self.tr("Drop or Select Screenshot"))
|
|
48
|
+
self.select_screenshot_button.clicked.connect(lambda: self.handler.post(self.select_screenshot))
|
|
49
|
+
call_task_layout.addWidget(self.select_screenshot_button)
|
|
50
|
+
|
|
51
|
+
self.tasks_combo_box = ComboBox()
|
|
52
|
+
call_task_layout.addWidget(self.tasks_combo_box)
|
|
53
|
+
tasks = ok.gui.executor.get_all_tasks()
|
|
54
|
+
class_names = [obj.__class__.__name__ for obj in tasks]
|
|
55
|
+
self.tasks_combo_box.addItems(class_names)
|
|
56
|
+
self.tasks_combo_box.currentTextChanged.connect(self.task_changed)
|
|
57
|
+
if self.config.get('target_task') in class_names:
|
|
58
|
+
self.tasks_combo_box.setText(self.config.get('target_task'))
|
|
59
|
+
else:
|
|
60
|
+
self.tasks_combo_box.setCurrentIndex(0)
|
|
61
|
+
|
|
62
|
+
def task_changed(self, text):
|
|
63
|
+
self.config['target_task'] = text
|
|
64
|
+
|
|
65
|
+
def select_screenshot(self):
|
|
66
|
+
file_name, _ = QFileDialog.getOpenFileName(None, "Open Image", "", "Image Files (*.png *.jpg *.bmp)")
|
|
67
|
+
|
|
68
|
+
if file_name:
|
|
69
|
+
logger.info(f"Selected files: {file_name}")
|
|
70
|
+
self.select_screenshot_button.setText(file_name)
|
|
71
|
+
self.config['target_image'] = file_name
|
|
72
|
+
else:
|
|
73
|
+
self.select_screenshot_button.setText(self.tr("Drop or Select Screenshot"))
|
|
74
|
+
self.config['target_image'] = None
|
|
75
|
+
|
|
76
|
+
def capture(self):
|
|
77
|
+
if ok.gui.device_manager.capture_method is not None:
|
|
78
|
+
logger.info(f'ok.gui.device_manager.capture_method {ok.gui.device_manager.capture_method}')
|
|
79
|
+
capture = str(ok.gui.device_manager.capture_method)
|
|
80
|
+
frame = ok.gui.device_manager.capture_method.do_get_frame()
|
|
81
|
+
if frame is not None:
|
|
82
|
+
file_path = ok.gui.ok.screenshot.generate_screen_shot(frame, ok.gui.ok.screenshot.ui_dict,
|
|
83
|
+
ok.gui.ok.screenshot.screenshot_folder, capture)
|
|
84
|
+
|
|
85
|
+
# Use subprocess.Popen to open the file explorer and select the file
|
|
86
|
+
subprocess.Popen(r'explorer /select,"{}"'.format(file_path))
|
|
87
|
+
logger.info(f'captured screenshot: {capture}')
|
|
88
|
+
self.alert_info(self.tr('Capture Success'))
|
|
89
|
+
else:
|
|
90
|
+
self.alert_error(self.tr('Capture returned None'))
|
|
91
|
+
else:
|
|
92
|
+
self.alert_error(self.tr('No Capture Available or Selected'))
|
|
File without changes
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import subprocess
|
|
2
|
-
|
|
3
|
-
from PySide6.QtWidgets import QWidget
|
|
4
|
-
from qfluentwidgets import PushButton, FlowLayout
|
|
5
|
-
|
|
6
|
-
import ok.gui
|
|
7
|
-
from ok.capture.windows.dump import dump_threads
|
|
8
|
-
from ok.gui.widget.Tab import Tab
|
|
9
|
-
from ok.logging.Logger import get_logger
|
|
10
|
-
from ok.util.Handler import Handler
|
|
11
|
-
|
|
12
|
-
logger = get_logger(__name__)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class DebugTab(Tab):
|
|
16
|
-
def __init__(self, exit_event):
|
|
17
|
-
super().__init__()
|
|
18
|
-
widget = QWidget()
|
|
19
|
-
layout = FlowLayout(widget, False)
|
|
20
|
-
|
|
21
|
-
layout.setContentsMargins(0, 0, 0, 0)
|
|
22
|
-
layout.setVerticalSpacing(20)
|
|
23
|
-
layout.setHorizontalSpacing(10)
|
|
24
|
-
self.addWidget(widget)
|
|
25
|
-
self.handler = Handler(exit_event, "DebugTab")
|
|
26
|
-
|
|
27
|
-
dump_button = PushButton(self.tr("Dump Threads(HotKey:Ctrl+Alt+D)"))
|
|
28
|
-
dump_button.clicked.connect(lambda: self.handler.post(dump_threads))
|
|
29
|
-
layout.addWidget(dump_button)
|
|
30
|
-
|
|
31
|
-
capture_button = PushButton(self.tr("Capture Screenshot"))
|
|
32
|
-
capture_button.clicked.connect(lambda: self.handler.post(self.capture))
|
|
33
|
-
layout.addWidget(capture_button)
|
|
34
|
-
|
|
35
|
-
open_log_folder = PushButton(self.tr("Open Logs"))
|
|
36
|
-
|
|
37
|
-
def capture(self):
|
|
38
|
-
if ok.gui.device_manager.capture_method is not None:
|
|
39
|
-
logger.info(f'ok.gui.device_manager.capture_method {ok.gui.device_manager.capture_method}')
|
|
40
|
-
capture = str(ok.gui.device_manager.capture_method)
|
|
41
|
-
frame = ok.gui.device_manager.capture_method.do_get_frame()
|
|
42
|
-
if frame is not None:
|
|
43
|
-
file_path = ok.gui.ok.screenshot.generate_screen_shot(frame, ok.gui.ok.screenshot.ui_dict,
|
|
44
|
-
ok.gui.ok.screenshot.screenshot_folder, capture)
|
|
45
|
-
|
|
46
|
-
# Use subprocess.Popen to open the file explorer and select the file
|
|
47
|
-
subprocess.Popen(r'explorer /select,"{}"'.format(file_path))
|
|
48
|
-
logger.info(f'captured screenshot: {capture}')
|
|
49
|
-
self.alert_info(self.tr('Capture Success'))
|
|
50
|
-
else:
|
|
51
|
-
self.alert_error(self.tr('Capture returned None'))
|
|
52
|
-
else:
|
|
53
|
-
self.alert_error(self.tr('No Capture Available or Selected'))
|
|
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
|
|
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.60 → ok-script-0.0.62}/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
|
{ok-script-0.0.60/ok/rotypes/Windows → ok-script-0.0.62/ok/rotypes/Windows/Storage}/__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
|