Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@
Create a venv and activate it.

```bash
virtualenv venv --python=python3.7.4
virtualenv venv --python=python3.12
source venv/bin/activate
```

or alternatively if you have issues use conda:

```bash
conda create -n game2text python=3.12
conda activate game2text
```

Install requirements:

```bash
Expand Down
19 changes: 16 additions & 3 deletions game2text.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
from util import RepeatedTimer, create_directory_if_not_exists, get_default_browser_name, get_PID_list, format_output
from textractor import Textractor
from tools import path_to_textractor, open_folder_textractor_path
from pynput import keyboard
try:
from pynput import keyboard
_pynput_available = True
except Exception as e:
print(f"[Warning] pynput not available or failed to initialize: {e}\nGlobal hotkeys will be disabled.")
_pynput_available = False
from clipboard import clipboard_to_output, text_to_clipboard
from logger import get_time_string, log_text, log_media, update_log_text
from ankiconnect import invoke, get_anki_models, update_anki_models, create_anki_note, fetch_anki_fields
Expand Down Expand Up @@ -225,5 +230,13 @@ def run_eel():
clipboard_timer = RepeatedTimer(1, clipboard_to_output)
clipboard_timer.stop() # stop the initial timer

with keyboard.GlobalHotKeys(hotkey_map) as listener:
listener.join()



if _pynput_available:
try:
with keyboard.GlobalHotKeys(hotkey_map) as listener: listener.join()
except Exception as e:
print(f"[Warning] Failed to start global hotkeys: {e}\nContinuing without keybindings.")
else:
print("[Info] Global hotkeys are disabled.")
2 changes: 1 addition & 1 deletion gamescript.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tkinter import *
from tkinter.filedialog import askopenfile
from shutil import copyfile
from fuzzywuzzy import process
from thefuzz import process
from config import r_config, w_config, LOG_CONFIG, SCRIPT_MATCH_CONFIG
from tools import bundle_dir

Expand Down
26 changes: 12 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
bottle==0.12.25
bottle==0.13.4
bottle-websocket==0.2.9
certifi==2020.11.8
cffi==1.14.4
Eel==0.16.0
cffi==2.0.0
eel==0.18.2
future==0.18.2
fuzzywuzzy==0.18.0
idna==3.4
numpy==1.26.0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency numpy throws an error for me. Is this needed for win/mac or other distros?

opencv-python==4.8.0.76
parse==1.19.0
Pillow==10.0.1
psutil==5.9.5
opencv-python==4.12.0.88
parse==1.20.2
Pillow==10.4.0
psutil==7.0.0
pycparser==2.21
pydub==0.25.1
pyinstaller==5.13.2
Expand All @@ -22,17 +20,17 @@ pyparsing==2.4.7
pyperclip==1.8.2
pytesseract==0.3.10
python-xlib==0.29
python-Levenshtein==0.12.2
pywin32-ctypes==0.2.0
PyYAML==6.0.1
requests==2.31.0
requests==2.32.5
six==1.16.0
thefuzz==0.22.1
tk==0.1.0
transformers==4.27.4
Copy link
Author

@Dollique Dollique Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency transformers throws an error for me. Is this needed for win/mac or other distros?

translators==5.8.3
urllib3==1.26.2
translators==6.0.1
urllib3==2.5.0
whichcraft==0.6.1
wexpect==4.0.0; sys_platform == 'win32'
wurlitzer>=3.0.2,<4.0.0; sys_platform == 'darwin'
xkbcommon==1.5.1
zope.event==5.0
zope.interface==6.0
2 changes: 1 addition & 1 deletion util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_default_browser_name():
return browser_map[browser]
else:
return 'chromium'
return 'chrome'
return 'default'

def get_PID_list():
if platform.system() == 'Darwin': # Not available for Mac
Expand Down