-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat! built-in http server, socket and http on same port
- Loading branch information
1 parent
b8d3639
commit 8f88992
Showing
7 changed files
with
102 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sys | ||
import os | ||
import sys | ||
import sys | ||
|
||
def resource_path(relative_path): | ||
""" Get the absolute path to the resource, works for development and for PyInstaller """ | ||
# PyInstaller creates a temp folder and stores path in _MEIPASS | ||
base_path: str = getattr(sys, '_MEIPASS', os.path.abspath('.')) | ||
return os.path.join(base_path, relative_path) | ||
|
||
def parse_cmd_args(default_host, default_port): | ||
|
||
host = sys.argv[1] if len(sys.argv) > 1 else default_host | ||
port = int(sys.argv[2]) if len(sys.argv) > 2 else default_port | ||
|
||
if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"): | ||
print(f"Usage: {sys.argv[0]} [host] [port]") | ||
print(f"Example: {sys.argv[0]} 127.0.0.1 8080") | ||
print(f"Default host: {default_host}") | ||
print(f"Default port: {default_port}") | ||
return None, None | ||
|
||
return host,port | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
pushd ui || exit 2 | ||
npm run build | ||
popd || exit 2 | ||
|
||
pyinstaller backend/main_server.py --collect-submodules dbus_fast | ||
pyinstaller --add-data ui/dist:ui ui/serve.py | ||
pyinstaller --onefile --add-data "./version.txt:/" --add-data "./ui/dist:/gui" backend/main.py --collect-submodules dbus_fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters