GameSentenceMiner 2.13.2__py3-none-any.whl → 2.13.3__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.
@@ -53,6 +53,7 @@ def get_ocr_config(window=None, use_window_for_config=False) -> OCRConfig:
53
53
  """Loads and updates screen capture areas from the corresponding JSON file."""
54
54
  ocr_config_dir = get_ocr_config_path()
55
55
  obs.connect_to_obs_sync(retry=0)
56
+ obs.update_current_game()
56
57
  if use_window_for_config and window:
57
58
  scene = sanitize_filename(window)
58
59
  else:
@@ -161,7 +162,7 @@ class WebsocketServerThread(threading.Thread):
161
162
  async def send_text(self, text, line_time: datetime):
162
163
  if text:
163
164
  return asyncio.run_coroutine_threadsafe(
164
- self.send_text_coroutine(json.dumps({"sentence": text, "time": line_time.isoformat()})), self.loop)
165
+ self.send_text_coroutine(json.dumps({"sentence": text, "time": line_time.isoformat(), "process_path": obs.get_current_game()})), self.loop)
165
166
 
166
167
  def stop_server(self):
167
168
  self.loop.call_soon_threadsafe(self._stop_event.set)
@@ -291,6 +292,38 @@ def reset_callback_vars():
291
292
  previous_text_list = []
292
293
  last_ocr2_result = ""
293
294
  run.set_last_image(None)
295
+
296
+ # class TwoPassOCRHandler:
297
+ # def __init__(self, ocr1, ocr2):
298
+ # self.ocr1 = ocr1
299
+ # self.ocr2 = ocr2
300
+ # self.second_ocr_queue = queue.Queue()
301
+ # self.previous_text = None
302
+ # self.previous_orig_text = ""
303
+ # self.previous_img = None
304
+ # self.text_stable_start_time = None
305
+ # self.last_oneocr_time = None
306
+ # self.force_stable = False
307
+ # self.previous_ocr1_result = ""
308
+ # self.last_sent_result = ""
309
+ # self.previous_text_list = []
310
+
311
+ # def check_first_ocr(self, text, orig_text, time, img=None, came_from_ss=False, filtering=None, crop_coords=None):
312
+ # if not twopassocr or not ocr2:
313
+ # return text_callback(text, orig_text, time, img=img, came_from_ss=came_from_ss, filtering=filtering, crop_coords=crop_coords)
314
+
315
+ # text_callback(text, orig_text, time, img=img, came_from_ss=came_from_ss, filtering=filtering, crop_coords=crop_coords)
316
+
317
+ # def set_ocr_ocr1(self, ocr1):
318
+ # self.ocr1 = ocr1
319
+ # def set_ocr_ocr2(self, ocr2):
320
+ # self.ocr2 = ocr2
321
+
322
+ # def get_ocr_ocr1(self):
323
+ # return self.ocr1
324
+
325
+ # def get_ocr_ocr2(self):
326
+ # return self.ocr2
294
327
 
295
328
  def text_callback(text, orig_text, time, img=None, came_from_ss=False, filtering=None, crop_coords=None):
296
329
  global twopassocr, ocr2, previous_text, last_oneocr_time, text_stable_start_time, previous_orig_text, previous_img, force_stable, previous_ocr1_result, previous_text_list, last_sent_result
@@ -305,7 +338,6 @@ def text_callback(text, orig_text, time, img=None, came_from_ss=False, filtering
305
338
 
306
339
  line_start_time = time if time else datetime.now()
307
340
 
308
-
309
341
  if manual or not get_ocr_two_pass_ocr():
310
342
  if compare_ocr_results(last_sent_result, text, 80):
311
343
  if text:
@@ -689,7 +689,7 @@ class Config:
689
689
  configs: Dict[str, ProfileConfig] = field(default_factory=dict)
690
690
  current_profile: str = DEFAULT_CONFIG
691
691
  switch_to_default_if_not_found: bool = True
692
- locale: Locale = Locale.English
692
+ locale: Locale = Locale.English.value
693
693
 
694
694
  @classmethod
695
695
  def new(cls):
@@ -138,3 +138,10 @@ def send_error_no_anki_update():
138
138
  message=f"Anki Card not updated, Check Console for Reason!",
139
139
  timeout=5 # Notification disappears after 5 seconds
140
140
  )
