Skip to content

Commit

Permalink
Merge pull request #4 from SuppliedOrange/v1.1.1
Browse files Browse the repository at this point in the history
V1.1.1
  • Loading branch information
SuppliedOrange committed Nov 4, 2023
2 parents 88b00a3 + a87b65d commit cf87259
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
5 changes: 4 additions & 1 deletion install_and_build/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
13 changes: 6 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import webbrowser
import os
import psutil
import json
import requests

"""
CONSTANTS
Expand Down Expand Up @@ -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():
"""
Expand All @@ -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
Expand Down Expand Up @@ -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")

0 comments on commit cf87259

Please sign in to comment.