install: updates to support building deb/rpm packages that contain python wheels and install core from a single file, updates to core to install scripts by way of python directly
This commit is contained in:
parent
cd6bb319ad
commit
fcf6f30302
54 changed files with 528 additions and 187 deletions
50
daemon/core/scripts/gui.py
Executable file
50
daemon/core/scripts/gui.py
Executable file
|
@ -0,0 +1,50 @@
|
|||
import argparse
|
||||
import logging
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
|
||||
from core.gui import appconfig, images
|
||||
from core.gui.app import Application
|
||||
|
||||
|
||||
def main() -> None:
|
||||
# parse flags
|
||||
parser = argparse.ArgumentParser(description="CORE Python GUI")
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--level",
|
||||
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||
default="INFO",
|
||||
help="logging level",
|
||||
)
|
||||
parser.add_argument("-p", "--proxy", action="store_true", help="enable proxy")
|
||||
parser.add_argument("-s", "--session", type=int, help="session id to join")
|
||||
parser.add_argument(
|
||||
"--create-dir", action="store_true", help="create gui directory and exit"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# check home directory exists and create if necessary
|
||||
appconfig.check_directory()
|
||||
if args.create_dir:
|
||||
return
|
||||
|
||||
# setup logging
|
||||
log_format = "%(asctime)s - %(levelname)s - %(module)s:%(funcName)s - %(message)s"
|
||||
stream_handler = logging.StreamHandler()
|
||||
file_handler = TimedRotatingFileHandler(
|
||||
filename=appconfig.LOG_PATH, when="D", backupCount=5
|
||||
)
|
||||
log_level = logging.getLevelName(args.level)
|
||||
logging.basicConfig(
|
||||
level=log_level, format=log_format, handlers=[stream_handler, file_handler]
|
||||
)
|
||||
logging.getLogger("PIL").setLevel(logging.ERROR)
|
||||
|
||||
# start app
|
||||
images.load_all()
|
||||
app = Application(args.proxy, args.session)
|
||||
app.mainloop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue