GameSentenceMiner 2.9.13__py3-none-any.whl → 2.9.15__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
@@ -1,3 +1,4 @@
1
+ import queue
1
2
  import time
2
3
 
3
4
  import base64
@@ -269,13 +270,15 @@ def check_for_new_cards():
269
270
  new_card_ids = current_note_ids - previous_note_ids
270
271
  if new_card_ids and not first_run:
271
272
  try:
272
- update_new_card()
273
+ if gsm_state.lock.locked():
274
+ run_new_thread(update_new_card)
275
+ else:
276
+ update_new_card()
273
277
  except Exception as e:
274
278
  logger.error("Error updating new card, Reason:", e)
275
279
  first_run = False
276
280
  previous_note_ids.update(new_card_ids) # Update the list of known notes
277
281
 
278
-
279
282
  def update_new_card():
280
283
  last_card = get_last_anki_card()
281
284
  if not last_card or not check_tags_for_should_update(last_card):
@@ -301,6 +304,9 @@ def update_new_card():
301
304
  return
302
305
 
303
306
 
307
+
308
+
309
+
304
310
  def sentence_is_same_as_previous(last_card):
305
311
  if not gsm_state.last_mined_line:
306
312
  return False
GameSentenceMiner/gsm.py CHANGED
@@ -35,7 +35,7 @@ try:
35
35
  from GameSentenceMiner.util.communication.websocket import connect_websocket, register_websocket_message_handler, \
36
36
  FunctionName
37
37
  from GameSentenceMiner.util.configuration import *
38
- from GameSentenceMiner.util.ffmpeg import get_audio_and_trim, get_video_timings
38
+ from GameSentenceMiner.util.ffmpeg import get_audio_and_trim, get_video_timings, get_ffmpeg_path
39
39
  from GameSentenceMiner.obs import check_obs_folder_is_correct
40
40
  from GameSentenceMiner.util.text_log import GameLine, get_text_event, get_mined_line, get_all_lines, game_log
41
41
  from GameSentenceMiner.util import *
@@ -573,6 +573,8 @@ def initialize(reloading=False):
573
573
  if is_windows():
574
574
  download_obs_if_needed()
575
575
  download_ffmpeg_if_needed()
576
+ if shutil.which("ffmpeg") is None:
577
+ os.environ["PATH"] += os.pathsep + get_ffmpeg_path()
576
578
  if get_config().obs.enabled:
577
579
  if get_config().obs.open_obs:
578
580
  obs_process = obs.start_obs()
@@ -232,7 +232,7 @@ class Advanced:
232
232
  ocr_sends_to_clipboard: bool = True
233
233
  ocr_websocket_port: int = 9002
234
234
  texthooker_communication_websocket_port: int = 55001
235
- use_anki_note_creation_time: bool = False
235
+ use_anki_note_creation_time: bool = True
236
236
 
237
237
  @dataclass_json
238
238
  @dataclass
@@ -634,7 +634,7 @@ logger.addHandler(console_handler)
634
634
  # Create rotating file handler with level DEBUG
635
635
  file_path = get_log_path()
636
636
  if os.path.exists(file_path) and os.path.getsize(file_path) > 10 * 1024 * 1024:
637
- shutil.move(os.path.join(file_path, "gamesentenceminer.log"), os.path.join(file_path, "gamesentenceminer_old.log"))
637
+ shutil.move(file_path, os.path.join(os.path.dirname(file_path), "gamesentenceminer_old.log"))
638
638
 
639
639
  file_handler = logging.FileHandler(file_path, encoding='utf-8')
640
640
  file_handler.setLevel(logging.DEBUG)
@@ -656,5 +656,6 @@ class GsmAppState:
656
656
  self.lock = threading.Lock()
657
657
  self.last_mined_line = None
658
658
  self.keep_running = True
659
+ self.current_game = ''
659
660
 
660
661
  gsm_state = GsmAppState()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.9.13
