renamed python gui to be more similar to other core scripts and specific to it being python, some cleanup to pygui edge drawing and updates to allow for edges to have an arc to support multiple links between the same nodes
This commit is contained in:
parent
8c8024df10
commit
cd8157eff7
6 changed files with 154 additions and 120 deletions
32
daemon/scripts/core-pygui
Executable file
32
daemon/scripts/core-pygui
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import logging
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
|
||||
from core.gui import appconfig
|
||||
from core.gui.app import Application
|
||||
from core.gui.images import Images
|
||||
|
||||
if __name__ == "__main__":
|
||||
# parse flags
|
||||
parser = argparse.ArgumentParser(description=f"CORE Python Tk 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")
|
||||
args = parser.parse_args()
|
||||
|
||||
# check home directory exists and create if necessary
|
||||
appconfig.check_directory()
|
||||
|
||||
# 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)
|
||||
app.mainloop()
|
Loading…
Add table
Add a link
Reference in a new issue