1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +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):
self._symbols_path = {}
symbols = []
for file in os.listdir(get_resource("symbols")):
if file.startswith('.'):
continue
symbol_id = ':/symbols/' + file
symbols.append({
'symbol_id': symbol_id,
'filename': file,
'builtin': True,
})
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file)
if get_resource("symbols"):
for file in os.listdir(get_resource("symbols")):
if file.startswith('.'):
continue
symbol_id = ':/symbols/' + file
symbols.append({
'symbol_id': symbol_id,
'filename': file,
'builtin': True,
})
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file)
directory = self.symbols_path()
if directory:
for file in os.listdir(directory):