GameSentenceMiner 2.10.3__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.
GameSentenceMiner/anki.py CHANGED
@@ -88,10 +88,13 @@ def update_anki_card(last_note: AnkiCard, note=None, audio_path='', video_path='
88
88
 
89
89
 
90
90
  tags = []
91
+ if get_config().anki.add_game_tag:
92
+ game = get_current_game().replace(" ", "").replace("::", "")
93
+ if get_config().anki.parent_tag:
94
+ game = f"{get_config().anki.parent_tag}::{game}"
95
+ tags.append(game)
91
96
  if get_config().anki.custom_tags:
92
97
  tags.extend(get_config().anki.custom_tags)
93
- if get_config().anki.add_game_tag:
94
- tags.append(get_current_game().replace(" ", ""))
95
98
  if tags:
96
99
  tag_string = " ".join(tags)
97
100
  invoke("addTags", tags=tag_string, notes=[last_note.noteId])
@@ -85,7 +85,7 @@ class ConfigApp:
85
85
  self.window.protocol("WM_DELETE_WINDOW", self.hide)
86
86
  self.obs_scene_listbox_changed = False
87
87
 
88
- self.window.geometry("800x600")
88
+ self.window.geometry("800x700")
89
89
  self.current_row = 0
90
90
 
91
91
  self.master_config: Config = configuration.load_config()
@@ -116,13 +116,13 @@ class ConfigApp:
116
116
  ttk.Button(button_frame, text="Save Settings", command=self.save_settings, bootstyle="success").grid(row=0,
117
117
  column=0,
118
118
  padx=10)
119
- # if len(self.master_config.configs) > 1:
120
- # ttk.Button(button_frame, text="Save and Sync Changes",
121
- # command=lambda: self.save_settings(profile_change=False, sync_changes=True),
122
- # bootstyle="info").grid(row=0, column=1, padx=10)
123
- # HoverInfoWidget(button_frame,
124
- # "Saves Settings and Syncs changed settings to all profiles (if you have them)", row=0,
125
- # column=2)
119
+ if len(self.master_config.configs) > 1:
120
+ ttk.Button(button_frame, text="Save and Sync Changes",
121
+ command=lambda: self.save_settings(profile_change=False, sync_changes=True),
122
+ bootstyle="info").grid(row=0, column=1, padx=10)
123
+ HoverInfoWidget(button_frame,
124
+ "Saves Settings and Syncs CHANGED SETTINGS to all profiles.", row=0,
125
+ column=2)
126
126
 
127
127
  self.window.withdraw()
128
128
 
@@ -169,8 +169,7 @@ class ConfigApp:
169
169
 
170
170
  # Create a new Config instance
171
171
  config = ProfileConfig(
172
- scenes=[self.obs_scene_listbox.get(i) for i in
173
- self.obs_scene_listbox.curselection()] if self.obs_scene_listbox_changed else self.settings.scenes,
172
+ scenes=self.settings.scenes,
174
173
  general=General(
175
174
  use_websocket=self.websocket_enabled.get(),
176
175
  use_clipboard=self.clipboard_enabled.get(),
@@ -205,6 +204,7 @@ class ConfigApp:
205
204
  overwrite_audio=self.overwrite_audio.get(),
206
205
  overwrite_picture=self.overwrite_picture.get(),
207
206
  multi_overwrites_sentence=self.multi_overwrites_sentence.get(),
207
+ parent_tag=self.parent_tag.get(),
208
208
  ),
209
209
  features=Features(
210
210
  full_auto=self.full_auto.get(),
@@ -356,7 +356,6 @@ class ConfigApp:
356
356
  self.create_profiles_tab()
357
357
  self.create_advanced_tab()
358
358
  self.create_ai_tab()
359
- self.create_help_tab() # Re-add help tab for modern styling consistent application
360
359
 
361
360
  def increment_row(self):
362
361
  """Increment the current row index and return the new value."""
@@ -749,6 +748,18 @@ class ConfigApp:
749
748
  ttk.Checkbutton(anki_frame, variable=self.add_game_tag, bootstyle="round-toggle").grid(row=self.current_row,
750
749
  column=1, sticky='W',
751
750
  pady=2)
751
+
752
+ self.current_row += 1
753
+
754
+ HoverInfoLabelWidget(anki_frame, text="Game Parent Tag:",
755
+ foreground="green", font=("Helvetica", 10, "bold"),
756
+ tooltip="Parent tag for the Game Tag. If empty, no parent tag will be added. i.e. Game::{Game_Title}. You can think of this as a \"Folder\" for your tags",
757
+ row=self.current_row, column=0)
758
+ self.parent_tag = ttk.Entry(anki_frame, width=50)
759
+ self.parent_tag.insert(0, self.settings.anki.parent_tag)
760
+ self.parent_tag.grid(row=self.current_row, column=1, sticky='EW', pady=2)
761
+
762
+
752
763
  self.current_row += 1
753
764
 
754
765
  HoverInfoLabelWidget(anki_frame, text="Overwrite Audio:", tooltip="Overwrite existing audio in Anki cards.",
@@ -1232,6 +1243,8 @@ class ConfigApp:
1232
1243
  profiles_frame.grid_rowconfigure(row, minsize=30)
1233
1244
 
1234
1245
  def on_obs_scene_select(self, event):
1246
+ self.settings.scenes = [self.obs_scene_listbox.get(i) for i in
1247
+ self.obs_scene_listbox.curselection()]
1235
1248
  self.obs_scene_listbox_changed = True
1236
1249
 
1237
1250
  def refresh_obs_scenes(self):
@@ -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+
@@ -353,12 +353,15 @@ def add_ss_hotkey(ss_hotkey="ctrl+shift+g"):
353
353
  img = sct.grab(main_monitor)
354
354
  img_bytes = mss.tools.to_png(img.rgb, img.size)
355
355
  do_second_ocr("", datetime.now(), img_bytes, filtering)
356
+ hotkey_reg = None
356
357
  try:
357
- keyboard.add_hotkey(ss_hotkey, capture)
358
+ hotkey_reg = keyboard.add_hotkey(ss_hotkey, capture)
358
359
  if "f13" in ss_hotkey.lower():
359
360
  keyboard.add_hotkey(secret_ss_hotkey, capture_main_monitor)
360
361
  print(f"Press {ss_hotkey} to take a screenshot.")
361
362
  except Exception as e:
363
+ if hotkey_reg:
364
+ keyboard.remove_hotkey(hotkey_reg)
362
365
  logger.error(f"Error setting up screenshot hotkey with keyboard, Attempting Backup: {e}")
363
366
  logger.debug(e)
364
367
  pynput_hotkey = ss_hotkey.replace("ctrl", "<ctrl>").replace("shift", "<shift>").replace("alt", "<alt>")
@@ -120,6 +120,7 @@ class Anki:
120
120
  overwrite_audio: bool = False
121
121
  overwrite_picture: bool = True
122
122
  multi_overwrites_sentence: bool = True
123
+ parent_tag: str = "Game"
123
124
 
124
125
  def __post_init__(self):
125
126
  if self.custom_tags is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.10.3
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
@@ -1,6 +1,6 @@
1
1
  GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- GameSentenceMiner/anki.py,sha256=0Y_LwTLpRBEt0HKu1o-6FqHbEJt3WWuOjFYehzMczz0,16492
3
- GameSentenceMiner/config_gui.py,sha256=OqXEyWNlWwlBBxaDP4Iu-tN6FQHKVVcp4t239dGpylc,89688
2
+ GameSentenceMiner/anki.py,sha256=kWw3PV_Jj5-lHcttCB3lRXejHlaAbiJ2Ag_NAGX-RI8,16632
3
+ GameSentenceMiner/config_gui.py,sha256=gd-3K7lOv0inaf-mRkczXamsM0W7ypZR2s-qeNPIEY8,90234
4
4
  GameSentenceMiner/gametext.py,sha256=6VkjmBeiuZfPk8T6PHFdIAElBH2Y_oLVYvmcafqN7RM,6747
5
5
  GameSentenceMiner/gsm.py,sha256=XqzotCtGDo6ZVUW0nXxCjDr79IJJeYWYnXY3P575qjA,24533
6
6
  GameSentenceMiner/obs.py,sha256=YG8LwBf9BTsGbROm_Uq6LhFDSrbf3jgogp78rBbJq94,14728
@@ -16,10 +16,10 @@ 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
- GameSentenceMiner/ocr/owocr_helper.py,sha256=m_tIqujNTIZKQsqyL7AlzWM394aM77wL2l_S7LNFKlU,19886
22
+ GameSentenceMiner/ocr/owocr_helper.py,sha256=w4XYViFh5zh65SX25qUV0ge0SLEusekwP59JfmFkSgE,19991
23
23
  GameSentenceMiner/ocr/ss_picker.py,sha256=0IhxUdaKruFpZyBL-8SpxWg7bPrlGpy3lhTcMMZ5rwo,5224
24
24
  GameSentenceMiner/owocr/owocr/__init__.py,sha256=87hfN5u_PbL_onLfMACbc0F5j4KyIK9lKnRCj6oZgR0,49
25
25
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
@@ -30,7 +30,7 @@ GameSentenceMiner/owocr/owocr/run.py,sha256=wOileOoP1djCpOLgg7d-nWrYS78NctClNTsc
30
30
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
31
31
  GameSentenceMiner/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  GameSentenceMiner/util/audio_offset_selector.py,sha256=8Stk3BP-XVIuzRv9nl9Eqd2D-1yD3JrgU-CamBywJmY,8542
33
- GameSentenceMiner/util/configuration.py,sha256=ibwIJlfhzjmlQJLhwnrcRJ7jImPN5S-pw62wa2eBZWo,28538
33
+ GameSentenceMiner/util/configuration.py,sha256=0kc6_i8uzw5P_V-F8grnasxTDEXBfI6LPgj6KnbRZ1k,28567
34
34
  GameSentenceMiner/util/electron_config.py,sha256=3VmIrcXhC-wIMMc4uqV85NrNenRl4ZUbnQfSjWEwuig,9852
35
35
  GameSentenceMiner/util/ffmpeg.py,sha256=t0tflxq170n8PZKkdw8fTZIUQfXD0p_qARa9JTdhBTc,21530
36
36
  GameSentenceMiner/util/gsm_utils.py,sha256=_279Fu9CU6FEh4cP6h40TWOt_BrqmPgytfumi8y53Ew,11491
@@ -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.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
66
- gamesentenceminer-2.10.3.dist-info/METADATA,sha256=UjHQv68bNu6u8cll7g3vUJLR1SuBnpKVc8nf7s43Emw,7354
67
- gamesentenceminer-2.10.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
68
- gamesentenceminer-2.10.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
69
- gamesentenceminer-2.10.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
70
- gamesentenceminer-2.10.3.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,,