--- a/src/eric7/WebBrowser/OpenSearch/OpenSearchEngine.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/OpenSearch/OpenSearchEngine.py Fri Dec 22 17:24:07 2023 +0100 @@ -44,7 +44,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -73,9 +74,12 @@ """ Class method to parse a search template. - @param searchTerm term to search for (string) - @param searchTemplate template to be parsed (string) - @return parsed template (string) + @param searchTerm term to search for + @type str + @param searchTemplate template to be parsed + @type str + @return parsed template + @rtype str """ locale = QLocale(Preferences.getWebBrowser("SearchLanguage")) language = locale.name().replace("_", "-") @@ -101,7 +105,8 @@ """ Public method to get the name of the engine. - @return name of the engine (string) + @return name of the engine + @rtype str """ return self._name @@ -109,7 +114,8 @@ """ Public method to set the engine name. - @param name name of the engine (string) + @param name name of the engine + @type str """ self._name = name @@ -117,7 +123,8 @@ """ Public method to get the description of the engine. - @return description of the engine (string) + @return description of the engine + @rtype str """ return self._description @@ -125,7 +132,8 @@ """ Public method to set the engine description. - @param description description of the engine (string) + @param description description of the engine + @type str """ self._description = description @@ -133,7 +141,8 @@ """ Public method to get the search URL template of the engine. - @return search URL template of the engine (string) + @return search URL template of the engine + @rtype str """ return self._searchUrlTemplate @@ -164,7 +173,8 @@ <td>application name, QCoreApplication::applicationName()</td></tr> </table> - @param searchUrlTemplate search URL template of the engine (string) + @param searchUrlTemplate search URL template of the engine + @type str """ self._searchUrlTemplate = searchUrlTemplate @@ -172,8 +182,10 @@ """ Public method to get a URL ready for searching. - @param searchTerm term to search for (string) - @return URL (QUrl) + @param searchTerm term to search for + @type str + @return URL + @rtype QUrl """ if not self._searchUrlTemplate: return QUrl() @@ -196,7 +208,8 @@ """ Public method to check, if the engine provides suggestions. - @return flag indicating suggestions are provided (boolean) + @return flag indicating suggestions are provided + @rtype bool """ return self._suggestionsUrlTemplate != "" @@ -204,7 +217,8 @@ """ Public method to get the search URL template of the engine. - @return search URL template of the engine (string) + @return search URL template of the engine + @rtype str """ return self._suggestionsUrlTemplate @@ -213,7 +227,8 @@ Public method to set the engine suggestions URL template. @param suggestionsUrlTemplate suggestions URL template of the - engine (string) + engine + @type str """ self._suggestionsUrlTemplate = suggestionsUrlTemplate @@ -221,8 +236,10 @@ """ Public method to get a URL ready for suggestions. - @param searchTerm term to search for (string) - @return URL (QUrl) + @param searchTerm term to search for + @type str + @return URL + @rtype QUrl """ if not self._suggestionsUrlTemplate: return QUrl() @@ -249,7 +266,8 @@ """ Public method to get the search parameters of the engine. - @return search parameters of the engine (list of two tuples) + @return search parameters of the engine + @rtype list of [tuple, tuple] """ return self._searchParameters[:] @@ -258,7 +276,7 @@ Public method to set the engine search parameters. @param searchParameters search parameters of the engine - (list of two tuples) + @type list of [tuple, tuple] """ self._searchParameters = searchParameters[:] @@ -266,7 +284,8 @@ """ Public method to get the suggestions parameters of the engine. - @return suggestions parameters of the engine (list of two tuples) + @return suggestions parameters of the engine + @rtype list of [tuple, tuple] """ return self._suggestionsParameters[:] @@ -274,8 +293,8 @@ """ Public method to set the engine suggestions parameters. - @param suggestionsParameters suggestions parameters of the - engine (list of two tuples) + @param suggestionsParameters suggestions parameters of the engine + @type list of [tuple, tuple] """ self._suggestionsParameters = suggestionsParameters[:] @@ -284,7 +303,8 @@ Public method to get the HTTP request method used to perform search requests. - @return HTTP request method (string) + @return HTTP request method + @rtype str """ return self.__searchMethod @@ -293,7 +313,8 @@ Public method to set the HTTP request method used to perform search requests. - @param method HTTP request method (string) + @param method HTTP request method + @type str """ requestMethod = method.lower() if requestMethod not in self.__requestMethods: @@ -306,7 +327,8 @@ Public method to get the HTTP request method used to perform suggestions requests. - @return HTTP request method (string) + @return HTTP request method + @rtype str """ return self.__suggestionsMethod @@ -315,7 +337,8 @@ Public method to set the HTTP request method used to perform suggestions requests. - @param method HTTP request method (string) + @param method HTTP request method + @type str """ requestMethod = method.lower() if requestMethod not in self.__requestMethods: @@ -327,7 +350,8 @@ """ Public method to get the image URL of the engine. - @return image URL of the engine (string) + @return image URL of the engine + @rtype str """ return self._imageUrl @@ -335,7 +359,8 @@ """ Public method to set the engine image URL. - @param imageUrl image URL of the engine (string) + @param imageUrl image URL of the engine + @type str """ self._imageUrl = imageUrl @@ -343,7 +368,8 @@ """ Public method to set the engine image URL. - @param imageUrl image URL of the engine (string) + @param imageUrl image URL of the engine + @type str """ self.setImageUrl(imageUrl) self.__iconMoved = False @@ -390,7 +416,8 @@ """ Public method to get the image of the engine. - @return image of the engine (QImage) + @return image of the engine + @rtype QImage """ if not self.__iconMoved and self.__image.isNull(): self.loadImage() @@ -401,7 +428,8 @@ """ Public method to set the image of the engine. - @param image image to be set (QImage) + @param image image to be set + @type QImage """ if not self._imageUrl: imageBuffer = QBuffer() @@ -418,7 +446,8 @@ """ Public method to check, if the engine is valid. - @return flag indicating validity (boolean) + @return flag indicating validity + @rtype bool """ return self._name and self._searchUrlTemplate @@ -426,8 +455,10 @@ """ Special method implementing the == operator. - @param other reference to an open search engine (OpenSearchEngine) - @return flag indicating equality (boolean) + @param other reference to an open search engine + @type OpenSearchEngine + @return flag indicating equality + @rtype bool """ if not isinstance(other, OpenSearchEngine): return NotImplemented @@ -446,8 +477,10 @@ """ Special method implementing the < operator. - @param other reference to an open search engine (OpenSearchEngine) - @return flag indicating less than (boolean) + @param other reference to an open search engine + @type OpenSearchEngine + @return flag indicating less than + @rtype bool """ if not isinstance(other, OpenSearchEngine): return NotImplemented @@ -458,7 +491,8 @@ """ Public method to request suggestions. - @param searchTerm term to get suggestions for (string) + @param searchTerm term to get suggestions for + @type str """ if not searchTerm or not self.providesSuggestions(): return @@ -523,7 +557,7 @@ Public method to get a reference to the network access manager object. @return reference to the network access manager object - (QNetworkAccessManager) + @rtype QNetworkAccessManager """ return self.__networkAccessManager @@ -532,6 +566,7 @@ Public method to set the reference to the network access manager. @param networkAccessManager reference to the network access manager - object (QNetworkAccessManager) + object + @type QNetworkAccessManager """ self.__networkAccessManager = networkAccessManager