diff --git a/README.md b/README.md index d25c58f..7858da8 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Not likely. Unless you go around telling everyone you have an instalocker. Don't - For your convinience, simply use `install.bat` and then `build.bat` after downloading the repository for a smooth, automated process! After that, you're done. If you insist otherwise, follow ahead. -- Use a python version lower than 3.12 or you'll end up with [this error](https://stackoverflow.com/questions/77232001/python-eel-module-unable-to-use-import-bottle-ext-websocket-as-wbs-modulenotfoun). I used 3.10.10. +- Use a python version lower than 3.12 or you'll end up with [this error](https://stackoverflow.com/questions/77232001/python-eel-module-unable-to-use-import-bottle-ext-websocket-as-wbs-modulenotfoun). You also cannot use python 3.10.0 because there is a [pyinstaller issue](https://github.com/pyinstaller/pyinstaller/issues/6301) with it. I used 3.10.10. - Run `python -m pip install -r requirements.txt` diff --git a/install_and_build/install.py b/install_and_build/install.py index 1029223..d166aca 100644 --- a/install_and_build/install.py +++ b/install_and_build/install.py @@ -3,13 +3,16 @@ # Get the major and minor numbers of the current python version -PYTHON_VER = dict( zip( ("major", "minor"), tuple( sys.version_info ) [ 0 : 2 ] ) ) +PYTHON_VER = dict( zip( ("major", "minor", "patch"), tuple( sys.version_info ) [ 0 : 3 ] ) ) # If the python version is 3.12 or more, back out. if PYTHON_VER['major'] >= 3 and PYTHON_VER['minor'] >= 12: raise Exception("Your python version must not exceed 3.11 due to compatibility issues with bottle.py (https://github.com/bottlepy/bottle/issues/1430)") +if PYTHON_VER['major'] == 3 and PYTHON_VER["minor"] == 10 and PYTHON_VER["patch"] == 0: + raise Exception("Your python is 3.10.0 which is known to have issues with pyinstaller (https://github.com/pyinstaller/pyinstaller/issues/6301).") + # Install the dependencies print("Installing dependencies") os.system('cd .. && python -m pip install -r requirements.txt') diff --git a/main.py b/main.py index 97827d2..42eb20a 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ import webbrowser import os import psutil -import json +import requests """ CONSTANTS @@ -42,8 +42,7 @@ def get_agent_codes(): """ Fetches the agent codes from ./web/json/agents.json (localhost/json/agents.json) """ - with open('./web/json/agents.json') as agents: - return json.load(agents) + return requests.get("http://localhost:4089/json/agents.json").json() def get_region(): """ @@ -70,7 +69,7 @@ def errorAlert(line1, line2, time): eel.askUserToChooseAgent() -@eel.expose +@eel.expose def stop_lock(): """ Change state from running to disabled to stop the locking process @@ -181,8 +180,8 @@ def open_github(): """ eel.init("web") -# Try launching with chrome, otherwise launch it in their default browser. +# Try launching with chrome, otherwise launch it in their default browser in port 4089 try: - eel.start("index.html", size=(SCREEN_DIMENSIONS), port=0,) + eel.start("index.html", size=(SCREEN_DIMENSIONS), port=4089,) except OSError: - eel.start("index.html", size=(SCREEN_DIMENSIONS), port=0, mode="default") + eel.start("index.html", size=(SCREEN_DIMENSIONS), port=4089, mode="default")