From 2480ea6b05087a3832732d2f1dd4a1c15ee6a7ba Mon Sep 17 00:00:00 2001 From: j Date: Fri, 10 Aug 2018 11:59:56 +0100 Subject: [PATCH 1/2] symlink subfolder --- install.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install.py b/install.py index 592b6d9..76da228 100755 --- a/install.py +++ b/install.py @@ -12,12 +12,21 @@ os.chdir(base) for root, folders, files in os.walk(join(base, 'static')): for f in files: src = join(root, f) + if 'ontology/' in src: + continue target = src.replace(base, '/srv/pandora') rel_src = os.path.relpath(src, dirname(target)) if os.path.exists(target): os.unlink(target) os.symlink(rel_src, target) +src = join(base, 'static', 'ontology') +target = src.replace(base, '/srv/pandora') +rel_src = os.path.relpath(src, dirname(target)) +if os.path.exists(target): + os.unlink(target) +os.symlink(rel_src, target) + os.chdir(base) src = join(base, 'config.jsonc') target = '/srv/pandora/pandora/config.%s.jsonc' % name From 486baac69cae47a2a3c115489492033e9a38e6c6 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 10 Aug 2018 12:18:49 +0100 Subject: [PATCH 2/2] sort children --- ontology/update.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ontology/update.py b/ontology/update.py index de51c31..c4dfb43 100755 --- a/ontology/update.py +++ b/ontology/update.py @@ -22,10 +22,12 @@ def find_path(parent, root=None, path=None): return r def get_node(name, children, parent=None): + children_ = [get_node(child, children[child], name) for child in children] + children_.sort(key=lambda c: c['name']) node = { "size": len(children) + 100, "name": name, - "children": [get_node(child, children[child], name) for child in children] + "children": children_ } if not node['children']: del node['children']