From 51787295ddc478b01068cf1f72eff2c586b1aa10 Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 23 Nov 2018 18:26:04 +0700 Subject: [PATCH] Use POSIX path for symbol ID. --- gns3server/controller/symbols.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/symbols.py b/gns3server/controller/symbols.py index d325357a..46664bc4 100644 --- a/gns3server/controller/symbols.py +++ b/gns3server/controller/symbols.py @@ -16,6 +16,7 @@ # along with this program. If not, see . import os +import posixpath from .symbol_themes import BUILTIN_SYMBOL_THEMES from ..utils.get_resource import get_resource @@ -65,7 +66,7 @@ class Symbols: for filename in files: if filename.startswith('.'): continue - symbol_file = os.path.relpath(os.path.join(root, filename), get_resource("symbols")) + symbol_file = posixpath.normpath(os.path.relpath(os.path.join(root, filename), get_resource("symbols"))) symbol_id = ':/symbols/' + symbol_file symbols.append({'symbol_id': symbol_id, 'filename': symbol_file, @@ -78,7 +79,7 @@ class Symbols: for filename in files: if filename.startswith('.'): continue - symbol_file = os.path.relpath(os.path.join(root, filename), directory) + symbol_file = posixpath.normpath(os.path.relpath(os.path.join(root, filename), directory)) symbols.append({'symbol_id': symbol_file, 'filename': symbol_file, 'builtin': False,})