3
+ Version: 2.9.15
4
4
  Summary: A tool for mining sentences from games.
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -1,8 +1,8 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- GameSentenceMiner/anki.py,sha256=1DN00SUCSd4adIRrEqirXXf-2jSeFEuYNrr_WB8nlVE,14950
2
+ GameSentenceMiner/anki.py,sha256=tMX6nTVO2PKgXXHM6uh1XaWBYEvZq-6VPhuTSbBrE-Y,15075
3
3
  GameSentenceMiner/config_gui.py,sha256=iAOLD47sQW67kzBcZKSQ0Dwctc1ngZK1lwSVIaLpQPI,83559
4
4
  GameSentenceMiner/gametext.py,sha256=mM-gw1d7c2EEvMUznaAevTQFLswNZavCuxMXhA9pV4g,6251
5
- GameSentenceMiner/gsm.py,sha256=ycv1wMEqTBM919qC5rlr0AVzfPwpYP1yIrbSgfibv4I,29174
5
+ GameSentenceMiner/gsm.py,sha256=hmdgvad7k6mei2M0TywNfdaWt6I_1U6o3MNHJaGTMvQ,29307
6
6
  GameSentenceMiner/obs.py,sha256=O9NYOGu7kwp4flq8LLXp8YJQg0JTZ8qBqiQNQ6u4ku4,14724
7
7
  GameSentenceMiner/vad.py,sha256=Gk_VthD7mDp3-wM_S6bEv8ykGmqzCDbbcRiaEBzAE_o,14835
8
8
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -28,7 +28,7 @@ GameSentenceMiner/owocr/owocr/ocr.py,sha256=vZR3du1fGg5-3cmPvYKTO4PFk7Lxyf6-BrIy
28
28
  GameSentenceMiner/owocr/owocr/run.py,sha256=U6VIfCvsNPADG3twhp4SQVX1xhihSAGGrBnQj2x0C2c,54964
29
29
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
30
30
  GameSentenceMiner/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- GameSentenceMiner/util/configuration.py,sha256=5YJSKelIpBTK7ggpGUERf17xVwH8Hy9GzvJ12eP8kHs,26095
31
+ GameSentenceMiner/util/configuration.py,sha256=YcAqr2LeCU__CRMf-440VsnNjSeO6EKVgtTpuaQ3WKE,26103
32
32
  GameSentenceMiner/util/electron_config.py,sha256=3VmIrcXhC-wIMMc4uqV85NrNenRl4ZUbnQfSjWEwuig,9852
33
33
  GameSentenceMiner/util/ffmpeg.py,sha256=daItJprEqi5PQe-aFb836rls3tBHNqIQKz61vlJK07M,19276
34
34
  GameSentenceMiner/util/gsm_utils.py,sha256=Z_Lu4jSIfUaM2VljIJXQkSJD0UsyJ5hMB46H2NS0gZo,8819
@@ -59,9 +59,9 @@ GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
59
59
  GameSentenceMiner/web/templates/index.html,sha256=HZKiIjiGJV8PGQ9T2aLDUNSfJn71qOwbYCjbRuSIjpY,213583
60
60
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
61
61
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
62
- gamesentenceminer-2.9.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
63
- gamesentenceminer-2.9.13.dist-info/METADATA,sha256=WyTR-3EvQ2p5mbGLJNGqHTMCeg3hP2mS240XdHrjcK4,7221
64
- gamesentenceminer-2.9.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
- gamesentenceminer-2.9.13.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
66
- gamesentenceminer-2.9.13.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
67
- gamesentenceminer-2.9.13.dist-info/RECORD,,
62
+ gamesentenceminer-2.9.15.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
63
+ gamesentenceminer-2.9.15.dist-info/METADATA,sha256=HlrNtUp1F67fRbWDmJ2CyBLjdWtAO_jUdO7cBToDeDM,7221
64
+ gamesentenceminer-2.9.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
65
+ gamesentenceminer-2.9.15.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
66
+ gamesentenceminer-2.9.15.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
67
+ gamesentenceminer-2.9.15.dist-info/RECORD,,