GameSentenceMiner 2.5.0__py3-none-any.whl → 2.5.1__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/anki.py CHANGED
@@ -233,8 +233,9 @@ def update_new_card():
233
233
  if get_config().obs.get_game_from_scene:
234
234
  obs.update_current_game()
235
235
  if use_prev_audio:
236
+ lines = get_utility_window().get_selected_lines()
236
237
  with util.lock:
237
- update_anki_card(last_card, note=get_initial_card_info(last_card, get_utility_window().get_selected_lines()), reuse_audio=True)
238
+ update_anki_card(last_card, note=get_initial_card_info(last_card, lines), reuse_audio=True)
238
239
  else:
239
240
  logger.info("New card(s) detected! Added to Processing Queue!")
240
241
  card_queue.append(last_card)
@@ -150,7 +150,7 @@ class VAD:
150
150
  selected_vad_model: str = SILERO
151
151
  backup_vad_model: str = OFF
152
152
  trim_beginning: bool = False
153
- beginning_offset: float = -0.5
153
+ beginning_offset: float = -0.25
154
154
  add_audio_on_no_results: bool = False
155
155
 
156
156
 
@@ -1,12 +1,14 @@
1
+ import json
2
+ import os
1
3
  import tkinter as tk
2
4
  from tkinter import ttk
3
5
 
4
- from GameSentenceMiner.configuration import logger
6
+ from GameSentenceMiner.configuration import logger, get_app_directory
7
+
5
8
 
6
9
  class UtilityApp:
7
10
  def __init__(self, root):
8
11
  self.root = root
9
-
10
12
  self.items = []
11
13
  self.checkboxes = []
12
14
  self.multi_mine_window = None # Store the multi-mine window reference
@@ -14,32 +16,60 @@ class UtilityApp:
14
16
 
15
17
  style = ttk.Style()
16
18
  style.configure("TCheckbutton", font=("Arial", 20)) # Change the font and size
19
+ self.config_file = os.path.join(get_app_directory(), "multi-mine-window-config.json")
20
+ self.load_window_config()
21
+
22
+
23
+ def save_window_config(self):
24
+ if self.multi_mine_window:
25
+ config = {
26
+ "x": self.multi_mine_window.winfo_x(),
27
+ "y": self.multi_mine_window.winfo_y(),
28
+ "width": self.multi_mine_window.winfo_width(),
29
+ "height": self.multi_mine_window.winfo_height()
30
+ }
31
+ print(config)
32
+ with open(self.config_file, "w") as f:
33
+ json.dump(config, f)
34
+
35
+ def load_window_config(self):
36
+ if os.path.exists(self.config_file):
37
+ with open(self.config_file, "r") as f:
38
+ config = json.load(f)
39
+ self.window_x = config.get("x", 100)
40
+ self.window_y = config.get("y", 100)
41
+ self.window_width = config.get("width", 800)
42
+ self.window_height = config.get("height", 400)
43
+ else:
44
+ self.window_x = 100
45
+ self.window_y = 100
46
+ self.window_width = 800
47
+ self.window_height = 400
17
48
 
18
- # def show(self):
19
- # if self.multi_mine_window is None or not tk.Toplevel.winfo_exists(self.multi_mine_window):
20
- # self.multi_mine_window = tk.Toplevel(self.root)
21
- # self.multi_mine_window.title("Multi-Mine Window")
22
- # self.update_multi_mine_window()
23
- #
24
49
  def show(self):
25
- """ Open the multi-mine window only if it doesn't exist. """
26
50
  if not self.multi_mine_window or not tk.Toplevel.winfo_exists(self.multi_mine_window):
27
- logger.info("opening multi-mine_window")
28
51
  self.multi_mine_window = tk.Toplevel(self.root)
29
52
  self.multi_mine_window.title("Multi Mine Window")
30
53
 
31
- self.multi_mine_window.minsize(800, 400) # Set a minimum size to prevent shrinking too
54
+ self.multi_mine_window.geometry(f"{self.window_width}x{self.window_height}+{self.window_x}+{self.window_y}")
55
+
56
+ self.multi_mine_window.minsize(800, 400)
32
57
 
33
58
  self.checkbox_frame = ttk.Frame(self.multi_mine_window)
34
59
  self.checkbox_frame.pack(padx=10, pady=10, fill="both", expand=True)
35
60
 
36
- # Add existing items
37
61
  for line, var in self.items:
38
62
  self.add_checkbox_to_gui(line, var)
63
+
64
+ self.multi_mine_window.protocol("WM_DELETE_WINDOW", self.on_close)
39
65
  else:
40
66
  self.multi_mine_window.deiconify()
41
67
  self.multi_mine_window.lift()
42
68
 
69
+ def on_close(self):
70
+ self.save_window_config()
71
+ self.multi_mine_window.withdraw()
72
+
43
73
  def add_text(self, line):
