GameSentenceMiner 2.8.43__py3-none-any.whl → 2.8.45__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
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import sys
2
3
 
3
4
  from GameSentenceMiner.vad.result import VADResult
4
5
 
@@ -42,6 +43,7 @@ except Exception as e:
42
43
  logger.info("Something bad happened during import/initialization, closing in 5 seconds")
43
44
  logger.exception(e)
44
45
  time.sleep(5)
46
+ sys.exit(1)
45
47
 
46
48
  if is_windows():
47
49
  import win32api
@@ -2,26 +2,28 @@ import platform
2
2
 
3
3
  import requests
4
4
  from plyer import notification
5
- from win10toast import ToastNotifier
5
+
6
+ from GameSentenceMiner.util import is_windows
7
+
8
+ if is_windows():
9
+ from win10toast import ToastNotifier
6
10
 
7
11
  from GameSentenceMiner.configuration import logger
8
12
 
9
- class MyToastNotifier(ToastNotifier):
10
- def __init__(self):
11
- super().__init__()
13
+ if is_windows():
14
+ class MyToastNotifier(ToastNotifier):
15
+ def __init__(self):
16
+ super().__init__()
12
17
 
13
- def on_destroy(self, hwnd, msg, wparam, lparam):
14
- super().on_destroy(hwnd, msg, wparam, lparam)
15
- return 0
18
+ def on_destroy(self, hwnd, msg, wparam, lparam):
19
+ super().on_destroy(hwnd, msg, wparam, lparam)
20
+ return 0
16
21
 
17
- system = platform.system()
18
- if system == "Windows":
22
+ if is_windows():
19
23
  notifier = MyToastNotifier()
20
24
  else:
21
25
  notifier = notification
22
26
 
23
- windows = system == "Windows"
24
-
25
27
 
26
28
  def open_anki_card(note_id):
27
29
  url = "http://localhost:8765"
@@ -47,7 +49,7 @@ def open_anki_card(note_id):
47
49
 
48
50
 
49
51
  def send_notification(title, message, timeout):
50
- if windows:
52
+ if is_windows():
51
53
  notifier.show_toast(title, message, duration=timeout, threaded=True)
52
54
  else:
