GameSentenceMiner 2.5.3__py3-none-any.whl → 2.5.5__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
@@ -78,7 +78,7 @@ def update_anki_card(last_note: AnkiCard, note=None, audio_path='', video_path='
78
78
  invoke("addTags", tags=tag_string, notes=[last_note.noteId])
79
79
  logger.info(f"UPDATED ANKI CARD FOR {last_note.noteId}")
80
80
  if get_config().features.notify_on_update:
81
- notification.send_notification(tango)
81
+ notification.send_note_updated(tango)
82
82
  if get_config().features.open_anki_edit:
83
83
  notification.open_anki_card(last_note.noteId)
84
84
 
@@ -135,12 +135,12 @@ def get_initial_card_info(last_note: AnkiCard, selected_lines):
135
135
  sentences.append(line.text)
136
136
 
137
137
  logger.info(f"Attempting to Fix Character Dialogue Format")
138
- logger.info([f"'{line.text}'" for line in selected_lines])
138
+ logger.info([f"{line.text}" for line in sentences])
139
139
  try:
140
140
  combined_lines = combine_dialogue(sentences)
141
141
 
142
142
  if combined_lines:
143
- sentences = "".join(combined_lines)
143
+ sentences_text = "".join(combined_lines)
144
144
  except Exception as e:
145
145
  logger.debug(f'Error combining dialogue: {e}, defaulting')
146
146
  pass
GameSentenceMiner/gsm.py CHANGED
@@ -431,6 +431,9 @@ def cleanup():
431
431
  proc.kill()
432
432
  logger.error(f"Error terminating process {proc}: {e}")
433
433
 
434
+ if icon:
435
+ icon.stop()
436
+
434
437
  settings_window.window.destroy()
435
438
  logger.info("Cleanup complete.")
436
439
 
@@ -1,8 +1,19 @@
1
+ import platform
2
+
1
3
  import requests
2
4
  from plyer import notification
5
+ from win10toast import ToastNotifier
3
6
 
4
7
  from GameSentenceMiner.configuration import logger
5
8
 
9
+ system = platform.system()
10
+ if system == "Windows":
11
+ notifier = ToastNotifier()
12
+ else:
13
+ notifier = notification
14
+
15
+ windows = system == "Windows"
16
+
6
17
 
7
18
  def open_anki_card(note_id):
8
19
  url = "http://localhost:8765"
@@ -26,55 +37,62 @@ def open_anki_card(note_id):
26
37
  logger.info(f"Error connecting to AnkiConnect: {e}")
27
38
 
28
39
 
29
- def send_notification(tango):
30
- notification.notify(
40
+
41
+ def send_notification(title, message, timeout):
42
+ if windows:
43
+ notifier.show_toast(title, message, duration=timeout)
44
+ else:
45
+ notification.notify(
46
+ title=title,
47
+ message=message,
48
+ app_name="GameSentenceMiner",
49
+ timeout=timeout # Notification disappears after 5 seconds
50
+ )
51
+
52
+ def send_note_updated(tango):
53
+ send_notification(
31
54
  title="Anki Card Updated",
32
55
  message=f"Audio and/or Screenshot added to note: {tango}",
33
- app_name="GameSentenceMiner",
34
56
  timeout=5 # Notification disappears after 5 seconds
35
57
  )
36
58
 
37
-
38
59
  def send_screenshot_updated(tango):
39
- notification.notify(
60
+ send_notification(
40
61
  title="Anki Card Updated",
41
62
  message=f"Screenshot updated on note: {tango}",
42
- app_name="GameSentenceMiner",
43
63
  timeout=5 # Notification disappears after 5 seconds
44
64
  )
45
65
 
46
66
 
47
67
  def send_screenshot_saved(path):
48
- notification.notify(
68
+ send_notification(
49
69
  title="Screenshot Saved",
50
70
  message=f"Screenshot saved to : {path}",
51
- app_name="GameSentenceMiner",
52
71
  timeout=5 # Notification disappears after 5 seconds
53
72
  )
54
73
 
55
74
 
56
75
  def send_audio_generated_notification(audio_path):
57
- notification.notify(
76
+ send_notification(
58
77
  title="Audio Trimmed",
59
78
  message=f"Audio Trimmed and placed at {audio_path}",
60
- app_name="VideoGameMiner",
61
79
  timeout=5 # Notification disappears after 5 seconds
62
80
  )
63
81
 
64
82
 
65
83
  def send_check_obs_notification(reason):
66
- notification.notify(
84
+ send_notification(
67
85
  title="OBS Replay Invalid",
68
86
  message=f"Check OBS Settings! Reason: {reason}",
69
- app_name="GameSentenceMiner",
70
87
  timeout=5 # Notification disappears after 5 seconds
71
88
  )
72
89
 
73
90
 
74
91
  def send_error_no_anki_update():
75
- notification.notify(
92
+ send_notification(
76
93
  title="Error",
77
94
  message=f"Anki Card not updated, Check Console for Reason!",
78
- app_name="GameSentenceMiner",
79
95
  timeout=5 # Notification disappears after 5 seconds
80
96
  )
97
+
98
+
GameSentenceMiner/util.py CHANGED
@@ -155,7 +155,7 @@ def combine_dialogue(dialogue_lines, new_lines=None):
155
155
  if new_lines is None:
156
156
  new_lines = []
157
157
 
158
- if '「' not in dialogue_lines[0]:
158
+ if len(dialogue_lines) == 1 and '「' not in dialogue_lines[0]:
159
159
  new_lines.append(dialogue_lines[0] + "<br>")
160
160
  return new_lines
161
161
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.5.3
3
+ Version: 2.5.5
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
@@ -29,6 +29,7 @@ Requires-Dist: stable-ts~=2.17.5
29
29
  Requires-Dist: silero-vad~=5.1.2
30
30
  Requires-Dist: ttkbootstrap~=1.10.1
31
31
  Requires-Dist: dataclasses_json~=0.6.7
32
+ Requires-Dist: win10toast
32
33
  Requires-Dist: numpy
33
34
  Requires-Dist: pystray
34
35
  Requires-Dist: pywin32; sys_platform == "win32"
@@ -1,16 +1,16 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- GameSentenceMiner/anki.py,sha256=1VoWT1f5u98eYbXK7U4l8wpg_uL1nBPviNg4Q1YTCBg,12231
2
+ GameSentenceMiner/anki.py,sha256=zjZ3oE0iTMk1BQFuEhLWk8qgqJMYihO6-jTkKaC3eUk,12229
3
3
  GameSentenceMiner/config_gui.py,sha256=PzzLX-OwK71U5JSFaxup0ec0oWBWaF6AeCXs0m13HK0,56762
4
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
8
- GameSentenceMiner/gsm.py,sha256=cWHJwWHyKsdzo0TXTXREG549MUtlQLyect9S37UK56g,20309
8
+ GameSentenceMiner/gsm.py,sha256=MkRaty1ATLLJKZs9rv9Rdlitx3C9fwz66iD2AJS5LQQ,20343
9
9
  GameSentenceMiner/model.py,sha256=bZm-2vkIw4gQCGLB02eDoTtO1Ymb_dnHk0VDJDFO3y8,5228
10
- GameSentenceMiner/notification.py,sha256=WeFodBsshhbOagcEfjAJ3kxjUGvBuUAQKEJ8Zf0YO04,2267
10
+ GameSentenceMiner/notification.py,sha256=p24TPw1iF8vDVL56NRgRi3oZ-5oQa9DkqqVjr1gZRJk,2577
11
11
  GameSentenceMiner/obs.py,sha256=8ImXAVUWa4JdzwcBOEFShlZRZzh1dCvdpD1aEGhQfbU,6566
12
12
  GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,1250
13
- GameSentenceMiner/util.py,sha256=uDM1E-kNTJODm-eDELHP66uOVUUIivXzXBxr-NmeAPw,5670
13
+ GameSentenceMiner/util.py,sha256=lAFwAQNeHpVZs_Aeb2K2ShVdcmfrQzEwxUnbf7e6fOc,5699
14
14
  GameSentenceMiner/utility_gui.py,sha256=Ox63XZnj08MezcEG8X5EYJlbHmw-bZitN3CsWgP8lLo,5743
15
15
  GameSentenceMiner/downloader/Untitled_json.py,sha256=RUUl2bbbCpUDUUS0fP0tdvf5FngZ7ILdA_J5TFYAXUQ,15272
16
16
  GameSentenceMiner/downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
23
- gamesentenceminer-2.5.3.dist-info/METADATA,sha256=2FyxGIwSYPDNPlftNrNUJ5T16irg35zuZFhqn3bdIq4,5409
24
- gamesentenceminer-2.5.3.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
25
- gamesentenceminer-2.5.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
26
- gamesentenceminer-2.5.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
27
- gamesentenceminer-2.5.3.dist-info/RECORD,,
22
+ gamesentenceminer-2.5.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
23
+ gamesentenceminer-2.5.5.dist-info/METADATA,sha256=sHUHiKel1xt8b3oAys3w0In5FNvH0KGxlxsyxEMJWgs,5435
24
+ gamesentenceminer-2.5.5.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
25
+ gamesentenceminer-2.5.5.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
26
+ gamesentenceminer-2.5.5.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
27
+ gamesentenceminer-2.5.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.1)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5