eric6/WebBrowser/VirusTotal/VirusTotalApi.py

changeset 8260
2161475d9639
parent 8218
7c09585bd960
child 8560
532068b0edb4
diff -r 2bbec88047dd -r 2161475d9639 eric6/WebBrowser/VirusTotal/VirusTotalApi.py
--- a/eric6/WebBrowser/VirusTotal/VirusTotalApi.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/WebBrowser/VirusTotal/VirusTotalApi.py	Thu Apr 22 18:02:47 2021 +0200
@@ -79,10 +79,11 @@
         """
         Private method to load the settings.
         """
-        if Preferences.getWebBrowser("VirusTotalSecure"):
-            protocol = "https"
-        else:
-            protocol = "http"
+        protocol = (
+            "https"
+            if Preferences.getWebBrowser("VirusTotalSecure") else
+            "http"
+        )
         self.GetFileReportUrl = self.GetFileReportPattern.format(protocol)
         self.ScanUrlUrl = self.ScanUrlPattern.format(protocol)
         self.GetUrlReportUrl = self.GetUrlReportPattern.format(protocol)
@@ -109,10 +110,11 @@
         @param key service key (string)
         @param protocol protocol used to access VirusTotal (string)
         """
-        if protocol == "":
-            urlStr = self.GetFileReportUrl
-        else:
-            urlStr = self.GetFileReportPattern.format(protocol)
+        urlStr = (
+            self.GetFileReportUrl
+            if protocol == "" else
+            self.GetFileReportPattern.format(protocol)
+        )
         request = QNetworkRequest(QUrl(urlStr))
         request.setHeader(QNetworkRequest.KnownHeaders.ContentTypeHeader,
                           "application/x-www-form-urlencoded")

eric ide

mercurial