GameSentenceMiner 2.12.0.dev4__py3-none-any.whl → 2.12.0.dev5__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.
@@ -1,9 +1,11 @@
1
+ import sys
1
2
  import win32gui
2
3
  import win32con
3
4
  import win32api
4
5
  import keyboard
5
6
  import time
6
7
  import threading
8
+ import signal
7
9
 
8
10
  from GameSentenceMiner.util.configuration import logger
9
11
 
@@ -137,6 +139,22 @@ def mouse_monitor_loop():
137
139
  # A small delay to reduce CPU usage
138
140
  time.sleep(0.1)
139
141
 
142
+ class HandleSTDINThread(threading.Thread):
143
+ def run(self):
144
+ while True:
145
+ try:
146
+ line = input()
147
+ if "exit" in line.strip().lower():
148
+ handle_quit()
149
+ break
150
+ except EOFError:
151
+ break
152
+
153
+ def handle_quit():
154
+ if is_toggled and target_hwnd:
155
+ reset_window_state(target_hwnd)
156
+ logger.info("Exiting Window Transparency Tool.")
157
+
140
158
  # --- Main Execution Block ---
141
159
 
142
160
  if __name__ == "__main__":
@@ -155,8 +173,18 @@ if __name__ == "__main__":
155
173
  # Register the global hotkey
156
174
  keyboard.add_hotkey(hotkey, toggle_functionality)
157
175
 
176
+ # Handle SigINT/SigTERM gracefully
177
+ def signal_handler(sig, frame):
178
+ handle_quit()
179
+ sys.exit(0)
180
+
181
+ signal.signal(signal.SIGINT, signal_handler)
182
+ signal.signal(signal.SIGTERM, signal_handler)
183
+
158
184
  logger.info(f"Script running. Press '{hotkey}' on a window to toggle transparency.")
159
185
  logger.info("Press Ctrl+C in this console to exit.")
186
+
187
+ HandleSTDINThread().start()
160
188
 
161
189
  # Keep the script running to listen for the hotkey.
162
190
  # keyboard.wait() is a blocking call that waits indefinitely.
@@ -489,7 +489,7 @@ async def texthooker_page_coro():
489
489
  plaintext_websocket_server_thread = WebsocketServerThread(read=False, ws_port=get_config().advanced.plaintext_websocket_port)
490
490
  plaintext_websocket_server_thread.start()
491
491
 
492
- overlay_server_thread = WebsocketServerThread(read=False, ws_port=49999)
492
+ overlay_server_thread = WebsocketServerThread(read=False, ws_port=get_config().wip.overlay_websocket_port)
493
493
  overlay_server_thread.start()
494
494
 
495
495
  # Keep the main asyncio event loop running (for the WebSocket server)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.12.0.dev4
3
+ Version: 2.12.0.dev5
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
@@ -39,7 +39,7 @@ GameSentenceMiner/util/notification.py,sha256=0OnEYjn3DUEZ6c6OtPjdVZe-DG-QSoMAl9
39
39
  GameSentenceMiner/util/package.py,sha256=u1ym5z869lw5EHvIviC9h9uH97bzUXSXXA8KIn8rUvk,1157
40
40
  GameSentenceMiner/util/ss_selector.py,sha256=cbjMxiKOCuOfbRvLR_PCRlykBrGtm1LXd6u5czPqkmc,4793
41
41
  GameSentenceMiner/util/text_log.py,sha256=jhG7ny8-DAilMAAPauN5HLoBNSIJ-cXAm68NLBxGNT8,5997
42
- GameSentenceMiner/util/window_transparency.py,sha256=eQZausQ8A7-2Vd5cbBEJrJMKhaEPkLjJEa16kcnK6Ec,6592
42
+ GameSentenceMiner/util/window_transparency.py,sha256=hmeQYqK3mUEh47hZ8pODldUbxCC5eluMddanXfC_epQ,7325
43
43
  GameSentenceMiner/util/communication/__init__.py,sha256=xh__yn2MhzXi9eLi89PeZWlJPn-cbBSjskhi1BRraXg,643
44
44
  GameSentenceMiner/util/communication/send.py,sha256=Wki9qIY2CgYnuHbmnyKVIYkcKAN_oYS4up93XMikBaI,222
45
45
  GameSentenceMiner/util/communication/websocket.py,sha256=TbphRGmxVrgEupS7tNdifsmQfWDfIp0Hio2cSiUKgsk,3317
@@ -49,7 +49,7 @@ GameSentenceMiner/util/downloader/download_tools.py,sha256=zR-aEHiFVkyo-9oPoSx6n
49
49
  GameSentenceMiner/util/downloader/oneocr_dl.py,sha256=EJbKISaZ9p2x9P4x0rpMM5nAInTTc9b7arraGBcd-SA,10381
50
50
  GameSentenceMiner/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  GameSentenceMiner/web/service.py,sha256=S7bYf2kSk08u-8R9Qpv7piM-pxfFjYZUvU825xupmuI,5279
52
- GameSentenceMiner/web/texthooking_page.py,sha256=uuPxVsyFxGrnNh-aM4VpuYYRTdDqjGfQT-gUD-G5aDM,17185
52
+ GameSentenceMiner/web/texthooking_page.py,sha256=c6wOItEVJDkjJsq6jKemv1mytZh5N6bi2V--3jwH_T0,17219
53
53
  GameSentenceMiner/web/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  GameSentenceMiner/web/static/apple-touch-icon.png,sha256=OcMI8af_68DA_tweOsQ5LytTyMwm7-hPW07IfrOVgEs,46132
55
55
  GameSentenceMiner/web/static/favicon-96x96.png,sha256=lOePzjiKl1JY2J1kT_PMdyEnrlJmi5GWbmXJunM12B4,16502
@@ -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=yE8LzXlR-Sw3rz3N-judgQa5z4egJptfJ97KEvdmEH4,3189
67
- gamesentenceminer-2.12.0.dev4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
68
- gamesentenceminer-2.12.0.dev4.dist-info/METADATA,sha256=4k5cWg9n_fQjceSlT2te0bKlHe62A_WFn06ah_4KT44,7004
69
- gamesentenceminer-2.12.0.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- gamesentenceminer-2.12.0.dev4.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
71
- gamesentenceminer-2.12.0.dev4.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
72
- gamesentenceminer-2.12.0.dev4.dist-info/RECORD,,
67
+ gamesentenceminer-2.12.0.dev5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
68
+ gamesentenceminer-2.12.0.dev5.dist-info/METADATA,sha256=OYb2bqQEqbXBg8OaH72DmaCeDuZMWayEFlpMdTa5oZw,7004
69
+ gamesentenceminer-2.12.0.dev5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ gamesentenceminer-2.12.0.dev5.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
71
+ gamesentenceminer-2.12.0.dev5.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
72
+ gamesentenceminer-2.12.0.dev5.dist-info/RECORD,,