mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix an issue with old symbols paths
This commit is contained in:
3 files changed
+24
-3
No files matched your search
@@ -204,6 +204,10 @@ class Node:
|
||||
|
||||
@symbol.setter
|
||||
def symbol(self, val):
|
||||
# No abs path, fix them (bug of 1.X)
|
||||
if not val.startswith(":") and os.path.abspath(val):
|
||||
val = os.path.basename(val)
|
||||
|
||||
self._symbol = val
|
||||
try:
|
||||
self._width, self._height, filetype = self._project.controller.symbols.get_size(val)
|
||||
|
||||
@@ -70,7 +70,12 @@ class Symbols:
|
||||
return directory
|
||||
|
||||
def get_path(self, symbol_id):
|
||||
return self._symbols_path[symbol_id]
|
||||
try:
|
||||
return self._symbols_path[symbol_id]
|
||||
# Symbol not found refresh cache
|
||||
except KeyError:
|
||||
self.list()
|
||||
return self._symbols_path[symbol_id]
|
||||
|
||||
def get_size(self, symbol_id):
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user