44
74
  if line.text:
45
75
  var = tk.BooleanVar()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.5.0
3
+ Version: 2.5.1
4
4
  Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -32,6 +32,7 @@ Requires-Dist: dataclasses_json~=0.6.7
32
32
  Requires-Dist: numpy
33
33
  Requires-Dist: pystray
34
34
  Requires-Dist: pywin32; sys_platform == "win32"
35
+ Dynamic: license-file
35
36
 
36
37
  # Game Sentence Miner
37
38
 
@@ -1,7 +1,7 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- GameSentenceMiner/anki.py,sha256=LzjQc2k81-6Bni2B6cVjGUlKxt7noHeUFYSUJGWNs0E,11473
2
+ GameSentenceMiner/anki.py,sha256=_jr6q3tOSP-7YGaY9cVz5v3508T_V2JINJjDYbp1YS0,11495
3
3
  GameSentenceMiner/config_gui.py,sha256=PzzLX-OwK71U5JSFaxup0ec0oWBWaF6AeCXs0m13HK0,56762
4
- GameSentenceMiner/configuration.py,sha256=dJi06CTJYJgYZQDBd2xQIRlIFiBhh5KPGk7TX7jNlYM,16037
4
+ GameSentenceMiner/configuration.py,sha256=kyvNCkZSZcqXbGjak8lb_GyhhjN8tIfb7eEfusz_M8A,16038
5
5
  GameSentenceMiner/electron_messaging.py,sha256=fBk9Ipo0jg2OZwYaKe1Qsm05P2ftrdTRGgFYob7ZA-k,139
6
6
  GameSentenceMiner/ffmpeg.py,sha256=2dwKbKxw_9sUXud67pPAx_6dGd1j-D99CdqLFVtbhSk,11479
7
7
  GameSentenceMiner/gametext.py,sha256=LORVdE2WEo1CDI8gonc7qxrhbS4KFKXFQVKjhlkpLbc,7368
@@ -11,7 +11,7 @@ GameSentenceMiner/notification.py,sha256=WeFodBsshhbOagcEfjAJ3kxjUGvBuUAQKEJ8Zf0
11
11
  GameSentenceMiner/obs.py,sha256=8ImXAVUWa4JdzwcBOEFShlZRZzh1dCvdpD1aEGhQfbU,6566
12
12
  GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,1250
13
13
  GameSentenceMiner/util.py,sha256=nmp2cmuBN0Azoc91f3zN_dZSh4nK9z21VTfpIbn8Tk4,4761
14
- GameSentenceMiner/utility_gui.py,sha256=yiacyduj_7AreOF93Dcqy4lSS8VVWv3QZxhxCMsbkgI,4764
14
+ GameSentenceMiner/utility_gui.py,sha256=VYuY8Br47AFak_zOVx9R1oUCBvoRjonDyE0oE6FVwJ0,5742
15
15
  GameSentenceMiner/downloader/Untitled_json.py,sha256=RUUl2bbbCpUDUUS0fP0tdvf5FngZ7ILdA_J5TFYAXUQ,15272
16
16
  GameSentenceMiner/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  GameSentenceMiner/downloader/download_tools.py,sha256=mI1u_FGBmBqDIpCH3jOv8DOoZ3obgP5pIf9o9SVfX2Q,8131
@@ -19,9 +19,9 @@ GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
19
19
  GameSentenceMiner/vad/silero_trim.py,sha256=-thDIZLuTLra3YBj7WR16Z6JeDgSpge2YuahprBvD8I,1585
20
20
  GameSentenceMiner/vad/vosk_helper.py,sha256=BI_mg_qyrjNbuEJjXSUDoV0FWEtQtEOAPmrrNixnZ_8,5974
21
21
  GameSentenceMiner/vad/whisper_helper.py,sha256=OF4J8TPPoKPJR1uFwrWAZ2Q7v0HJkVvNGmF8l1tACX0,3447
22
- gamesentenceminer-2.5.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
23
- gamesentenceminer-2.5.0.dist-info/METADATA,sha256=2xP65ECcypdDl8FLVD-oMJqXRgwEBDcJG0v-l-R_KYE,5387
24
- gamesentenceminer-2.5.0.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
25
- gamesentenceminer-2.5.0.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
26
- gamesentenceminer-2.5.0.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
27
- gamesentenceminer-2.5.0.dist-info/RECORD,,
22
+ gamesentenceminer-2.5.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
23
+ gamesentenceminer-2.5.1.dist-info/METADATA,sha256=OjwqqaJ_DG7FR6OLc3z1XlUX6WH6SqsOc4EDXUjbzbQ,5409
24
+ gamesentenceminer-2.5.1.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
25
+ gamesentenceminer-2.5.1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
26
+ gamesentenceminer-2.5.1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
27
+ gamesentenceminer-2.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (77.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5