Only enable the 'Local Server' menu when the 'ollamaL executable is found. release-10.0.4

Mon, 09 Sep 2024 14:17:26 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 09 Sep 2024 14:17:26 +0200
changeset 40
1cb80644982d
parent 39
9fe301355d72
child 41
32aa21a6787e

Only enable the 'Local Server' menu when the 'ollamaL executable is found.

OllamaInterface/OllamaWidget.py file | annotate | diff | comparison | revisions
PluginAiOllama.py file | annotate | diff | comparison | revisions
PluginAiOllama.zip file | annotate | diff | comparison | revisions
changelog.md file | annotate | diff | comparison | revisions
--- a/OllamaInterface/OllamaWidget.py	Sat Sep 07 18:45:26 2024 +0200
+++ b/OllamaInterface/OllamaWidget.py	Mon Sep 09 14:17:26 2024 +0200
@@ -10,6 +10,7 @@
 import contextlib
 import json
 import os
+import shutil
 
 from PyQt6.QtCore import QProcess, QProcessEnvironment, Qt, QTimer, QUrl, pyqtSlot
 from PyQt6.QtGui import QDesktopServices
@@ -752,7 +753,7 @@
         self.__ollamaMenu.addSeparator()
         self.__modelMenuAct = self.__ollamaMenu.addMenu(self.__modelMenu)
         self.__ollamaMenu.addSeparator()
-        self.__ollamaMenu.addMenu(self.__localServerMenu)
+        self.__localServerMenuAct = self.__ollamaMenu.addMenu(self.__localServerMenu)
         self.__ollamaMenu.addSeparator()
         self.__ollamaMenu.addMenu(self.__urlsMenu)
         self.__ollamaMenu.addSeparator()
@@ -769,6 +770,7 @@
         """
         self.__clearHistoriesAct.setEnabled(self.__chatHistoryLayout.count() > 1)
 
+        self.__localServerMenuAct.setEnabled(bool(shutil.which("ollama")))
         self.__localServerStartMonitorAct.setEnabled(
             self.__localServerProcess is None and self.__localServerDialog is None
         )
--- a/PluginAiOllama.py	Sat Sep 07 18:45:26 2024 +0200
+++ b/PluginAiOllama.py	Mon Sep 09 14:17:26 2024 +0200
@@ -33,7 +33,7 @@
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
     "autoactivate": True,
     "deactivateable": True,
-    "version": "10.0.3",
+    "version": "10.0.4",
     "className": "PluginOllamaInterface",
     "packageName": "OllamaInterface",
     "shortDescription": "Graphical 'ollama' client for eric-ide.",
Binary file PluginAiOllama.zip has changed
--- a/changelog.md	Sat Sep 07 18:45:26 2024 +0200
+++ b/changelog.md	Mon Sep 09 14:17:26 2024 +0200
@@ -1,6 +1,10 @@
 ChangeLog
 ---------
 
+__Version 10.0.4__
+
+- Only enable the 'Local Server' menu when the 'ollamaL executable is found.
+
 __Version 10.0.3__
 
 - bug fixes

eric ide

mercurial