src/eric7/WebBrowser/Bookmarks/BookmarksImporters/IExplorerImporter.py

branch
eric7
changeset 10436
f6881d10e995
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
19 19
20 def getImporterInfo(sourceId): 20 def getImporterInfo(sourceId):
21 """ 21 """
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 sourceId id of the browser ("chrome" or "chromium") 24 @param sourceId id of the browser
25 @return tuple with an icon (QPixmap), readable name (string), name of 25 @type str
26 the default bookmarks file (string), an info text (string), 26 @return tuple with an icon, readable name, name of the default
27 a prompt (string) and the default directory of the bookmarks file 27 bookmarks file, an info text, a prompt and the default directory
28 (string) 28 of the bookmarks file
29 @rtype tuple of (QPixmap, str, str, str, str, str)
29 @exception ValueError raised to indicate an invalid browser ID 30 @exception ValueError raised to indicate an invalid browser ID
30 """ 31 """
31 if sourceId != "ie": 32 if sourceId != "ie":
32 raise ValueError("Unsupported browser ID given ({0}).".format(sourceId)) 33 raise ValueError("Unsupported browser ID given ({0}).".format(sourceId))
33 34
74 75
75 def setPath(self, path): 76 def setPath(self, path):
76 """ 77 """
77 Public method to set the path of the bookmarks file or directory. 78 Public method to set the path of the bookmarks file or directory.
78 79
79 @param path bookmarks file or directory (string) 80 @param path bookmarks file or directory
81 @type str
80 """ 82 """
81 self.__fileName = path 83 self.__fileName = path
82 84
83 def open(self): 85 def open(self):
84 """ 86 """
85 Public method to open the bookmarks file. 87 Public method to open the bookmarks file.
86 88
87 @return flag indicating success (boolean) 89 @return flag indicating success
90 @rtype bool
88 """ 91 """
89 if not os.path.exists(self.__fileName): 92 if not os.path.exists(self.__fileName):
90 self._error = True 93 self._error = True
91 self._errorString = self.tr("Folder '{0}' does not exist.").format( 94 self._errorString = self.tr("Folder '{0}' does not exist.").format(
92 self.__fileName 95 self.__fileName
101 104
102 def importedBookmarks(self): 105 def importedBookmarks(self):
103 """ 106 """
104 Public method to get the imported bookmarks. 107 Public method to get the imported bookmarks.
105 108
106 @return imported bookmarks (BookmarkNode) 109 @return imported bookmarks
110 @rtype BookmarkNode
107 """ 111 """
108 from ..BookmarkNode import BookmarkNode 112 from ..BookmarkNode import BookmarkNode
109 113
110 folders = {} 114 folders = {}
111 115

eric ide

mercurial