eric6/WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py

changeset 8205
4a0f1f896341
parent 8143
2c730d5fd177
child 8218
7c09585bd960
--- a/eric6/WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py	Thu Apr 08 17:27:12 2021 +0200
+++ b/eric6/WebBrowser/Bookmarks/BookmarksImporters/XbelImporter.py	Thu Apr 08 18:27:47 2021 +0200
@@ -27,6 +27,10 @@
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
+    if sourceId not in ("e5browser", "konqueror", "xbel"):
+        raise ValueError(
+            "Unsupported browser ID given ({0}).".format(sourceId))
+    
     if sourceId == "e5browser":
         from ..BookmarksManager import BookmarksManager
         bookmarksFile = BookmarksManager.getFileName()
@@ -65,7 +69,7 @@
                 """Please choose the file to begin importing bookmarks."""),
             standardDir,
         )
-    elif sourceId == "xbel":
+    else:
         return (
             UI.PixmapCache.getPixmap("xbel"),
             "XBEL Bookmarks",
@@ -81,9 +85,6 @@
                 """Please choose the file to begin importing bookmarks."""),
             "",
         )
-    else:
-        raise ValueError(
-            "Unsupported browser ID given ({0}).".format(sourceId))
 
 
 class XbelImporter(BookmarksImporter):

eric ide

mercurial