GameSentenceMiner 2.12.8__py3-none-any.whl → 2.12.9__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/gsm.py CHANGED
@@ -597,7 +597,7 @@ async def async_main(reloading=False):
597
597
  observer = Observer()
598
598
  observer.schedule(VideoToAudioHandler(), get_config().paths.folder_to_watch, recursive=False)
599
599
  observer.start()
600
- if not is_linux():
600
+ if not is_windows():
601
601
  register_hotkeys()
602
602
 
603
603
  run_new_thread(post_init2)
@@ -19,6 +19,7 @@ if is_windows():
19
19
  else:
20
20
  notifier = notification
21
21
 
22
+
22
23
  def open_browser_window(note_id, query=None):
23
24
  url = "http://localhost:8765"
24
25
  headers = {'Content-Type': 'application/json'}
@@ -75,17 +76,21 @@ def open_anki_card(note_id):
75
76
  logger.info(f"Error connecting to AnkiConnect: {e}")
76
77
 
77
78
 
78
-
79
79
  def send_notification(title, message, timeout):
80
- if is_windows():
81
- notifier.show_toast(title, message, duration=timeout, threaded=True)
82
- else:
83
- notification.notify(
84
- title=title,
85
- message=message,
86
- app_name="GameSentenceMiner",
87
- timeout=timeout # Notification disappears after 5 seconds
88
- )
80
+ try:
81
+ if is_windows():
82
+ notifier.show_toast(
83
+ title, message, duration=timeout, threaded=True)
84
+ else:
85
+ notification.notify(
86
+ title=title,
87
+ message=message,
88
+ app_name="GameSentenceMiner",
89
+ timeout=timeout # Notification disappears after 5 seconds
90
+ )
91
+ except Exception as e:
92
+ logger.error(f"Failed to send notification: {e}")
93
+
89
94
 
90
95
  def send_note_updated(tango):
91
96
  send_notification(
@@ -94,6 +99,7 @@ def send_note_updated(tango):
94
99
  timeout=5 # Notification disappears after 5 seconds
95
100
  )
96
101
 
102
+
97
103
  def send_screenshot_updated(tango):
98
104
  send_notification(
99
105
  title="Anki Card Updated",
@@ -132,5 +138,3 @@ def send_error_no_anki_update():
132
138
  message=f"Anki Card not updated, Check Console for Reason!",
133
139
  timeout=5 # Notification disappears after 5 seconds
134
140
  )
135
-
136
-
@@ -127,7 +127,7 @@ def get_text_event(last_note) -> GameLine:
127
127
  lines = game_log.values
128
128
 
129
129
  if not lines:
130
- raise Exception("No lines in history. Text is required from either clipboard or websocket for GSM to work. Please check your setup/config.")
130
+ raise Exception("No voicelines in GSM. GSM can only do work on text that has been sent to it since it started. If you are not getting any text into GSM, please check your setup/config.")
131
131
 
132
132
  if not last_note:
133
133
  return lines[-1]
@@ -168,6 +168,8 @@ def get_mined_line(last_note: AnkiCard, lines=None):
168
168
  return lines[-1]
169
169
  if not lines:
170
170
  lines = get_all_lines()
171
+ if not lines:
172
+ raise Exception("No voicelines in GSM. GSM can only do work on text that has been sent to it since it started. If you are not getting any text into GSM, please check your setup/config.")
171
173
 
172
174
  sentence = last_note.get_field(get_config().anki.sentence_field)
173
175
  for line in reversed(lines):
GameSentenceMiner/vad.py CHANGED
@@ -47,6 +47,8 @@ class VADSystem:
47
47
  else:
48
48
  logger.info(result.trim_successful_string())
49
49
  return result
50
+ else:
51
+ return VADResult(True, 0, get_audio_length(input_audio), "OFF", [], input_audio)
50
52
 
51
53
 
52
54
  def _do_vad_processing(self, model, input_audio, output_audio, game_line):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.12.8
3
+ Version: 2.12.9
4
4
  Summary: A tool for mining sentences from games. Update: Overlay?
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -2,9 +2,9 @@ GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
2
2
  GameSentenceMiner/anki.py,sha256=FUwcWO0-arzfQjejQmDKP7pNNakhboo8InQ4s_jv6AY,19099
3
3
  GameSentenceMiner/config_gui.py,sha256=UCipZVAVupJeA8Kaa1tqTBsZpErNIIePJabqKh4SI7s,105693
4
4
  GameSentenceMiner/gametext.py,sha256=TYlkgM5-J2o8-WCKypSUitmKq_UcjOGpsZBINiR-mWk,10875