141
+
142
+ def send_error_notification(message):
143
+ send_notification(
144
+ title="Error",
145
+ message=message,
146
+ timeout=5 # Notification disappears after 5 seconds
147
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.13.2
3
+ Version: 2.13.3
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
@@ -22,7 +22,7 @@ GameSentenceMiner/ocr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
22
22
  GameSentenceMiner/ocr/gsm_ocr_config.py,sha256=Ezj-0k6Wo-una91FvYhMp6KGkRhWYihXzLAoh_Wu2xY,5329
23
23
  GameSentenceMiner/ocr/ocrconfig.py,sha256=_tY8mjnzHMJrLS8E5pHqYXZjMuLoGKYgJwdhYgN-ny4,6466
24
24
  GameSentenceMiner/ocr/owocr_area_selector.py,sha256=BgLsUTWIWXTiwApuj5BZtNu1_wpVdODOIy5GAw3G6jg,27223
25
- GameSentenceMiner/ocr/owocr_helper.py,sha256=nyNCt6TtOFvcXddwaNXpkuYbCsfBG5Nvp6b8mU-6jlg,25236
25
+ GameSentenceMiner/ocr/owocr_helper.py,sha256=EDKDhmZ0kF1xNmw2obZwAdXj-L-zDK09JGZPTJBja-c,26523
26
26
  GameSentenceMiner/ocr/ss_picker.py,sha256=0IhxUdaKruFpZyBL-8SpxWg7bPrlGpy3lhTcMMZ5rwo,5224
27
27
  GameSentenceMiner/owocr/owocr/__init__.py,sha256=87hfN5u_PbL_onLfMACbc0F5j4KyIK9lKnRCj6oZgR0,49
28
28
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
@@ -33,12 +33,12 @@ GameSentenceMiner/owocr/owocr/run.py,sha256=We3832iAXXSoJnjlTrI72jhUuMoxRQ_lbaz4
33
33
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
34
34
  GameSentenceMiner/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  GameSentenceMiner/util/audio_offset_selector.py,sha256=8Stk3BP-XVIuzRv9nl9Eqd2D-1yD3JrgU-CamBywJmY,8542
36
- GameSentenceMiner/util/configuration.py,sha256=hHGNGu0ybULyLwiBnIoTq4Fy1dC2ZxpnMFN5dfscwsc,37331
36
+ GameSentenceMiner/util/configuration.py,sha256=DWqwhEaCUoTYZiahAK151Upagw8maxRLsKIwemJ2ssg,37337
37
37
  GameSentenceMiner/util/electron_config.py,sha256=8LZwl-T_uF5z_ig-IZcm9QI-VKaD7zaHX9u6MaLYuo4,8648
38
38
  GameSentenceMiner/util/ffmpeg.py,sha256=t0tflxq170n8PZKkdw8fTZIUQfXD0p_qARa9JTdhBTc,21530
39
39
  GameSentenceMiner/util/gsm_utils.py,sha256=iRyLVcodMptRhkCzLf3hyqc6_RCktXnwApi6mLju6oQ,11565
40
40
  GameSentenceMiner/util/model.py,sha256=hmA_seopP2bK40v9T4ulua9TrAeWtbkdCv-sTBPBQDk,6660
41
- GameSentenceMiner/util/notification.py,sha256=uZbaIpyNE2GSiGOT64sKLkHL1AShifqo6vYgZhH6CKo,4021
41
+ GameSentenceMiner/util/notification.py,sha256=-qk3kTKEERzmMxx5XMh084HCyFmbfqz0XjY1hTKhCeQ,4202
42
42
  GameSentenceMiner/util/package.py,sha256=u1ym5z869lw5EHvIviC9h9uH97bzUXSXXA8KIn8rUvk,1157
43
43
  GameSentenceMiner/util/ss_selector.py,sha256=cbjMxiKOCuOfbRvLR_PCRlykBrGtm1LXd6u5czPqkmc,4793
44
44
  GameSentenceMiner/util/text_log.py,sha256=38b5Qrluev2zTxoKZ1BS06DBsoycZQ5HB0YYGeFF1Q4,6290
@@ -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.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
71
- gamesentenceminer-2.13.2.dist-info/METADATA,sha256=-Po12aXrmiAHnlwBIjjwRVzClV-FxfyTY-V7ZLCGzqs,1463
72
- gamesentenceminer-2.13.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- gamesentenceminer-2.13.2.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
74
- gamesentenceminer-2.13.2.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
75
- gamesentenceminer-2.13.2.dist-info/RECORD,,
70
+ gamesentenceminer-2.13.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
71
+ gamesentenceminer-2.13.3.dist-info/METADATA,sha256=AZNqvNeFlhNBDg2mcmO2hFYvR18DgQb_pTBIonGBPyk,1463
72
+ gamesentenceminer-2.13.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ gamesentenceminer-2.13.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
74
+ gamesentenceminer-2.13.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
75
+ gamesentenceminer-2.13.3.dist-info/RECORD,,