GameSentenceMiner 2.4.1.dev1__py3-none-any.whl → 2.4.3__py3-none-any.whl
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.
- GameSentenceMiner/config_gui.py +1 -35
- GameSentenceMiner/configuration.py +0 -1
- GameSentenceMiner/downloader/download_tools.py +31 -31
- GameSentenceMiner/gsm.py +0 -2
- GameSentenceMiner/{package_updater.py → package.py} +0 -2
- GameSentenceMiner/vad/vosk_helper.py +4 -4
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/RECORD +12 -12
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/LICENSE +0 -0
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/top_level.txt +0 -0
GameSentenceMiner/config_gui.py
CHANGED
@@ -4,9 +4,9 @@ from tkinter import filedialog, messagebox, simpledialog
|
|
4
4
|
import pyperclip
|
5
5
|
import ttkbootstrap as ttk
|
6
6
|
|
7
|
-
from GameSentenceMiner.package_updater import check_for_updates, get_latest_version, get_current_version
|
8
7
|
from GameSentenceMiner import obs, configuration
|
9
8
|
from GameSentenceMiner.configuration import *
|
9
|
+
from GameSentenceMiner.package import get_current_version, get_latest_version
|
10
10
|
|
11
11
|
settings_saved = False
|
12
12
|
on_save = []
|
@@ -95,25 +95,6 @@ class ConfigApp:
|
|
95
95
|
if self.window is not None:
|
96
96
|
self.window.withdraw()
|
97
97
|
|
98
|
-
def update_now(self):
|
99
|
-
update_available, version = check_for_updates()
|
100
|
-
if update_available:
|
101
|
-
messagebox.showinfo("Update", "GSM Will Copy the Update Command to your clipboard, please run it in a terminal.")
|
102
|
-
pyperclip.copy("pip install --upgrade GameSentenceMiner")
|
103
|
-
self.on_exit(None, None)
|
104
|
-
else:
|
105
|
-
messagebox.showinfo("No Update Found", "No update found.")
|
106
|
-
|
107
|
-
def check_update(self, show_no_update=False):
|
108
|
-
update_available, version = check_for_updates()
|
109
|
-
if update_available:
|
110
|
-
self.latest_version.config(text=version)
|
111
|
-
should_update = messagebox.askyesno("Update Found", "Update Found, would you like to update now?")
|
112
|
-
if should_update:
|
113
|
-
self.update_now()
|
114
|
-
elif show_no_update:
|
115
|
-
messagebox.showinfo("No Update Found", "No update found.")
|
116
|
-
|
117
98
|
def save_settings(self, profile_change=False):
|
118
99
|
global settings_saved
|
119
100
|
|
@@ -123,7 +104,6 @@ class ConfigApp:
|
|
123
104
|
use_websocket=self.websocket_enabled.get(),
|
124
105
|
websocket_uri=self.websocket_uri.get(),
|
125
106
|
open_config_on_startup=self.open_config_on_startup.get(),
|
126
|
-
check_for_update_on_startup=self.check_for_update_on_startup.get(),
|
127
107
|
texthook_replacement_regex=self.texthook_replacement_regex.get()
|
128
108
|
),
|
129
109
|
paths=Paths(
|
@@ -295,13 +275,6 @@ class ConfigApp:
|
|
295
275
|
self.add_label_and_increment_row(general_frame, "Whether to open config when the script starts.",
|
296
276
|
row=self.current_row, column=2)
|
297
277
|
|
298
|
-
ttk.Label(general_frame, text="Check for Updates On Startup:").grid(row=self.current_row, column=0, sticky='W')
|
299
|
-
self.check_for_update_on_startup = tk.BooleanVar(value=self.settings.general.check_for_update_on_startup)
|
300
|
-
ttk.Checkbutton(general_frame, variable=self.check_for_update_on_startup).grid(row=self.current_row, column=1,
|
301
|
-
sticky='W')
|
302
|
-
self.add_label_and_increment_row(general_frame, "Always check for Updates On Startup.",
|
303
|
-
row=self.current_row, column=2)
|
304
|
-
|
305
278
|
ttk.Label(general_frame, text="Current Version:").grid(row=self.current_row, column=0, sticky='W')
|
306
279
|
self.current_version = ttk.Label(general_frame, text=get_current_version())
|
307
280
|
self.current_version.grid(row=self.current_row, column=1)
|
@@ -314,13 +287,6 @@ class ConfigApp:
|
|
314
287
|
self.add_label_and_increment_row(general_frame, "The latest available version of the application.",
|
315
288
|
row=self.current_row, column=2)
|
316
289
|
|
317
|
-
ttk.Button(general_frame, text="Check Update", command=lambda: self.check_update(True)).grid(row=self.current_row, column=0,
|
318
|
-
pady=5)
|
319
|
-
ttk.Button(general_frame, text="Update Now", command=self.update_now).grid(row=self.current_row, column=1,
|
320
|
-
pady=5)
|
321
|
-
self.add_label_and_increment_row(general_frame, "Check for updates or update to the latest version.",
|
322
|
-
row=self.current_row, column=2)
|
323
|
-
|
324
290
|
# ttk.Label(general_frame, text="Per Scene Config:").grid(row=self.current_row, column=0, sticky='W')
|
325
291
|
# self.per_scene_config = tk.BooleanVar(value=self.master_config.per_scene_config)
|
326
292
|
# ttk.Checkbutton(general_frame, variable=self.per_scene_config).grid(row=self.current_row, column=1,
|
@@ -67,37 +67,37 @@ def download_obs_if_needed():
|
|
67
67
|
with zipfile.ZipFile(obs_installer, 'r') as zip_ref:
|
68
68
|
zip_ref.extractall(obs_path)
|
69
69
|
open(os.path.join(obs_path, "portable_mode"), 'a').close()
|
70
|
-
websocket_config_path = os.path.join(obs_path, 'config', 'obs-studio')
|
71
|
-
if not copy_obs_settings(os.path.join(os.getenv('APPDATA'), 'obs-studio'), websocket_config_path):
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
70
|
+
# websocket_config_path = os.path.join(obs_path, 'config', 'obs-studio')
|
71
|
+
# if not copy_obs_settings(os.path.join(os.getenv('APPDATA'), 'obs-studio'), websocket_config_path):
|
72
|
+
websocket_config_path = os.path.join(obs_path, 'config', 'obs-studio', 'plugin_config', 'obs-websocket')
|
73
|
+
os.makedirs(websocket_config_path, exist_ok=True)
|
74
|
+
|
75
|
+
websocket_config = {
|
76
|
+
"alerts_enabled": False,
|
77
|
+
"auth_required": False,
|
78
|
+
"first_load": False,
|
79
|
+
"server_enabled": True,
|
80
|
+
"server_password": secrets.token_urlsafe(16),
|
81
|
+
"server_port": 7274
|
82
|
+
}
|
83
|
+
with open(os.path.join(websocket_config_path, 'config.json'), 'w') as config_file:
|
84
|
+
json.dump(websocket_config, config_file, indent=4)
|
85
|
+
basic_ini_path = os.path.join(obs_path, 'config', 'obs-studio', 'basic', 'profiles', 'Untitled')
|
86
|
+
os.makedirs(basic_ini_path, exist_ok=True)
|
87
|
+
with open(os.path.join(basic_ini_path, 'basic.ini'), 'w') as basic_ini_file:
|
88
|
+
basic_ini_file.write(
|
89
|
+
"[SimpleOutput]\n"
|
90
|
+
f"FilePath={os.path.expanduser('~')}/Videos/GSM\n"
|
91
|
+
"RecRB=true\n"
|
92
|
+
"RecRBTime=60\n"
|
93
|
+
"RecRBSize=512\n"
|
94
|
+
"RecRBPrefix=GSM\n"
|
95
|
+
"RecAudioEncoder=opus\n"
|
96
|
+
)
|
97
|
+
scene_json_path = os.path.join(obs_path, 'config', 'obs-studio', 'basic', 'scenes')
|
98
|
+
os.makedirs(scene_json_path, exist_ok=True)
|
99
|
+
with open(os.path.join(scene_json_path, 'Untitled.json'), 'w') as scene_file:
|
100
|
+
scene_file.write(scenes)
|
101
101
|
logger.info(f"OBS extracted to {obs_path}.")
|
102
102
|
else:
|
103
103
|
logger.error(f"Please install OBS manually from {obs_installer}")
|
GameSentenceMiner/gsm.py
CHANGED
@@ -463,8 +463,6 @@ def main(reloading=False, do_config_input=True):
|
|
463
463
|
win32api.SetConsoleCtrlHandler(handle_exit())
|
464
464
|
|
465
465
|
try:
|
466
|
-
if get_config().general.check_for_update_on_startup:
|
467
|
-
root.after(0, settings_window.check_update)
|
468
466
|
if get_config().general.open_config_on_startup:
|
469
467
|
root.after(0, settings_window.show)
|
470
468
|
settings_window.add_save_hook(update_icon)
|
@@ -19,12 +19,12 @@ vosk_model = None
|
|
19
19
|
# Function to download and cache the Vosk model
|
20
20
|
def download_and_cache_vosk_model(model_dir="vosk_model_cache"):
|
21
21
|
# Ensure the cache directory exists
|
22
|
-
if not os.path.exists(model_dir):
|
23
|
-
os.makedirs(model_dir)
|
22
|
+
if not os.path.exists(os.path.join(get_app_directory(), model_dir)):
|
23
|
+
os.makedirs(os.path.join(get_app_directory(), model_dir))
|
24
24
|
|
25
25
|
# Extract the model name from the URL
|
26
26
|
model_filename = get_config().vad.vosk_url.split("/")[-1]
|
27
|
-
model_path = os.path.join(model_dir, model_filename)
|
27
|
+
model_path = os.path.join(get_app_directory(), model_dir, model_filename)
|
28
28
|
|
29
29
|
# If the model is already downloaded, skip the download
|
30
30
|
if not os.path.exists(model_path):
|
@@ -38,7 +38,7 @@ def download_and_cache_vosk_model(model_dir="vosk_model_cache"):
|
|
38
38
|
logger.info("Download complete.")
|
39
39
|
|
40
40
|
# Extract the model if it's a zip or tar file
|
41
|
-
model_extract_path = os.path.join(model_dir, "vosk_model")
|
41
|
+
model_extract_path = os.path.join(get_app_directory(), model_dir, "vosk_model")
|
42
42
|
if not os.path.exists(model_extract_path):
|
43
43
|
logger.info("Extracting the Vosk model...")
|
44
44
|
if model_filename.endswith(".zip"):
|
@@ -1,26 +1,26 @@
|
|
1
1
|
GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
GameSentenceMiner/anki.py,sha256=QBrA-WVQfK4KjKB2Wm1WDW7BlVy8MF6-1ByTApVzPVA,10576
|
3
|
-
GameSentenceMiner/config_gui.py,sha256=
|
4
|
-
GameSentenceMiner/configuration.py,sha256=
|
3
|
+
GameSentenceMiner/config_gui.py,sha256=RCZJwg5FQpx_J-8jS7v54ivKPBkjicHKpmzN2zh9yAA,51975
|
4
|
+
GameSentenceMiner/configuration.py,sha256=fQNBQjmJn2ViBSYMFNuyC5CSklBk0xgMDSXC47CwDe0,14463
|
5
5
|
GameSentenceMiner/ffmpeg.py,sha256=4nyl_kdXi_trzDyhhjSmszN0BlFF-McAFyOghvCyl34,11142
|
6
6
|
GameSentenceMiner/gametext.py,sha256=AkK77s_orZrWYEZEDDN9V8vvwiyt_YKAlWS4hhYXUx4,8928
|
7
|
-
GameSentenceMiner/gsm.py,sha256=
|
7
|
+
GameSentenceMiner/gsm.py,sha256=t6hGJZKfMgiwgYUy7zWHlfmwyyLD-_eOEBeiTPpMFxk,19331
|
8
8
|
GameSentenceMiner/model.py,sha256=oh8VVT8T1UKekbmP6MGNgQ8jIuQ_7Rg4GPzDCn2kJo8,1999
|
9
9
|
GameSentenceMiner/notification.py,sha256=WBaQWoPNhW4XqdPBUmxPBgjk0ngzH_4v9zMQ-XQAKC8,2010
|
10
10
|
GameSentenceMiner/obs.py,sha256=8ImXAVUWa4JdzwcBOEFShlZRZzh1dCvdpD1aEGhQfbU,6566
|
11
|
-
GameSentenceMiner/
|
11
|
+
GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,1250
|
12
12
|
GameSentenceMiner/util.py,sha256=MITweiFYaefWQF5nR8tZ9yE6vd_b-fLuP0MP1Y1U4K0,4720
|
13
13
|
GameSentenceMiner/utility_gui.py,sha256=EtQUnCgTTdzKJE0iCJiHjjc_c6tc7JtI09LRg4_iy8Y,4555
|
14
14
|
GameSentenceMiner/downloader/Untitled_json.py,sha256=RUUl2bbbCpUDUUS0fP0tdvf5FngZ7ILdA_J5TFYAXUQ,15272
|
15
15
|
GameSentenceMiner/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
GameSentenceMiner/downloader/download_tools.py,sha256=
|
16
|
+
GameSentenceMiner/downloader/download_tools.py,sha256=584QVsv-btpJowMRrqSbWpKDCMhInQM0iGe-Yw0Q2p0,6298
|
17
17
|
GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
GameSentenceMiner/vad/silero_trim.py,sha256=syDJX_KbFmdyFFtnQqYTD0tICsUCJizYhs-atPgXtxA,1549
|
19
|
-
GameSentenceMiner/vad/vosk_helper.py,sha256
|
19
|
+
GameSentenceMiner/vad/vosk_helper.py,sha256=HifeXKbEMrs81ZuuGxS67yAghu8TMXUP6Oan9i9dTxw,5938
|
20
20
|
GameSentenceMiner/vad/whisper_helper.py,sha256=bpR1HVnJRn9H5u8XaHBqBJ6JwIjzqn-Fajps8QmQ4zc,3411
|
21
|
-
gamesentenceminer-2.4.
|
22
|
-
gamesentenceminer-2.4.
|
23
|
-
gamesentenceminer-2.4.
|
24
|
-
gamesentenceminer-2.4.
|
25
|
-
gamesentenceminer-2.4.
|
26
|
-
gamesentenceminer-2.4.
|
21
|
+
gamesentenceminer-2.4.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
22
|
+
gamesentenceminer-2.4.3.dist-info/METADATA,sha256=66Gl-pWPnznGHiLO23WIcsxwj7xdtONTsaQZ_E-Kltc,10395
|
23
|
+
gamesentenceminer-2.4.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
24
|
+
gamesentenceminer-2.4.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
25
|
+
gamesentenceminer-2.4.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
26
|
+
gamesentenceminer-2.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{gamesentenceminer-2.4.1.dev1.dist-info → gamesentenceminer-2.4.3.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|