From a9e9ff071df17bc830feab6aac859312ead660d5 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 19 Jul 2020 17:46:49 +0930 Subject: [PATCH] Read folder structure correctly for custom symbols. Fixes https://github.com/GNS3/gns3-gui/issues/2856 --- gns3server/controller/symbols.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/symbols.py b/gns3server/controller/symbols.py index bd89dea2..3109fa9b 100644 --- a/gns3server/controller/symbols.py +++ b/gns3server/controller/symbols.py @@ -99,10 +99,13 @@ class Symbols: if filename.startswith('.'): continue symbol_file = posixpath.normpath(os.path.relpath(os.path.join(root, filename), directory)).replace('\\', '/') + theme = posixpath.dirname(symbol_file).replace('/', '-').capitalize() + if not theme: + theme = "Custom symbols" symbols.append({'symbol_id': symbol_file, 'filename': filename, 'builtin': False, - 'theme': "Custom symbols"}) + 'theme': theme}) self._symbols_path[symbol_file] = os.path.join(root, filename) symbols.sort(key=lambda x: x["filename"])