5
- GameSentenceMiner/gsm.py,sha256=GGF0owRrrYJgdfXx-INwfuKbaoY-G5gLllE-sNrwYnI,25341
5
+ GameSentenceMiner/gsm.py,sha256=XfoxdN31rNUF5xPdCSamBlqIX3MPdOyoYWTPKNhWttE,25343
6
6
  GameSentenceMiner/obs.py,sha256=bMVWAPQ6QLf4celLiOsL9BUO8pTdMn9lpT9fQCNfm7Q,18718
7
- GameSentenceMiner/vad.py,sha256=zo9JpuEOCXczPXM-dq8lbr-zM-MPpfJ8aajggR3mKk4,18710
7
+ GameSentenceMiner/vad.py,sha256=-Q1KtDJnT8zRFeEc4LLyAECf07YOUM15UDRrnWkuDgo,18817
8
8
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  GameSentenceMiner/ai/ai_prompting.py,sha256=iHkEx2pQJ-tEyejOgYy4G0DcZc8qvBugVL6-CQpPSME,26089
10
10
  GameSentenceMiner/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,10 +35,10 @@ GameSentenceMiner/util/electron_config.py,sha256=8LZwl-T_uF5z_ig-IZcm9QI-VKaD7za
35
35
  GameSentenceMiner/util/ffmpeg.py,sha256=t0tflxq170n8PZKkdw8fTZIUQfXD0p_qARa9JTdhBTc,21530
36
36
  GameSentenceMiner/util/gsm_utils.py,sha256=iRyLVcodMptRhkCzLf3hyqc6_RCktXnwApi6mLju6oQ,11565
37
37
  GameSentenceMiner/util/model.py,sha256=hmA_seopP2bK40v9T4ulua9TrAeWtbkdCv-sTBPBQDk,6660
38
- GameSentenceMiner/util/notification.py,sha256=0OnEYjn3DUEZ6c6OtPjdVZe-DG-QSoMAl9fetjjCvNU,3874
38
+ GameSentenceMiner/util/notification.py,sha256=uZbaIpyNE2GSiGOT64sKLkHL1AShifqo6vYgZhH6CKo,4021
39
39
  GameSentenceMiner/util/package.py,sha256=u1ym5z869lw5EHvIviC9h9uH97bzUXSXXA8KIn8rUvk,1157
40
40
  GameSentenceMiner/util/ss_selector.py,sha256=cbjMxiKOCuOfbRvLR_PCRlykBrGtm1LXd6u5czPqkmc,4793
41
- GameSentenceMiner/util/text_log.py,sha256=Gbm8H2DHUX4u0QBnbjs3jOfzkS6_5WBczgD3mwant7Q,6031
41
+ GameSentenceMiner/util/text_log.py,sha256=38b5Qrluev2zTxoKZ1BS06DBsoycZQ5HB0YYGeFF1Q4,6290
42
42
  GameSentenceMiner/util/window_transparency.py,sha256=GtbxbmZg0-UYPXhfHff-7IKZyY2DKe4B9GdyovfmpeM,8166
43
43
  GameSentenceMiner/util/communication/__init__.py,sha256=xh__yn2MhzXi9eLi89PeZWlJPn-cbBSjskhi1BRraXg,643
44
44
  GameSentenceMiner/util/communication/send.py,sha256=Wki9qIY2CgYnuHbmnyKVIYkcKAN_oYS4up93XMikBaI,222
@@ -64,9 +64,9 @@ GameSentenceMiner/web/templates/index.html,sha256=Gv3CJvNnhAzIVV_QxhNq4OD-pXDt1v
64
64
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
65
65
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
66
66
  GameSentenceMiner/wip/get_overlay_coords.py,sha256=_re9zfyuFryZAUKbMQ1LAfQBDIRUmq_1kniisN7J7xE,19793
67
- gamesentenceminer-2.12.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
68
- gamesentenceminer-2.12.8.dist-info/METADATA,sha256=qNKct0xyvTpN7ORgYhyw2cpLq7vv9cNsrzA4MfRdUYk,7068
69
- gamesentenceminer-2.12.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- gamesentenceminer-2.12.8.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
71
- gamesentenceminer-2.12.8.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
72
- gamesentenceminer-2.12.8.dist-info/RECORD,,
67
+ gamesentenceminer-2.12.9.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
68
+ gamesentenceminer-2.12.9.dist-info/METADATA,sha256=hxe3hqm5pm3PUW6BKpAynDpz6lMOSIBMR3E0ndiIkng,7068
69
+ gamesentenceminer-2.12.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ gamesentenceminer-2.12.9.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
71
+ gamesentenceminer-2.12.9.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
72
+ gamesentenceminer-2.12.9.dist-info/RECORD,,