Thu, 24 Oct 2024 14:55:20 +0200
Adjusted code for eric7 24.10 and newer.
--- 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")