Adjusted code for eric7 24.10 and newer. release-10.1.5

Thu, 24 Oct 2024 14:55:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 24 Oct 2024 14:55:20 +0200
changeset 59
40a29731e0d0
parent 58
7878fc1493fb
child 60
b1326de339bc

Adjusted code for eric7 24.10 and newer.

OllamaInterface/AutoResizeTextBrowser.py file | annotate | diff | comparison | revisions
OllamaInterface/OllamaChatMessageBox.py file | annotate | diff | comparison | revisions
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/AutoResizeTextBrowser.py	Wed Oct 02 09:11:09 2024 +0200
+++ b/OllamaInterface/AutoResizeTextBrowser.py	Thu Oct 24 14:55:20 2024 +0200
@@ -7,6 +7,8 @@
 Module implementing a QTextBrowser widget that resizes automatically.
 """
 
+# backward compatibility for eric < 24.10
+
 from PyQt6.QtCore import Qt
 from PyQt6.QtWidgets import QFrame, QSizePolicy, QTextBrowser
 
--- a/OllamaInterface/OllamaChatMessageBox.py	Wed Oct 02 09:11:09 2024 +0200
+++ b/OllamaInterface/OllamaChatMessageBox.py	Thu Oct 24 14:55:20 2024 +0200
@@ -18,7 +18,7 @@
 try:
     from eric7.EricWidgets.EricAutoResizeTextBrowser import EricAutoResizeTextBrowser
 except ImportError:
-    # backward compatibility for eric-ide < 24.10
+    # backward compatibility for eric < 24.10
     from .AutoResizeTextBrowser import (
         AutoResizeTextBrowser as EricAutoResizeTextBrowser,
     )
--- a/OllamaInterface/OllamaWidget.py	Wed Oct 02 09:11:09 2024 +0200
+++ b/OllamaInterface/OllamaWidget.py	Thu Oct 24 14:55:20 2024 +0200
@@ -23,12 +23,17 @@
     QWidget,
 )
 
-from eric7 import Globals
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog
 
+try:
+    from eric7.EricUtilities import getConfigDir
+except ImportError:
+    # backward compatibility for eric < 24.10
+    from Globals import getConfigDir
+
 from .OllamaChatWidget import OllamaChatDialog, OllamaChatWidget
 from .OllamaClient import OllamaClient
 from .OllamaHistoryWidget import OllamaHistoryWidget
@@ -326,7 +331,7 @@
         @return file path of the chat history file
         @rtype str
         """
-        return os.path.join(Globals.getConfigDir(), OllamaWidget.OllamaHistoryFile)
+        return os.path.join(getConfigDir(), OllamaWidget.OllamaHistoryFile)
 
     @pyqtSlot()
     def __saveHistory(self):
--- a/PluginAiOllama.py	Wed Oct 02 09:11:09 2024 +0200
+++ b/PluginAiOllama.py	Thu Oct 24 14:55:20 2024 +0200
@@ -33,7 +33,7 @@
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>",
     "autoactivate": True,
     "deactivateable": True,
-    "version": "10.1.4",
+    "version": "10.1.5",
     "className": "PluginOllamaInterface",
     "packageName": "OllamaInterface",
     "shortDescription": "Graphical 'ollama' client for eric-ide.",
@@ -264,6 +264,7 @@
             try:
                 self.__ui.activateLeftRightSidebarWidget(self.__widget)
             except AttributeError:
+                # backward compatibility with eric < 24.9.
                 self.__activateLeftRightSidebarWidget(self.__widget)
         else:
             self.__widget.show()
@@ -333,7 +334,7 @@
         @param widget reference to the widget to be activated
         @type QWidget
         """
-        # This is for backward compatibility with eric-ide < 24.9.
+        # backward compatibility with eric < 24.9.
         sidebar = (
             self.__ui.leftSidebar
             if Preferences.getUI("CombinedLeftRightSidebar")
Binary file PluginAiOllama.zip has changed
--- a/changelog.md	Wed Oct 02 09:11:09 2024 +0200
+++ b/changelog.md	Thu Oct 24 14:55:20 2024 +0200
@@ -1,6 +1,10 @@
 ChangeLog
 ---------
 
+__Version 10.1.5__
+
+- adjusted code for eric7 24.10 and newer
+
 __Version 10.1.4__
 
 - bug fixes

eric ide

mercurial