--- a/eric6/WebBrowser/Bookmarks/BookmarksImporters/FirefoxImporter.py Thu Apr 08 17:27:12 2021 +0200 +++ b/eric6/WebBrowser/Bookmarks/BookmarksImporters/FirefoxImporter.py Thu Apr 08 18:27:47 2021 +0200 @@ -29,32 +29,32 @@ (string) @exception ValueError raised to indicate an invalid browser ID """ - if sourceId == "firefox": - if Globals.isWindowsPlatform(): - standardDir = os.path.expandvars( - "%APPDATA%\\Mozilla\\Firefox\\Profiles") - elif Globals.isMacPlatform(): - standardDir = os.path.expanduser( - "~/Library/Application Support/Firefox/Profiles") - else: - standardDir = os.path.expanduser("~/.mozilla/firefox") - return ( - UI.PixmapCache.getPixmap("chrome"), - "Mozilla Firefox", - "places.sqlite", - QCoreApplication.translate( - "FirefoxImporter", - """Mozilla Firefox stores its bookmarks in the""" - """ <b>places.sqlite</b> SQLite database. This file is""" - """ usually located in"""), - QCoreApplication.translate( - "FirefoxImporter", - """Please choose the file to begin importing bookmarks."""), - standardDir, - ) - else: + if sourceId != "firefox": raise ValueError( "Unsupported browser ID given ({0}).".format(sourceId)) + + if Globals.isWindowsPlatform(): + standardDir = os.path.expandvars( + "%APPDATA%\\Mozilla\\Firefox\\Profiles") + elif Globals.isMacPlatform(): + standardDir = os.path.expanduser( + "~/Library/Application Support/Firefox/Profiles") + else: + standardDir = os.path.expanduser("~/.mozilla/firefox") + return ( + UI.PixmapCache.getPixmap("chrome"), + "Mozilla Firefox", + "places.sqlite", + QCoreApplication.translate( + "FirefoxImporter", + """Mozilla Firefox stores its bookmarks in the""" + """ <b>places.sqlite</b> SQLite database. This file is""" + """ usually located in"""), + QCoreApplication.translate( + "FirefoxImporter", + """Please choose the file to begin importing bookmarks."""), + standardDir, + ) class FirefoxImporter(BookmarksImporter):