From ecefb594586832f6d41b76e35795e5a8398ffe10 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 6 Jun 2021 17:21:45 +1000 Subject: [PATCH] added icons for paths into a dict ICON, and func to retrieve the icon based on objects type of path --- shared.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared.py b/shared.py index 54cd0aa..bb79f7f 100644 --- a/shared.py +++ b/shared.py @@ -4,6 +4,12 @@ import os hostname = socket.gethostname() PROD_HOST="pa_web" +ICON={} +ICON["Import"]="fa-file-upload" +ICON["Storage"]="fa-database" +ICON["Bin"]="fa-trash-alt" + + if hostname == PROD_HOST: PA_JOB_MANAGER_HOST="192.168.0.2" DB_URL = 'postgresql+psycopg2://pa:for_now_pa@192.168.0.2:55432/pa' @@ -41,6 +47,11 @@ def CreateFoldersSelect(selected): str += '' str += '' return str + +def LocationIcon(obj): + print( f"LocationIcon( {obj.in_dir.in_path.type.name} ) == {ICON[obj.in_dir.in_path.type.name]}" ) + return ICON[obj.in_dir.in_path.type.name] + def SymlinkName(ptype, path, file):