mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31:13 +02:00
Use generic symbol names
This commit is contained in:
1 parent
b7f4a4cbda
commit
bfbac2e93a
15 files changed
+70
-44
No files matched your search
@@ -43,7 +43,7 @@ class Symbols:
|
||||
|
||||
# Keep a cache of symbols size
|
||||
self._symbol_size_cache = {}
|
||||
self._current_theme = "Classic"
|
||||
self._current_theme = "Affinity-square-blue"
|
||||
self._themes = BUILTIN_SYMBOL_THEMES
|
||||
|
||||
@property
|
||||
@@ -69,7 +69,7 @@ class Symbols:
|
||||
raise ControllerNotFoundError(f"Could not find symbol theme '{symbol_theme}'")
|
||||
symbol_path = theme.get(symbol)
|
||||
if symbol_path not in self._symbols_path:
|
||||
log.warning(f"Default symbol {symbol_path} was not found")
|
||||
log.warning(f"Default symbol {symbol} was not found")
|
||||
return None
|
||||
return symbol_path
|
||||
|
||||
@@ -125,7 +125,17 @@ class Symbols:
|
||||
|
||||
return self._symbols_path.get(symbol_id)
|
||||
|
||||
def resolve_symbol(self, symbol_name):
|
||||
|
||||
if not symbol_name.startswith(":/"):
|
||||
symbol = self.get_default_symbol(symbol_name, self._current_theme)
|
||||
if symbol:
|
||||
return symbol
|
||||
return symbol_name
|
||||
|
||||
def get_path(self, symbol_id):
|
||||
|
||||
symbol_id = self.resolve_symbol(symbol_id)
|
||||
try:
|
||||
return self._symbols_path[symbol_id]
|
||||
except KeyError:
|
||||
|
||||
Reference in new issue
Block a user