GameSentenceMiner 2.13.5__py3-none-any.whl → 2.13.5.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.
- GameSentenceMiner/gsm.py +27 -1
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/RECORD +7 -7
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/top_level.txt +0 -0
GameSentenceMiner/gsm.py
CHANGED
@@ -175,7 +175,7 @@ class VideoToAudioHandler(FileSystemEventHandler):
|
|
175
175
|
anki.update_anki_card(
|
176
176
|
last_note, note, audio_path=final_audio_output, video_path=video_path,
|
177
177
|
tango=tango,
|
178
|
-
should_update_audio=vad_result.
|
178
|
+
should_update_audio=vad_result.output_audio,
|
179
179
|
ss_time=ss_timing,
|
180
180
|
game_line=mined_line,
|
181
181
|
selected_lines=selected_lines
|
@@ -618,6 +618,29 @@ async def run_test_code():
|
|
618
618
|
if boxes:
|
619
619
|
await texthooking_page.send_word_coordinates_to_overlay(boxes)
|
620
620
|
await asyncio.sleep(2)
|
621
|
+
|
622
|
+
|
623
|
+
async def check_if_script_is_running():
|
624
|
+
"""Check if the script is already running and kill it if so."""
|
625
|
+
if os.path.exists(os.path.join(get_app_directory(), "current_pid.txt")):
|
626
|
+
with open(os.path.join(get_app_directory(), "current_pid.txt"), "r") as f:
|
627
|
+
pid = int(f.read().strip())
|
628
|
+
if psutil.pid_exists(pid) and 'python' in psutil.Process(pid).name().lower():
|
629
|
+
logger.info(f"Script is already running with PID: {pid}")
|
630
|
+
psutil.Process(pid).terminate() # Attempt to terminate the existing process
|
631
|
+
logger.info("Sent SIGTERM to the existing process.")
|
632
|
+
notification.send_error_notification(
|
633
|
+
"Script was already running. Terminating the existing process.")
|
634
|
+
return True
|
635
|
+
return False
|
636
|
+
|
637
|
+
|
638
|
+
async def log_current_pid():
|
639
|
+
"""Log the current process ID."""
|
640
|
+
current_pid = os.getpid()
|
641
|
+
logger.info(f"Current process ID: {current_pid}")
|
642
|
+
with open(os.path.join(get_app_directory(), "current_pid.txt"), "w") as f:
|
643
|
+
f.write(str(current_pid))
|
621
644
|
|
622
645
|
|
623
646
|
async def async_main(reloading=False):
|
@@ -638,6 +661,9 @@ async def async_main(reloading=False):
|
|
638
661
|
run_new_thread(post_init2)
|
639
662
|
run_new_thread(run_text_hooker_page)
|
640
663
|
run_new_thread(async_loop)
|
664
|
+
|
665
|
+
# await check_if_script_is_running()
|
666
|
+
# await log_current_pid()
|
641
667
|
|
642
668
|
# Register signal handlers for graceful shutdown
|
643
669
|
signal.signal(signal.SIGTERM, handle_exit()) # Handle `kill` commands
|
@@ -2,7 +2,7 @@ GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
2
2
|
GameSentenceMiner/anki.py,sha256=FUwcWO0-arzfQjejQmDKP7pNNakhboo8InQ4s_jv6AY,19099
|
3
3
|
GameSentenceMiner/config_gui.py,sha256=x8H3HXoRlnfgiFczAoCe1wiCoQDP8MWV0v7am36q3Co,126479
|
4
4
|
GameSentenceMiner/gametext.py,sha256=qR32LhXAo1_a4r01zd7Pm2Yj4ByYCw58u78JdFkSxh4,10939
|
5
|
-
GameSentenceMiner/gsm.py,sha256=
|
5
|
+
GameSentenceMiner/gsm.py,sha256=5LBoV_vCjR6cKvpbQBOVXfI15FYae2qLFC3rXe8pApY,27852
|
6
6
|
GameSentenceMiner/obs.py,sha256=alh8G-0vEWxV46WqgVsgNU5_PC5JNzyXJdmVetjiGRo,18819
|
7
7
|
GameSentenceMiner/vad.py,sha256=zFReBMvNEEaQ_YEozCTCaMdV-o40FwtlxYRb17cYZio,19125
|
8
8
|
GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -67,9 +67,9 @@ GameSentenceMiner/web/templates/index.html,sha256=Gv3CJvNnhAzIVV_QxhNq4OD-pXDt1v
|
|
67
67
|
GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
|
68
68
|
GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
|
69
69
|
GameSentenceMiner/wip/get_overlay_coords.py,sha256=nJRytHJwUBToXeAIkf45HP7Yv42YO-ILbP5h8GVeE2Q,19791
|
70
|
-
gamesentenceminer-2.13.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
71
|
-
gamesentenceminer-2.13.5.dist-info/METADATA,sha256=
|
72
|
-
gamesentenceminer-2.13.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
73
|
-
gamesentenceminer-2.13.5.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
74
|
-
gamesentenceminer-2.13.5.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
75
|
-
gamesentenceminer-2.13.5.dist-info/RECORD,,
|
70
|
+
gamesentenceminer-2.13.5.post1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
71
|
+
gamesentenceminer-2.13.5.post1.dist-info/METADATA,sha256=RZAfAc3aTumTUQeL_1T6iGHryRRDKn4q7erBdbqUvG8,1469
|
72
|
+
gamesentenceminer-2.13.5.post1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
73
|
+
gamesentenceminer-2.13.5.post1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
74
|
+
gamesentenceminer-2.13.5.post1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
75
|
+
gamesentenceminer-2.13.5.post1.dist-info/RECORD,,
|
File without changes
|
{gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
{gamesentenceminer-2.13.5.dist-info → gamesentenceminer-2.13.5.post1.dist-info}/top_level.txt
RENAMED
File without changes
|