Helpviewer/Bookmarks/BookmarksImporters/IExplorerImporter.py

changeset 3002
6ffc581f00f1
parent 2954
bf0215fe12d1
child 3057
10516539f238
child 3160
209a07d7e401
equal deleted inserted replaced
3001:3674ff5fa8f8 3002:6ffc581f00f1
22 Module function to get information for the given source id. 22 Module function to get information for the given source id.
23 23
24 @param id id of the browser ("chrome" or "chromium") 24 @param id id of the browser ("chrome" or "chromium")
25 @return tuple with an icon (QPixmap), readable name (string), name of 25 @return tuple with an icon (QPixmap), readable name (string), name of
26 the default bookmarks file (string), an info text (string), 26 the default bookmarks file (string), an info text (string),
27 a prompt (string) and the default directory of the bookmarks file (string) 27 a prompt (string) and the default directory of the bookmarks file
28 (string)
28 @exception ValueError raised to indicate an invalid browser ID 29 @exception ValueError raised to indicate an invalid browser ID
29 """ 30 """
30 if id == "ie": 31 if id == "ie":
31 if Globals.isWindowsPlatform(): 32 if Globals.isWindowsPlatform():
32 standardDir = os.path.expandvars( 33 standardDir = os.path.expandvars(
35 standardDir = "" 36 standardDir = ""
36 return ( 37 return (
37 UI.PixmapCache.getPixmap("internet_explorer.png"), 38 UI.PixmapCache.getPixmap("internet_explorer.png"),
38 "Internet Explorer", 39 "Internet Explorer",
39 "", 40 "",
40 QCoreApplication.translate("IExplorerImporter", 41 QCoreApplication.translate(
41 """Internet Explorer stores its bookmarks in the <b>Favorites</b> """ 42 "IExplorerImporter",
42 """folder This folder is usually located in"""), 43 """Internet Explorer stores its bookmarks in the"""
43 QCoreApplication.translate("IExplorerImporter", 44 """ <b>Favorites</b> folder This folder is usually"""
45 """ located in"""),
46 QCoreApplication.translate(
47 "IExplorerImporter",
44 """Please choose the folder to begin importing bookmarks."""), 48 """Please choose the folder to begin importing bookmarks."""),
45 standardDir, 49 standardDir,
46 ) 50 )
47 else: 51 else:
48 raise ValueError("Unsupported browser ID given ({0}).".format(id)) 52 raise ValueError("Unsupported browser ID given ({0}).".format(id))
126 if line.startswith("URL="): 130 if line.startswith("URL="):
127 url = line.replace("URL=", "") 131 url = line.replace("URL=", "")
128 break 132 break
129 if url: 133 if url:
130 if dir in folders: 134 if dir in folders:
131 bookmark = BookmarkNode(BookmarkNode.Bookmark, folders[dir]) 135 bookmark = BookmarkNode(BookmarkNode.Bookmark,
136 folders[dir])
132 else: 137 else:
133 bookmark = BookmarkNode(BookmarkNode.Bookmark, importRootNode) 138 bookmark = BookmarkNode(BookmarkNode.Bookmark,
139 importRootNode)
134 bookmark.url = url 140 bookmark.url = url
135 bookmark.title = name.replace("&", "&&") 141 bookmark.title = name.replace("&", "&&")
136 142
137 if self._id == "ie": 143 if self._id == "ie":
138 importRootNode.title = self.trUtf8("Internet Explorer Import") 144 importRootNode.title = self.trUtf8("Internet Explorer Import")

eric ide

mercurial