53
55
  notification.notify(
GameSentenceMiner/util.py CHANGED
@@ -11,7 +11,7 @@ from sys import platform
11
11
 
12
12
  from rapidfuzz import process
13
13
 
14
- from GameSentenceMiner.configuration import logger, get_config
14
+ from GameSentenceMiner.configuration import logger, get_config, get_app_directory
15
15
 
16
16
  SCRIPTS_DIR = r"E:\Japanese Stuff\agent-v0.1.4-win32-x64\data\scripts"
17
17
 
@@ -254,8 +254,8 @@ def do_text_replacements(text, replacements_json):
254
254
  return text
255
255
 
256
256
 
257
- TEXT_REPLACEMENTS_FILE = os.path.join(os.getenv('APPDATA'), 'GameSentenceMiner', 'config', 'text_replacements.json')
258
- OCR_REPLACEMENTS_FILE = os.path.join(os.getenv('APPDATA'), 'GameSentenceMiner', 'config', 'ocr_replacements.json')
257
+ TEXT_REPLACEMENTS_FILE = os.path.join(get_app_directory(), 'config', 'text_replacements.json')
258
+ OCR_REPLACEMENTS_FILE = os.path.join(get_app_directory(), 'config', 'ocr_replacements.json')
259
259
  os.makedirs(os.path.dirname(TEXT_REPLACEMENTS_FILE), exist_ok=True)
260
260
 
261
261
  import urllib.request
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.8.43
3
+ Version: 2.8.45
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
@@ -5,15 +5,15 @@ GameSentenceMiner/configuration.py,sha256=5XdL7ZBEouj6Rz8pHvWKyTmhdDNs5p6UkdNng5
5
5
  GameSentenceMiner/electron_config.py,sha256=dGcPYCISPehXubYSzsDuI2Gl092MYK0u3bTnkL9Jh1Y,9787
6
6
  GameSentenceMiner/ffmpeg.py,sha256=sf_Wz4ijFOYKRZI4qhRc32Y9E2zZuPscLv_VU8ZYCHU,18250
7
7
  GameSentenceMiner/gametext.py,sha256=hcyZQ69B7xB5ZG85wLzM5au7ZPKxmeUXsmUD26oyk_0,5660
8
- GameSentenceMiner/gsm.py,sha256=rXWuR6RfJknkwtqHLspkk1qDXKO6Tk6dJ8Nuk-i-HDA,27239
8
+ GameSentenceMiner/gsm.py,sha256=dZt2Gnwqwj-i-yRpGJWBmCBRaBjEUCzi3L3P-gcVkfA,27266
9
9
  GameSentenceMiner/model.py,sha256=1lRyJFf_LND_4O16h8CWVqDfosLgr0ZS6ufBZ3qJHpY,5699
10
- GameSentenceMiner/notification.py,sha256=FY39ChSRK0Y8TQ6lBGsLnpZUFPtFpSy2tweeXVoV7kc,2809
10
+ GameSentenceMiner/notification.py,sha256=pXKoLfmRQLH55IQ5G6uxdMuczqX7D6l3ubVEY1e6hXg,2859
11
11
  GameSentenceMiner/obs.py,sha256=a-zLd7FrfI8fBiv5IfR-3pZYwqRJI_hUElzlZauaL40,14500
12
12
  GameSentenceMiner/obs_back.py,sha256=_N_UV7Nh5cyy3mnH5lOUOzhgZwHMACeFEuBo1Z-bNzg,10894
13
13
  GameSentenceMiner/package.py,sha256=YlS6QRMuVlm6mdXx0rlXv9_3erTGS21jaP3PNNWfAH0,1250
14
14
  GameSentenceMiner/ss_selector.py,sha256=hS_p_7VljVkFDg_POsutLfXDv1hdF-NbVnQAW4X5qsQ,4441
15
15
  GameSentenceMiner/text_log.py,sha256=MD7LB5D-v4G0Bnm3uGvZQ0aV38Fcj4E0vgq7mmyQ7_4,5157
16
- GameSentenceMiner/util.py,sha256=Lvk6sjEVBGhgVkWkalXDus48BZOSSMRuxNA7n3SiBqA,9147
16
+ GameSentenceMiner/util.py,sha256=PrDNnxWiJZh1lGuwnp3DjWIlwbkVxweRTYWLtQk94Ao,9122
17
17
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  GameSentenceMiner/ai/ai_prompting.py,sha256=_uWvwOg2YROVZV3MOKlx2THvAmg07ScwVyvBCtPrUzs,9572
19
19
  GameSentenceMiner/communication/__init__.py,sha256=_jGn9PJxtOAOPtJ2rI-Qu9hEHVZVpIvWlxKvqk91_zI,638
@@ -54,9 +54,9 @@ GameSentenceMiner/web/static/web-app-manifest-512x512.png,sha256=wyqgCWCrLEUxSRX
54
54
  GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
56
56
  GameSentenceMiner/web/templates/utility.html,sha256=P659ZU2j7tcbJ5xPO3p7E_SQpkp3CrrFtSvvXJNNuLI,16330
57
- gamesentenceminer-2.8.43.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
- gamesentenceminer-2.8.43.dist-info/METADATA,sha256=IgVqNmHmj_PelgSoht2IKt0U93FyYyCHnDQ9CACTN0M,7218
59
- gamesentenceminer-2.8.43.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
60
- gamesentenceminer-2.8.43.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
61
- gamesentenceminer-2.8.43.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
62
- gamesentenceminer-2.8.43.dist-info/RECORD,,
57
+ gamesentenceminer-2.8.45.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
+ gamesentenceminer-2.8.45.dist-info/METADATA,sha256=HMMLNjDZHUVreaBB4CU8-4flglKt6MzQUtXd1yLl92w,7218
59
+ gamesentenceminer-2.8.45.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
60
+ gamesentenceminer-2.8.45.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
61
+ gamesentenceminer-2.8.45.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
62
+ gamesentenceminer-2.8.45.dist-info/RECORD,,