mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-15 02:20:57 +00:00
Read folder structure correctly for custom symbols. Fixes https://github.com/GNS3/gns3-gui/issues/2856
This commit is contained in:
parent
3dc4ea46d6
commit
a9e9ff071d
@ -99,10 +99,13 @@ class Symbols:
|
|||||||
if filename.startswith('.'):
|
if filename.startswith('.'):
|
||||||
continue
|
continue
|
||||||
symbol_file = posixpath.normpath(os.path.relpath(os.path.join(root, filename), directory)).replace('\\', '/')
|
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,
|
symbols.append({'symbol_id': symbol_file,
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'builtin': False,
|
'builtin': False,
|
||||||
'theme': "Custom symbols"})
|
'theme': theme})
|
||||||
self._symbols_path[symbol_file] = os.path.join(root, filename)
|
self._symbols_path[symbol_file] = os.path.join(root, filename)
|
||||||
|
|
||||||
symbols.sort(key=lambda x: x["filename"])
|
symbols.sort(key=lambda x: x["filename"])
|
||||||
|
Loading…
Reference in New Issue
Block a user