GameSentenceMiner 2.1.0__py3-none-any.whl → 2.1.1.post1__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.
@@ -93,9 +93,10 @@ class ConfigApp:
93
93
  def update_now(self):
94
94
  update_available, version = check_for_updates()
95
95
  if update_available:
96
+ messagebox.showinfo("Update", "GSM will now close and update")
96
97
  success = update()
97
- if success:
98
- messagebox.showinfo("Update Successful", "Update successful, please restart the application.")
98
+ if not success:
99
+ messagebox.showinfo("Update Unsuccessful", "Couldn't Start Update, please update manually.")
99
100
  else:
100
101
  messagebox.showinfo("No Update Found", "No update found.")
101
102
 
@@ -1,5 +1,5 @@
1
1
  import os
2
- import subprocess
2
+ from importlib import metadata
3
3
  import sys
4
4
  import requests
5
5
 
@@ -10,20 +10,10 @@ VERSION_FILE_PATH = os.path.join(get_app_directory(), 'version.txt')
10
10
 
11
11
  def get_current_version():
12
12
  try:
13
- with open(VERSION_FILE_PATH, 'r') as file:
14
- version = file.read().strip()
13
+ version = metadata.version(PACKAGE_NAME)
15
14
  return version
16
- except FileNotFoundError:
17
- latest_version = get_latest_version()
18
- set_current_version(latest_version)
19
- return latest_version
20
-
21
- def set_current_version(version):
22
- try:
23
- with open(VERSION_FILE_PATH, 'w') as file:
24
- file.write(version)
25
- except Exception as e:
26
- logger.error(f"Error writing to {VERSION_FILE_PATH}: {e}")
15
+ except metadata.PackageNotFoundError:
16
+ return None
27
17
 
28
18
  def get_latest_version():
29
19
  try:
@@ -50,10 +40,7 @@ def check_for_updates(force=False):
50
40
 
51
41
  def update():
52
42
  try:
53
- subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", PACKAGE_NAME])
54
- logger.info(f"Updated {PACKAGE_NAME} to the latest version, restarting...")
55
- set_current_version(get_latest_version())
56
- return True
57
- except subprocess.CalledProcessError as e:
43
+ os.execl(sys.executable, sys.executable, "-m", "pip", "install", "--upgrade", PACKAGE_NAME)
44
+ except Exception as e:
58
45
  logger.error(f"Error updating {PACKAGE_NAME}: {e}")
59
46
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: GameSentenceMiner
3
- Version: 2.1.0
3
+ Version: 2.1.1.post1
4
4
  Summary: A tool for mining sentences from games.
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  GameSentenceMiner/anki.py,sha256=3UT6K5PxzJMDoiXyOULrkeCoJ0KMq7JvBw6XhcLCirE,9114
3
- GameSentenceMiner/config_gui.py,sha256=GFRM4bOW8EP4pS7XwUHasb5fGdUK1kZm50uyLui-EiA,48840
3
+ GameSentenceMiner/config_gui.py,sha256=EjTFKFUXbEwFp7f2B-gDiSEA4nmHjlaInSyBBs_dESg,48917
4
4
  GameSentenceMiner/configuration.py,sha256=CSg67qIzEdj_w-dS-NEls9syyTeJD3rfPrwSZLomFcU,14029
5
5
  GameSentenceMiner/ffmpeg.py,sha256=hdKimzkpAKsE-17qEAQg4uHy4-TtdFywYx48Skn9cPs,10418
6
6
  GameSentenceMiner/gametext.py,sha256=GpR9P8h3GmmKH46Dw13kJPx66n3jGjFCiV8Fcrqn9E8,3999
@@ -8,14 +8,14 @@ GameSentenceMiner/gsm.py,sha256=GqMNcb8w117clJfFiNLhDbZ8eOFQTyVhejrjHvsBJXo,1507
8
8
  GameSentenceMiner/model.py,sha256=oh8VVT8T1UKekbmP6MGNgQ8jIuQ_7Rg4GPzDCn2kJo8,1999
9
9
  GameSentenceMiner/notification.py,sha256=sWgIIXhaB9WV1K_oQGf5-IR6q3dakae_QS-RuIvbcEs,1939
10
10
  GameSentenceMiner/obs.py,sha256=gutnRk30jIxuvrpEosR9jw2h_tll36wgtAZkUF-vWDY,5256
11
- GameSentenceMiner/package_updater.py,sha256=5b5-QWbycv5Zp3184LyyjAlz7OYZqZb8hyis7NcoZOg,1983
11
+ GameSentenceMiner/package_updater.py,sha256=s1OVFZbWcuRz6_vDYRtingDpOGCJNepqXiXa_-klh-I,1470
12
12
  GameSentenceMiner/util.py,sha256=OYg0j_rT9F7v3aJRwWnHvdWMYyxGlimrvw7U2C9ifeY,4441
13
13
  GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  GameSentenceMiner/vad/silero_trim.py,sha256=r7bZYEj-NUXGKgD2UIhLrbTPyq0rau97qGtrMZcRK4A,1517
15
15
  GameSentenceMiner/vad/vosk_helper.py,sha256=lWmlGMhmg_0QoWeCHrXwz9wDKPqY37BckHCekGVtJUI,5794
16
16
  GameSentenceMiner/vad/whisper_helper.py,sha256=9kmPeSs6jRcKSVxYY-vtyTcqVUDORR4q1nl8fqxHHn4,3379
17
- GameSentenceMiner-2.1.0.dist-info/METADATA,sha256=8bxVBmPyGQkS5FblJbOEyq23BvVhzLjR2GyLYZxwq8o,13535
18
- GameSentenceMiner-2.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
- GameSentenceMiner-2.1.0.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
20
- GameSentenceMiner-2.1.0.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
21
- GameSentenceMiner-2.1.0.dist-info/RECORD,,
17
+ GameSentenceMiner-2.1.1.post1.dist-info/METADATA,sha256=n52sdpAZWGe4ztLmJ51A0CiWYN6UneuxkHNXEoS8CtM,13541
18
+ GameSentenceMiner-2.1.1.post1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
+ GameSentenceMiner-2.1.1.post1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
20
+ GameSentenceMiner-2.1.1.post1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
21
+ GameSentenceMiner-2.1.1.post1.dist-info/RECORD,,