Fixed some code style and formatting issues.

Thu, 29 Aug 2024 13:13:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 29 Aug 2024 13:13:53 +0200
changeset 17
43b1396fe72f
parent 16
cb6af351310b
child 18
0a5b9c233a6e

Fixed some code style and formatting issues.

OllamaInterface/ConfigurationPage/OllamaPage.py file | annotate | diff | comparison | revisions
OllamaInterface/OllamaClient.py file | annotate | diff | comparison | revisions
PluginAiOllama.py file | annotate | diff | comparison | revisions
--- a/OllamaInterface/ConfigurationPage/OllamaPage.py	Thu Aug 29 13:11:59 2024 +0200
+++ b/OllamaInterface/ConfigurationPage/OllamaPage.py	Thu Aug 29 13:13:53 2024 +0200
@@ -38,15 +38,15 @@
         )
         self.serverHostEdit.setText(self.__plugin.getPreferences("OllamaHost"))
         self.serverPortSpinBox.setValue(self.__plugin.getPreferences("OllamaPort"))
-        
+
         self.localServerPortSpinBox.setValue(
             self.__plugin.getPreferences("OllamaLocalPort")
         )
-        
+
         self.modelLibraryUrlEdit.setText(
             self.__plugin.getPreferences("OllamaModelLibraryUrl")
         )
-        
+
         self.heartbeatSpinBox.setValue(
             self.__plugin.getPreferences("OllamaHeartbeatInterval")
         )
@@ -61,12 +61,8 @@
         self.__plugin.setPreferences(
             "OllamaScheme", self.serverSchemeComboBox.currentText()
         )
-        self.__plugin.setPreferences(
-            "OllamaHost", self.serverHostEdit.text()
-        )
-        self.__plugin.setPreferences(
-            "OllamaPort", self.serverPortSpinBox.value()
-        )
+        self.__plugin.setPreferences("OllamaHost", self.serverHostEdit.text())
+        self.__plugin.setPreferences("OllamaPort", self.serverPortSpinBox.value())
 
         self.__plugin.setPreferences(
             "OllamaLocalPort", self.localServerPortSpinBox.value()
--- a/OllamaInterface/OllamaClient.py	Thu Aug 29 13:11:59 2024 +0200
+++ b/OllamaInterface/OllamaClient.py	Thu Aug 29 13:13:53 2024 +0200
@@ -572,25 +572,20 @@
         """
         responding = self.heartbeat()
         if responding != self.__serverResponding:
-            msg = (
-                ""
-                if responding
-                else self.__serverNotRespondingMessage()
-            )
+            msg = "" if responding else self.__serverNotRespondingMessage()
             self.serverStateChanged.emit(responding, msg)
         self.__serverResponding = responding
 
     def __serverNotRespondingMessage(self):
         """
         Private method to assemble and return a message for a non-responsive server.
-        
+
         @return error message
         @rtype str
         """
         return (
             self.tr(
-                "<p>Error: The local server at <b>{0}</b> is not responding."
-                "</p>"
+                "<p>Error: The local server at <b>{0}</b> is not responding.</p>"
             )
             if self.__localServer
             else self.tr(
--- a/PluginAiOllama.py	Thu Aug 29 13:11:59 2024 +0200
+++ b/PluginAiOllama.py	Thu Aug 29 13:13:53 2024 +0200
@@ -79,9 +79,7 @@
 
     return {
         "ollamaPage": [
-            QCoreApplication.translate(
-                "PluginOllamaInterface", "ollama AI Interface"
-            ),
+            QCoreApplication.translate("PluginOllamaInterface", "ollama AI Interface"),
             os.path.join("OllamaInterface", "icons", "ollama22-{0}".format(iconSuffix)),
             createOllamaPage,
             None,

eric ide

mercurial