mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-23 14:42:28 +00:00
Fix an error if you don't have permissions on your symbols directory
Fix #872
This commit is contained in:
parent
a1a677fcd3
commit
f90e6f2f5b
@ -29,7 +29,10 @@ class Symbols:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.list()
|
try:
|
||||||
|
self.list()
|
||||||
|
except OSError: # The error will be raised and forward later
|
||||||
|
pass
|
||||||
# Keep a cache of symbols size
|
# Keep a cache of symbols size
|
||||||
self._symbol_size_cache = {}
|
self._symbol_size_cache = {}
|
||||||
|
|
||||||
@ -79,7 +82,7 @@ class Symbols:
|
|||||||
return self._symbols_path[symbol_id]
|
return self._symbols_path[symbol_id]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return self._symbols_path[":/symbols/computer.svg"]
|
return self._symbols_path[":/symbols/computer.svg"]
|
||||||
|
|
||||||
def get_size(self, symbol_id):
|
def get_size(self, symbol_id):
|
||||||
try:
|
try:
|
||||||
return self._symbol_size_cache[symbol_id]
|
return self._symbol_size_cache[symbol_id]
|
||||||
|
Loading…
Reference in New Issue
Block a user