1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-30 20:28:08 +00:00

Fix error when you delete the builtin symbols directory

Fix #908
This commit is contained in:
Julien Duponchelle 2017-02-20 18:28:49 +01:00
parent 961c209ab1
commit b132d95a04
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -39,16 +39,17 @@ class Symbols:
def list(self): def list(self):
self._symbols_path = {} self._symbols_path = {}
symbols = [] symbols = []
for file in os.listdir(get_resource("symbols")): if get_resource("symbols"):
if file.startswith('.'): for file in os.listdir(get_resource("symbols")):
continue if file.startswith('.'):
symbol_id = ':/symbols/' + file continue
symbols.append({ symbol_id = ':/symbols/' + file
'symbol_id': symbol_id, symbols.append({
'filename': file, 'symbol_id': symbol_id,
'builtin': True, 'filename': file,
}) 'builtin': True,
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file) })
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file)
directory = self.symbols_path() directory = self.symbols_path()
if directory: if directory:
for file in os.listdir(directory): for file in os.listdir(directory):