diff -r c712d09cc839 -r f6881d10e995 src/eric7/WebBrowser/Bookmarks/BookmarksManager.py --- a/src/eric7/WebBrowser/Bookmarks/BookmarksManager.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/Bookmarks/BookmarksManager.py Fri Dec 22 17:24:07 2023 +0100 @@ -63,7 +63,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -90,7 +91,8 @@ """ Class method to get the file name of the bookmark file. - @return name of the bookmark file (string) + @return name of the bookmark file + @rtype str """ return os.path.join(Globals.getConfigDir(), "web_browser", "bookmarks.xbel") @@ -104,7 +106,8 @@ """ Public method to get a reference to the undo stack. - @return reference to the undo stack (QUndoStack) + @return reference to the undo stack + @rtype QUndoStack """ return self.__commands @@ -229,9 +232,12 @@ """ Public method to add a bookmark. - @param parent reference to the node to add to (BookmarkNode) - @param node reference to the node to add (BookmarkNode) - @param row row number (integer) + @param parent reference to the node to add to + @type BookmarkNode + @param node reference to the node to add + @type BookmarkNode + @param row row number + @type int """ if not self.__loaded: return @@ -245,7 +251,8 @@ """ Public method to remove a bookmark. - @param node reference to the node to be removed (BookmarkNode) + @param node reference to the node to be removed + @type BookmarkNode """ if not self.__loaded: return @@ -259,8 +266,10 @@ """ Public method to set the title of a bookmark. - @param node reference to the node to be changed (BookmarkNode) - @param newTitle title to be set (string) + @param node reference to the node to be changed + @type BookmarkNode + @param newTitle title to be set + @type str """ if not self.__loaded: return @@ -272,8 +281,10 @@ """ Public method to set the URL of a bookmark. - @param node reference to the node to be changed (BookmarkNode) - @param newUrl URL to be set (string) + @param node reference to the node to be changed + @type BookmarkNode + @param newUrl URL to be set + @type str """ if not self.__loaded: return @@ -292,11 +303,14 @@ """ Public method to set the URL of a bookmark. - @param node reference to the node to be changed (BookmarkNode) + @param node reference to the node to be changed + @type BookmarkNode @param timestampType type of the timestamp to set (BookmarkNode.TsAdded, BookmarkNode.TsModified, BookmarkNode.TsVisited) - @param timestamp timestamp to set (QDateTime) + @type int + @param timestamp timestamp to set + @type QDateTime """ if not self.__loaded: return @@ -313,7 +327,8 @@ """ Public method to increment the visit count of a bookmark. - @param node reference to the node to be changed (BookmarkNode) + @param node reference to the node to be changed + @type BookmarkNode """ if not self.__loaded: return @@ -326,8 +341,10 @@ """ Public method to set the visit count of a bookmark. - @param node reference to the node to be changed (BookmarkNode) - @param count visit count to be set (int or str) + @param node reference to the node to be changed + @type BookmarkNode + @param count visit count to be set + @type int or str """ with contextlib.suppress(ValueError): node.visitCount = int(count) @@ -337,7 +354,8 @@ """ Public method to get a reference to the root bookmark node. - @return reference to the root bookmark node (BookmarkNode) + @return reference to the root bookmark node + @rtype BookmarkNode """ if not self.__loaded: self.load() @@ -348,7 +366,8 @@ """ Public method to get a reference to the bookmarks menu node. - @return reference to the bookmarks menu node (BookmarkNode) + @return reference to the bookmarks menu node + @rtype BookmarkNode """ if not self.__loaded: self.load() @@ -359,7 +378,8 @@ """ Public method to get a reference to the bookmarks toolbar node. - @return reference to the bookmarks toolbar node (BookmarkNode) + @return reference to the bookmarks toolbar node + @rtype BookmarkNode """ if not self.__loaded: self.load() @@ -370,7 +390,8 @@ """ Public method to get a reference to the bookmarks model. - @return reference to the bookmarks model (BookmarksModel) + @return reference to the bookmarks model + @rtype BookmarksModel """ from .BookmarksModel import BookmarksModel @@ -432,7 +453,8 @@ """ Public slot to update the icon image for an URL. - @param url URL of the icon to update (QUrl or string) + @param url URL of the icon to update + @type QUrl or str """ if isinstance(url, QUrl): url = url.toString() @@ -444,10 +466,13 @@ """ Public method to get a bookmark node for a given URL. - @param url URL of the bookmark to search for (QUrl or string) + @param url URL of the bookmark to search for + @type QUrl or str @param start indicator for the start of the search (StartRoot, StartMenu, StartToolBar) - @return bookmark node for the given url (BookmarkNode) + @type int + @return bookmark node for the given url + @rtype BookmarkNode """ if start == StartMenu: startNode = self.__menu @@ -467,10 +492,12 @@ """ Private method get a bookmark node for a given URL. - @param url URL of the bookmark to search for (string) + @param url URL of the bookmark to search for + @type str @param startNode reference to the node to start searching - (BookmarkNode) - @return bookmark node for the given url (BookmarkNode) + @type BookmarkNode + @return bookmark node for the given url + @rtype BookmarkNode """ bm = None for node in startNode.children(): @@ -486,10 +513,13 @@ """ Public method to get a list of bookmark nodes for a given URL. - @param url URL of the bookmarks to search for (QUrl or string) + @param url URL of the bookmarks to search for + @type QUrl or str @param start indicator for the start of the search (StartRoot, StartMenu, StartToolBar) - @return list of bookmark nodes for the given url (list of BookmarkNode) + @type int + @return list of bookmark nodes for the given url + @rtype list of BookmarkNode """ if start == StartMenu: startNode = self.__menu @@ -509,10 +539,12 @@ """ Private method get a list of bookmark nodes for a given URL. - @param url URL of the bookmarks to search for (string) + @param url URL of the bookmarks to search for + @type str @param startNode reference to the node to start searching - (BookmarkNode) - @return list of bookmark nodes for the given url (list of BookmarkNode) + @type BookmarkNode + @return list of bookmark nodes for the given url + @rtype list of BookmarkNode """ bm = [] for node in startNode.children(): @@ -533,9 +565,11 @@ Constructor @param bookmarksManager reference to the bookmarks manager - (BookmarksManager) - @param parent reference to the parent node (BookmarkNode) - @param row row number of bookmark (integer) + @type BookmarksManager + @param parent reference to the parent node + @type BookmarkNode + @param row row number of bookmark + @type int """ super().__init__( QCoreApplication.translate("BookmarksManager", "Remove Bookmark") @@ -574,10 +608,13 @@ Constructor @param bookmarksManager reference to the bookmarks manager - (BookmarksManager) - @param parent reference to the parent node (BookmarkNode) - @param node reference to the node to be inserted (BookmarkNode) - @param row row number of bookmark (integer) + @type BookmarksManager + @param parent reference to the parent node + @type BookmarkNode + @param node reference to the node to be inserted + @type BookmarkNode + @param row row number of bookmark + @type int """ RemoveBookmarksCommand.__init__(self, bookmarksManager, parent, row) self.setText(QCoreApplication.translate("BookmarksManager", "Insert Bookmark")) @@ -606,11 +643,14 @@ Constructor @param bookmarksManager reference to the bookmarks manager - (BookmarksManager) - @param node reference to the node to be changed (BookmarkNode) - @param newValue new value to be set (string) + @type BookmarksManager + @param node reference to the node to be changed + @type BookmarkNode + @param newValue new value to be set + @type str @param title flag indicating a change of the title (True) or - the URL (False) (boolean) + the URL (False) + @type bool """ super().__init__()