From 89e215d93a915508e2f714caba3181d8e602c50c Mon Sep 17 00:00:00 2001 From: j Date: Tue, 17 Dec 2019 20:03:22 +0200 Subject: [PATCH] update icons --- install.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install.py b/install.py index e6bd6c3..1ad6f4d 100755 --- a/install.py +++ b/install.py @@ -25,11 +25,28 @@ for root, folders, files in os.walk(join(base, 'static')): for f in files: src = join(root, f) target = src.replace(base, '/srv/pandora') + target_folder = os.path.dirname(target) + if not os.path.exists(target_folder): + os.makedirs(target_folder) rel_src = os.path.relpath(src, dirname(target)) if os.path.exists(target): os.unlink(target) os.symlink(rel_src, target) + +for img in ('logo.png', 'icon.png'): + f = join('/srv/pandora/static/png', img) + custom = join('/srv/pandora/static/png', img.replace('.png', '.%s.png' % name)) + if os.path.exists(custom): + if not os.path.islink(f): + os.unlink(f) + else: + path = os.path.realpath(f) + if name not in path: + os.unlink(f) + if not os.path.exists(f): + os.symlink(os.path.basename(custom), f) + if overwrite: os.chdir('/srv/pandora/static/js') for filename, sitename in overwrite: