--- a/eric6/WebBrowser/OpenSearch/OpenSearchReader.py Wed Sep 25 18:48:22 2019 +0200 +++ b/eric6/WebBrowser/OpenSearch/OpenSearchReader.py Wed Sep 25 18:52:40 2019 +0200 @@ -42,8 +42,10 @@ while not self.isStartElement() and not self.atEnd(): self.readNext() - if self.name() != "OpenSearchDescription" or \ - self.namespaceUri() != "http://a9.com/-/spec/opensearch/1.1/": + if ( + self.name() != "OpenSearchDescription" or + self.namespaceUri() != "http://a9.com/-/spec/opensearch/1.1/" + ): self.raiseError(QCoreApplication.translate( "OpenSearchReader", "The file is not an OpenSearch 1.1 file.")) @@ -66,14 +68,18 @@ url = self.attributes().value("template") method = self.attributes().value("method") - if type_ == "application/x-suggestions+json" and \ - engine.suggestionsUrlTemplate(): + if ( + type_ == "application/x-suggestions+json" and + engine.suggestionsUrlTemplate() + ): continue - if (not type_ or - type_ == "text/html" or - type_ == "application/xhtml+xml") and \ - engine.searchUrlTemplate(): + if ( + (not type_ or + type_ == "text/html" or + type_ == "application/xhtml+xml") and + engine.searchUrlTemplate() + ): continue if not url: @@ -84,8 +90,11 @@ self.readNext() while not (self.isEndElement() and self.name() == "Url"): - if not self.isStartElement() or \ - (self.name() != "Param" and self.name() != "Parameter"): + if ( + not self.isStartElement() or + (self.name() != "Param" and + self.name() != "Parameter") + ): self.readNext() continue @@ -102,9 +111,11 @@ engine.setSuggestionsUrlTemplate(url) engine.setSuggestionsParameters(parameters) engine.setSuggestionsMethod(method) - elif not type_ or \ - type_ == "text/html" or \ - type_ == "application/xhtml+xml": + elif ( + not type_ or + type_ == "text/html" or + type_ == "application/xhtml+xml" + ): engine.setSearchUrlTemplate(url) engine.setSearchParameters(parameters) engine.setSearchMethod(method) @@ -112,11 +123,13 @@ elif self.name() == "Image": engine.setImageUrl(self.readElementText()) - if engine.name() and \ - engine.description() and \ - engine.suggestionsUrlTemplate() and \ - engine.searchUrlTemplate() and \ - engine.imageUrl(): + if ( + engine.name() and + engine.description() and + engine.suggestionsUrlTemplate() and + engine.searchUrlTemplate() and + engine.imageUrl() + ): break return engine