eric6/WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py

changeset 8205
4a0f1f896341
parent 8143
2c730d5fd177
child 8218
7c09585bd960
--- a/eric6/WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py	Thu Apr 08 17:27:12 2021 +0200
+++ b/eric6/WebBrowser/Bookmarks/BookmarksImporters/SafariImporter.py	Thu Apr 08 18:27:47 2021 +0200
@@ -29,31 +29,31 @@
         (string)
     @exception ValueError raised to indicate an invalid browser ID
     """
-    if sourceId == "safari":
-        if Globals.isWindowsPlatform():
-            standardDir = os.path.expandvars(
-                "%APPDATA%\\Apple Computer\\Safari")
-        elif Globals.isMacPlatform():
-            standardDir = os.path.expanduser("~/Library/Safari")
-        else:
-            standardDir = ""
-        return (
-            UI.PixmapCache.getPixmap("safari"),
-            "Apple Safari",
-            "Bookmarks.plist",
-            QCoreApplication.translate(
-                "SafariImporter",
-                """Apple Safari stores its bookmarks in the"""
-                """ <b>Bookmarks.plist</b> file. This file is usually"""
-                """ located in"""),
-            QCoreApplication.translate(
-                "SafariImporter",
-                """Please choose the file to begin importing bookmarks."""),
-            standardDir,
-        )
-    else:
+    if sourceId != "safari":
         raise ValueError(
             "Unsupported browser ID given ({0}).".format(sourceId))
+    
+    if Globals.isWindowsPlatform():
+        standardDir = os.path.expandvars(
+            "%APPDATA%\\Apple Computer\\Safari")
+    elif Globals.isMacPlatform():
+        standardDir = os.path.expanduser("~/Library/Safari")
+    else:
+        standardDir = ""
+    return (
+        UI.PixmapCache.getPixmap("safari"),
+        "Apple Safari",
+        "Bookmarks.plist",
+        QCoreApplication.translate(
+            "SafariImporter",
+            """Apple Safari stores its bookmarks in the"""
+            """ <b>Bookmarks.plist</b> file. This file is usually"""
+            """ located in"""),
+        QCoreApplication.translate(
+            "SafariImporter",
+            """Please choose the file to begin importing bookmarks."""),
+        standardDir,
+    )
 
 
 class SafariImporter(BookmarksImporter):

eric ide

mercurial