mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
API for uploading symbols
This commit is contained in:
4 files changed
+33
-7
No files matched your search
@@ -43,7 +43,7 @@ class Symbols:
|
||||
'builtin': True,
|
||||
})
|
||||
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file)
|
||||
directory = self._symbol_path()
|
||||
directory = self.symbols_path()
|
||||
if directory:
|
||||
for file in os.listdir(directory):
|
||||
if file.startswith('.'):
|
||||
@@ -56,12 +56,11 @@ class Symbols:
|
||||
})
|
||||
self._symbols_path[symbol_id] = os.path.join(get_resource("symbols"), file)
|
||||
|
||||
|
||||
symbols.sort(key=lambda x: x["filename"])
|
||||
|
||||
return symbols
|
||||
|
||||
def _symbol_path(self):
|
||||
def symbols_path(self):
|
||||
directory = os.path.expanduser(Config.instance().get_section_config("Server").get("symbols_path", "~/GNS3/symbols"))
|
||||
if directory:
|
||||
os.makedirs(directory, exist_ok=True)
|
||||
|
||||
Reference in new issue
Block a user