Fix an issue with old symbols paths

This commit is contained in:
Julien Duponchelle committed 2016-09-15 18:21:39 +02:00
1 parent da5e3d0e54
commit 37f972dea1
3 files changed
+24 -3

No files matched your search

+4
View File
@@ -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)
+6 -1
View File
@@ -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: