GameSentenceMiner 2.10.4__py3-none-any.whl → 2.10.5__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.
@@ -89,23 +89,31 @@ class OCRConfig:
89
89
 
90
90
  def get_window(title):
91
91
  import pygetwindow as gw
92
- windows = gw.getWindowsWithTitle(title)
93
- if not windows:
92
+ all_windows = gw.getWindowsWithTitle(title)
93
+ if not all_windows:
94
94
  raise ValueError(f"No windows found with title '{title}'.")
95
+
96
+ filtered_windows = []
97
+ for window in all_windows:
98
+ if "cmd.exe" in window.title.lower():
99
+ logger.info(f"Skipping cmd.exe window with title: {window.title}")
100
+ continue
101
+ filtered_windows.append(window)
102
+
103
+ if not filtered_windows:
104
+ raise ValueError(f"No non-cmd.exe windows found with title '{title}'.")
105
+
95
106
  ret = None
96
- if windows:
97
- for window in windows:
98
- if "cmd.exe" in window.title.lower():
99
- logger.info(f"Skipping cmd.exe window with title: {window.title}")
100
- continue
101
- if len(windows) > 1:
102
- logger.info(
103
- f"Warning: More than 1 window with title, Window Title: {window.title}, Geometry: {window.left}, {window.top}, {window.width}, {window.height}")
104
- if window.title == title:
105
- if window.isMinimized or not window.visible:
106
- logger.info(f"Warning: Window '{title}' is minimized. Attempting to restore it.")
107
- window.restore()
108
- return window
107
+ for window in filtered_windows:
108
+ if len(filtered_windows) > 1:
109
+ logger.info(
110
+ f"Warning: More than 1 non-cmd.exe window with title, Window Title: {window.title}, Geometry: {window.left}, {window.top}, {window.width}, {window.height}")
111
+
112
+ if window.title.strip() == title.strip():
113
+ if window.isMinimized or not window.visible:
114
+ logger.info(f"Warning: Window '{title}' is minimized or not visible. Attempting to restore it.")
115
+ window.restore()
116
+ return window
109
117
  return ret
110
118
 
111
119
  # try w10+, fall back to w8.1+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.10.4
3
+ Version: 2.10.5
4
4
  Summary: A tool for mining sentences from games. Update: Full UI Re-design
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -16,7 +16,7 @@ GameSentenceMiner/assets/icon512.png,sha256=HxUj2GHjyQsk8NV433256UxU9phPhtjCY-YB
16
16
  GameSentenceMiner/assets/icon64.png,sha256=N8xgdZXvhqVQP9QUK3wX5iqxX9LxHljD7c-Bmgim6tM,9301
17
17
  GameSentenceMiner/assets/pickaxe.png,sha256=VfIGyXyIZdzEnVcc4PmG3wszPMO1W4KCT7Q_nFK6eSE,1403829
18
18
  GameSentenceMiner/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- GameSentenceMiner/ocr/gsm_ocr_config.py,sha256=6Ncq79Poolc7htBiusLZfMRlyThxm1Aky1Z4DlGIY58,3940
19
+ GameSentenceMiner/ocr/gsm_ocr_config.py,sha256=5Y90Swo6d6b-JHJXb9AdOsx4v75jVPV1cDxuVpU5Pbc,4155
20
20
  GameSentenceMiner/ocr/ocrconfig.py,sha256=_tY8mjnzHMJrLS8E5pHqYXZjMuLoGKYgJwdhYgN-ny4,6466
21
21
  GameSentenceMiner/ocr/owocr_area_selector.py,sha256=59zrzamPbBeU_Pfdeivc8RawlLXhXqNrhkBrhc69ZZo,47057
22
22
  GameSentenceMiner/ocr/owocr_helper.py,sha256=w4XYViFh5zh65SX25qUV0ge0SLEusekwP59JfmFkSgE,19991
@@ -62,9 +62,9 @@ GameSentenceMiner/web/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
62
62
  GameSentenceMiner/web/templates/index.html,sha256=6Cm_HWGzavgqAvC7SGT0u8R6_kRFUNIEyAzTHDC6c1A,214780
63
63
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
64
64
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
65
- gamesentenceminer-2.10.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
66
- gamesentenceminer-2.10.4.dist-info/METADATA,sha256=FTo9ZM78RgICutHnjjGqdPy0dIunDg5uwCAWcjQ9oc4,7354
67
- gamesentenceminer-2.10.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
- gamesentenceminer-2.10.4.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
69
- gamesentenceminer-2.10.4.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
70
- gamesentenceminer-2.10.4.dist-info/RECORD,,
65
+ gamesentenceminer-2.10.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
66
+ gamesentenceminer-2.10.5.dist-info/METADATA,sha256=pZimGUQJcglktMBs5aZJYpILVmbfQLOel-ka5RG68Zg,7354
67
+ gamesentenceminer-2.10.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
+ gamesentenceminer-2.10.5.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
69
+ gamesentenceminer-2.10.5.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
70
+ gamesentenceminer-2.10.5.dist-info/RECORD,,