Mon, 24 Oct 2022 18:01:45 +0200
Adapted the import statements to the new structure.
--- a/ChangeLog Wed Sep 21 09:46:48 2022 +0200 +++ b/ChangeLog Mon Oct 24 18:01:45 2022 +0200 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 10.3.0 +- adapted the import statements to the new structure + Version 10.2.2: - some code refactoring
--- a/MqttMonitor/ConfigurationPage/MqttPage.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/ConfigurationPage/MqttPage.py Mon Oct 24 18:01:45 2022 +0200 @@ -7,7 +7,9 @@ Module implementing the MQTT Monitor configuration page. """ -from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase +from eric7.Preferences.ConfigurationPages.ConfigurationPageBase import ( + ConfigurationPageBase, +) from .Ui_MqttPage import Ui_MqttPage
--- a/MqttMonitor/MqttClient.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttClient.py Mon Oct 24 18:01:45 2022 +0200 @@ -13,7 +13,7 @@ from paho.mqtt.packettypes import PacketTypes from paho.mqtt.properties import Properties -from Utilities.crypto import pwConvert +from eric7.Utilities.crypto import pwConvert from .MqttProtocols import MqttProtocols
--- a/MqttMonitor/MqttConnectionOptionsDialog.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttConnectionOptionsDialog.py Mon Oct 24 18:01:45 2022 +0200 @@ -12,17 +12,19 @@ from PyQt6.QtCore import pyqtSlot, QUuid from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton -from EricWidgets import EricMessageBox -from EricWidgets.EricPathPicker import EricPathPickerModes +try: + from eric7.EricGui import EricPixmapCache +except ImportError: + from UI import PixmapCache as EricPixmapCache +from eric7.EricWidgets import EricMessageBox +from eric7.EricWidgets.EricPathPicker import EricPathPickerModes +from eric7.Utilities.crypto import pwConvert from .Ui_MqttConnectionOptionsDialog import Ui_MqttConnectionOptionsDialog from .MqttClient import MqttClient from .MqttProtocols import MqttProtocols -from Utilities.crypto import pwConvert -import UI.PixmapCache - class MqttConnectionOptionsDialog(QDialog, Ui_MqttConnectionOptionsDialog): """ @@ -51,7 +53,7 @@ self.tr("Certificate Files (*.crt *.pem);;All Files (*)") ) - self.willPropertiesButton.setIcon(UI.PixmapCache.getIcon("listSelection")) + self.willPropertiesButton.setIcon(EricPixmapCache.getIcon("listSelection")) self.optionsWidget.setCurrentIndex(0)
--- a/MqttMonitor/MqttConnectionOptionsDialog.ui Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttConnectionOptionsDialog.ui Mon Oct 24 18:01:45 2022 +0200 @@ -471,7 +471,7 @@ <customwidget> <class>EricPathPicker</class> <extends>QWidget</extends> - <header>EricWidgets/EricPathPicker.h</header> + <header>eric7/EricWidgets/EricPathPicker.h</header> <container>1</container> </customwidget> <customwidget>
--- a/MqttMonitor/MqttConnectionProfilesDialog.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttConnectionProfilesDialog.py Mon Oct 24 18:01:45 2022 +0200 @@ -20,17 +20,19 @@ QLineEdit, ) -from EricWidgets import EricMessageBox -from EricWidgets.EricPathPicker import EricPathPickerModes +try: + from eric7.EricGui import EricPixmapCache +except ImportError: + from UI import PixmapCache as EricPixmapCache +from eric7.EricWidgets import EricMessageBox +from eric7.EricWidgets.EricPathPicker import EricPathPickerModes +from eric7.Utilities.crypto import pwConvert from .Ui_MqttConnectionProfilesDialog import Ui_MqttConnectionProfilesDialog from .MqttClient import MqttClient from .MqttProtocols import MqttProtocols -import UI.PixmapCache -from Utilities.crypto import pwConvert - class MqttConnectionProfilesDialog(QDialog, Ui_MqttConnectionProfilesDialog): """ @@ -61,11 +63,11 @@ self.__profiles.update(copy.deepcopy(profiles)) self.__profilesChanged = False - self.plusButton.setIcon(UI.PixmapCache.getIcon("plus")) - self.copyButton.setIcon(UI.PixmapCache.getIcon("editCopy")) - self.minusButton.setIcon(UI.PixmapCache.getIcon("minus")) - self.showPasswordButton.setIcon(UI.PixmapCache.getIcon("showPassword")) - self.willPropertiesButton.setIcon(UI.PixmapCache.getIcon("listSelection")) + self.plusButton.setIcon(EricPixmapCache.getIcon("plus")) + self.copyButton.setIcon(EricPixmapCache.getIcon("editCopy")) + self.minusButton.setIcon(EricPixmapCache.getIcon("minus")) + self.showPasswordButton.setIcon(EricPixmapCache.getIcon("showPassword")) + self.willPropertiesButton.setIcon(EricPixmapCache.getIcon("listSelection")) self.tlsCertsFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) self.tlsCertsFilePicker.setFilters(
--- a/MqttMonitor/MqttConnectionProfilesDialog.ui Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttConnectionProfilesDialog.ui Mon Oct 24 18:01:45 2022 +0200 @@ -843,7 +843,7 @@ <customwidget> <class>EricPathPicker</class> <extends>QWidget</extends> - <header>EricWidgets/EricPathPicker.h</header> + <header>eric7/EricWidgets/EricPathPicker.h</header> <container>1</container> </customwidget> <customwidget>
--- a/MqttMonitor/MqttMonitorWidget.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttMonitorWidget.py Mon Oct 24 18:01:45 2022 +0200 @@ -16,9 +16,15 @@ from PyQt6.QtGui import QFont, QTextCursor, QBrush, QColor from PyQt6.QtWidgets import QWidget, QDialog, QMenu -from EricWidgets.EricApplication import ericApp -from EricWidgets import EricMessageBox, EricFileDialog -from EricWidgets.EricPathPicker import EricPathPickerModes +from eric7 import Utilities + +try: + from eric7.EricGui import EricPixmapCache +except ImportError: + from UI import PixmapCache as EricPixmapCache +from eric7.EricWidgets import EricMessageBox, EricFileDialog +from eric7.EricWidgets.EricApplication import ericApp +from eric7.EricWidgets.EricPathPicker import EricPathPickerModes from .Ui_MqttMonitorWidget import Ui_MqttMonitorWidget @@ -31,9 +37,6 @@ from .MqttReasonCodes import mqttReasonCode from .MqttProtocols import MqttProtocols -import UI.PixmapCache -import Utilities - class MqttMonitorWidget(QWidget, Ui_MqttMonitorWidget): """ @@ -71,7 +74,7 @@ # backward compatibility if not ericApp().usesSmallScreen(): self.pixmapLabel.setPixmap( - UI.PixmapCache.getPixmap( + EricPixmapCache.getPixmap( os.path.join( "MqttMonitor", "icons", @@ -149,9 +152,9 @@ self.__setConnectionMode(True) # initial mode is 'profile connection' self.__populateProfileComboBox() - self.connectButton.setIcon(UI.PixmapCache.getIcon("ircConnect")) + self.connectButton.setIcon(EricPixmapCache.getIcon("ircConnect")) self.brokerConnectionOptionsButton.setIcon( - UI.PixmapCache.getIcon( + EricPixmapCache.getIcon( os.path.join( "MqttMonitor", "icons", @@ -161,7 +164,7 @@ ) self.__populateBrokerComboBoxes() self.brokerStatusLabel.hide() - self.clearWillButton.setIcon(UI.PixmapCache.getIcon("certificateDelete")) + self.clearWillButton.setIcon(EricPixmapCache.getIcon("certificateDelete")) self.subscribeTopicComboBox.lineEdit().setClearButtonEnabled(True) self.subscribeTopicComboBox.lineEdit().returnPressed.connect( @@ -169,16 +172,16 @@ ) self.__populateSubscribeTopicComboBox() - self.subscribeButton.setIcon(UI.PixmapCache.getIcon("plus")) + self.subscribeButton.setIcon(EricPixmapCache.getIcon("plus")) self.subscribeButton.setEnabled(False) - self.subscribePropertiesButton.setIcon(UI.PixmapCache.getIcon("listSelection")) + self.subscribePropertiesButton.setIcon(EricPixmapCache.getIcon("listSelection")) self.subscribePropertiesButton.setEnabled(False) self.subscribePropertiesButton.setVisible(False) - self.unsubscribeButton.setIcon(UI.PixmapCache.getIcon("minus")) + self.unsubscribeButton.setIcon(EricPixmapCache.getIcon("minus")) self.unsubscribeButton.setEnabled(False) self.unsubscribePropertiesButton.setIcon( - UI.PixmapCache.getIcon("listSelection") + EricPixmapCache.getIcon("listSelection") ) self.unsubscribePropertiesButton.setEnabled(False) self.unsubscribePropertiesButton.setVisible(False) @@ -192,7 +195,7 @@ self.__publishedTopics = [] self.__updatePublishTopicComboBox() self.publishButton.setEnabled(False) - self.publishPropertiesButton.setIcon(UI.PixmapCache.getIcon("listSelection")) + self.publishPropertiesButton.setIcon(EricPixmapCache.getIcon("listSelection")) self.publishPropertiesButton.setEnabled(False) self.publishPropertiesButton.setVisible(False) @@ -283,19 +286,19 @@ """ self.__propertiesEditMenu = QMenu(self) self.__copyPropertiesAct = self.__propertiesEditMenu.addAction( - UI.PixmapCache.getIcon("editCopy"), + EricPixmapCache.getIcon("editCopy"), self.tr("Copy"), self.propertiesEdit.copy, ) self.__propertiesEditMenu.addSeparator() self.__selectAllPropertiesAct = self.__propertiesEditMenu.addAction( - UI.PixmapCache.getIcon("editSelectAll"), + EricPixmapCache.getIcon("editSelectAll"), self.tr("Select All"), self.propertiesEdit.selectAll, ) self.__propertiesEditMenu.addSeparator() self.__clearPropertiesAct = self.__propertiesEditMenu.addAction( - UI.PixmapCache.getIcon("editDelete"), + EricPixmapCache.getIcon("editDelete"), self.tr("Clear"), self.propertiesEdit.clear, ) @@ -352,7 +355,7 @@ self.__connectedToBroker = True self.__connectionOptions = None - self.connectButton.setIcon(UI.PixmapCache.getIcon("ircDisconnect")) + self.connectButton.setIcon(EricPixmapCache.getIcon("ircDisconnect")) self.subscribeGroup.setEnabled(True) self.subscribePropertiesButton.setVisible( @@ -412,7 +415,7 @@ ) self.__flashBrokerStatusLabel(msg) - self.connectButton.setIcon(UI.PixmapCache.getIcon("ircConnect")) + self.connectButton.setIcon(EricPixmapCache.getIcon("ircConnect")) self.__setConnectButtonState() self.__subscribedTopics = [] @@ -1329,7 +1332,7 @@ self.__connectionModeProfile = profileMode if profileMode: self.modeButton.setIcon( - UI.PixmapCache.getIcon( + EricPixmapCache.getIcon( os.path.join( "MqttMonitor", "icons", "profiles-{0}".format(self.__iconSuffix) ) @@ -1337,7 +1340,7 @@ ) else: self.modeButton.setIcon( - UI.PixmapCache.getIcon( + EricPixmapCache.getIcon( os.path.join( "MqttMonitor", "icons",
--- a/MqttMonitor/MqttMonitorWidget.ui Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttMonitorWidget.ui Mon Oct 24 18:01:45 2022 +0200 @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>400</width> - <height>510</height> + <height>600</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -164,7 +164,7 @@ <item> <widget class="QTabWidget" name="brokerWidget"> <property name="currentIndex"> - <number>0</number> + <number>4</number> </property> <widget class="QWidget" name="pubSubTab"> <attribute name="title"> @@ -661,8 +661,8 @@ <rect> <x>0</x> <y>0</y> - <width>339</width> - <height>670</height> + <width>203</width> + <height>840</height> </rect> </property> <layout class="QFormLayout" name="formLayout"> @@ -1497,13 +1497,13 @@ <customwidget> <class>EricPathPicker</class> <extends>QWidget</extends> - <header>EricWidgets/EricPathPicker.h</header> + <header>eric7/EricWidgets/EricPathPicker.h</header> <container>1</container> </customwidget> <customwidget> <class>EricTextEditSearchWidget</class> <extends>QWidget</extends> - <header>EricWidgets/EricTextEditSearchWidget.h</header> + <header>eric7/EricWidgets/EricTextEditSearchWidget.h</header> <container>1</container> </customwidget> </customwidgets>
--- a/MqttMonitor/MqttUserPropertiesEditor.py Wed Sep 21 09:46:48 2022 +0200 +++ b/MqttMonitor/MqttUserPropertiesEditor.py Mon Oct 24 18:01:45 2022 +0200 @@ -17,9 +17,12 @@ QWidget, ) -from .Ui_MqttUserPropertiesEditor import Ui_MqttUserPropertiesEditor +try: + from eric7.EricGui import EricPixmapCache +except ImportError: + from UI import PixmapCache as EricPixmapCache -import UI.PixmapCache +from .Ui_MqttUserPropertiesEditor import Ui_MqttUserPropertiesEditor class MqttUserPropertiesEditor(QWidget, Ui_MqttUserPropertiesEditor): @@ -37,9 +40,9 @@ super().__init__(parent) self.setupUi(self) - self.addButton.setIcon(UI.PixmapCache.getIcon("plus")) - self.deleteButton.setIcon(UI.PixmapCache.getIcon("minus")) - self.clearButton.setIcon(UI.PixmapCache.getIcon("editDelete")) + self.addButton.setIcon(EricPixmapCache.getIcon("plus")) + self.deleteButton.setIcon(EricPixmapCache.getIcon("minus")) + self.clearButton.setIcon(EricPixmapCache.getIcon("editDelete")) self.clearButton.clicked.connect(self.clear)
--- a/PluginMqttMonitor.epj Wed Sep 21 09:46:48 2022 +0200 +++ b/PluginMqttMonitor.epj Mon Oct 24 18:01:45 2022 +0200 @@ -207,7 +207,7 @@ ], "OTHERTOOLSPARMS": { "Black": { - "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|_build|buck-out|build|dist|__pypackages__)/", + "exclude": "/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|venv|\\.svn|\\.ipynb_checkpoints|_build|buck-out|build|dist|__pypackages__)/", "extend-exclude": "", "force-exclude": "", "line-length": 88, @@ -267,6 +267,7 @@ "MqttMonitor/i18n/mqttmonitor_ru.ts" ], "TRANSLATIONSBINPATH": "", + "TRANSLATIONSOURCESTARTPATH": "", "UICPARAMS": { "Package": "", "PackagesRoot": "",
--- a/PluginMqttMonitor.py Wed Sep 21 09:46:48 2022 +0200 +++ b/PluginMqttMonitor.py Mon Oct 24 18:01:45 2022 +0200 @@ -13,11 +13,14 @@ from PyQt6.QtCore import Qt, QObject, QTranslator, QCoreApplication from PyQt6.QtGui import QKeySequence -from EricWidgets.EricApplication import ericApp -from EricGui.EricAction import EricAction +from eric7 import Preferences +from eric7.EricGui.EricAction import EricAction +from eric7.EricWidgets.EricApplication import ericApp -import UI.PixmapCache -import Preferences +try: + from eric7.EricGui import EricPixmapCache +except ImportError: + from UI import PixmapCache as EricPixmapCache from MqttMonitor.MqttProtocols import MqttProtocols @@ -26,7 +29,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "10.2.2" +version = "10.3.0" className = "MqttMonitorPlugin" packageName = "MqttMonitor" shortDescription = "Plug-in implementing a tool to connect to a MQTT broker" @@ -191,7 +194,7 @@ self.__ui.addSideWidget( self.__ui.RightSide, self.__widget, - UI.PixmapCache.getIcon(os.path.join("MqttMonitor", "icons", iconName)), + EricPixmapCache.getIcon(os.path.join("MqttMonitor", "icons", iconName)), self.tr("MQTT Monitor"), )