Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Python Plugins: Cleanup includes
Freya Lupenbf81573448ec
diff --git a/plugins/python/assignprofiledialog/assignprofiledialog.py b/plugins/python/assignprofiledialog/assignprofiledialog.pyindex 7998cccfb6..7be147b70a 100644--- a/plugins/python/assignprofiledialog/assignprofiledialog.py+++ b/plugins/python/assignprofiledialog/assignprofiledialog.py@@ -9,6 +9,7 @@ except:from PyQt5.QtWidgets import (QDialogButtonBox, QDialog,QMessageBox, QComboBox, QVBoxLayout)from krita import Extension+from builtins import Application, i18nclass AssignProfileDialog(Extension):diff --git a/plugins/python/batch_exporter/Infrastructure.py b/plugins/python/batch_exporter/Infrastructure.pyindex 9ac6a91805..d1965f0ad6 100644--- a/plugins/python/batch_exporter/Infrastructure.py+++ b/plugins/python/batch_exporter/Infrastructure.py@@ -3,10 +3,8 @@#import re-from collections import OrderedDictfrom functools import partialfrom itertools import groupby, product, starmap, tee-from pathlib import Pathfrom krita import Kritatry:diff --git a/plugins/python/batch_exporter/Utils/Export.py b/plugins/python/batch_exporter/Utils/Export.pyindex abca960746..f1627874e4 100644--- a/plugins/python/batch_exporter/Utils/Export.py+++ b/plugins/python/batch_exporter/Utils/Export.py@@ -2,7 +2,6 @@# SPDX-License-Identifier: GPL-3.0-or-later#-import refrom pathlib import Pathdiff --git a/plugins/python/channels2layers/channels2layers.py b/plugins/python/channels2layers/channels2layers.pyindex 2c889e2a36..f13795c346 100644--- a/plugins/python/channels2layers/channels2layers.py+++ b/plugins/python/channels2layers/channels2layers.py@@ -17,15 +17,13 @@ import refrom krita import (Extension,InfoObject,- Node,Selection)+from builtins import i18n, i18nc, Applicationtry:from PyQt6.QtCore import (pyqtSlot,- QBuffer,QByteArray,- QIODevice,Qt,QRect)@@ -36,7 +34,6 @@ try:)from PyQt6.QtWidgets import (QApplication,- QCheckBox,QComboBox,QDialog,QDialogButtonBox,@@ -54,9 +51,7 @@ try:except:from PyQt5.QtCore import (pyqtSlot,- QBuffer,QByteArray,- QIODevice,Qt,QRect)@@ -67,7 +62,6 @@ except:)from PyQt5.QtWidgets import (QApplication,- QCheckBox,QComboBox,QDialog,QDialogButtonBox,diff --git a/plugins/python/colorspace/colorspace.py b/plugins/python/colorspace/colorspace.pyindex 21c2394fad..6aab432bba 100644--- a/plugins/python/colorspace/colorspace.py+++ b/plugins/python/colorspace/colorspace.py@@ -1,10 +1,11 @@# SPDX-License-Identifier: CC0-1.0-import krita+from krita import Extension+from builtins import i18nfrom . import uicolorspace-class ColorSpaceExtension(krita.Extension):+class ColorSpaceExtension(Extension):def __init__(self, parent):super(ColorSpaceExtension, self).__init__(parent)diff --git a/plugins/python/colorspace/uicolorspace.py b/plugins/python/colorspace/uicolorspace.pyindex 7f7193875c..d0996a7a34 100644--- a/plugins/python/colorspace/uicolorspace.py+++ b/plugins/python/colorspace/uicolorspace.py@@ -18,7 +18,8 @@ except:QAbstractItemView, QDialogButtonBox,QVBoxLayout, QFrame, QMessageBox, QPushButton,QAbstractScrollArea)-import krita+from krita import Krita+from builtins import i18nfrom scripter import utilsfrom . import resources_rc # Loads the icon qrc@@ -42,7 +43,7 @@ class UIColorSpace(object):self.buttonBox = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)- self.kritaInstance = krita.Krita.instance()+ self.kritaInstance = Krita.instance()self.documentsList = []self.colorModelsList = []self.colorDepthsList = []diff --git a/plugins/python/comics_project_management_tools/comics_export_dialog.py b/plugins/python/comics_project_management_tools/comics_export_dialog.pyindex 58b3aeb706..d05900aad8 100644--- a/plugins/python/comics_project_management_tools/comics_export_dialog.py+++ b/plugins/python/comics_project_management_tools/comics_export_dialog.py@@ -13,13 +13,13 @@ A dialog for editing the exporter settings.from enum import IntEnumtry:from PyQt6.QtGui import QStandardItem, QStandardItemModel, QColor, QFont, QIcon, QPixmap- from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QGroupBox, QFormLayout, QCheckBox, QComboBox, QSpinBox, QWidget, QVBoxLayout, QHBoxLayout, QTabWidget, QPushButton, QLineEdit, QLabel, QListView, QTableView, QFontComboBox, QSpacerItem, QColorDialog, QStyledItemDelegate+ from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QGroupBox, QFormLayout, QCheckBox, QComboBox, QSpinBox, QWidget, QVBoxLayout, QHBoxLayout, QTabWidget, QPushButton, QLineEdit, QLabel, QListView, QTableView, QFontComboBox, QColorDialog, QStyledItemDelegatefrom PyQt6.QtCore import Qt, QUuidexcept:from PyQt5.QtGui import QStandardItem, QStandardItemModel, QColor, QFont, QIcon, QPixmap- from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QGroupBox, QFormLayout, QCheckBox, QComboBox, QSpinBox, QWidget, QVBoxLayout, QHBoxLayout, QTabWidget, QPushButton, QLineEdit, QLabel, QListView, QTableView, QFontComboBox, QSpacerItem, QColorDialog, QStyledItemDelegate+ from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QGroupBox, QFormLayout, QCheckBox, QComboBox, QSpinBox, QWidget, QVBoxLayout, QHBoxLayout, QTabWidget, QPushButton, QLineEdit, QLabel, QListView, QTableView, QFontComboBox, QColorDialog, QStyledItemDelegatefrom PyQt5.QtCore import Qt, QUuid-from krita import *+from builtins import i18n, Application"""A generic widget to make selecting size easier.diff --git a/plugins/python/comics_project_management_tools/comics_exporter.py b/plugins/python/comics_project_management_tools/comics_exporter.pyindex 76ec4a5f90..ba8701ce44 100644--- a/plugins/python/comics_project_management_tools/comics_exporter.py+++ b/plugins/python/comics_project_management_tools/comics_exporter.py@@ -9,22 +9,17 @@ SPDX-License-Identifier: GPL-3.0-or-later"""An exporter that take the comicsConfig and uses it to generate several files."""-import sysfrom pathlib import Pathimport zipfile-from xml.dom import minidomfrom xml.etree import ElementTree as ET-import types-import retry:- from PyQt6.QtWidgets import QLabel, QProgressDialog, QMessageBox, QApplication # For the progress dialog.- from PyQt6.QtCore import QElapsedTimer, QLocale, Qt, QRectF, QPointF- from PyQt6.QtGui import QImage, QTransform, QPainterPath, QFontMetrics, QFont+ from PyQt6.QtWidgets import QProgressDialog, QMessageBox, QApplication # For the progress dialog.+ from PyQt6.QtCore import QElapsedTimerexcept:- from PyQt5.QtWidgets import QLabel, QProgressDialog, QMessageBox, QApplication # For the progress dialog.- from PyQt5.QtCore import QElapsedTimer, QLocale, Qt, QRectF, QPointF- from PyQt5.QtGui import QImage, QTransform, QPainterPath, QFontMetrics, QFont-from krita import *+ from PyQt5.QtWidgets import QProgressDialog, QMessageBox, QApplication # For the progress dialog.+ from PyQt5.QtCore import QElapsedTimer+from krita import InfoObject+from builtins import i18n, Applicationfrom . import exporters"""diff --git a/plugins/python/comics_project_management_tools/comics_metadata_dialog.py b/plugins/python/comics_project_management_tools/comics_metadata_dialog.pyindex 1f012f1c3f..2ac68a891d 100644--- a/plugins/python/comics_project_management_tools/comics_metadata_dialog.py+++ b/plugins/python/comics_project_management_tools/comics_metadata_dialog.py@@ -9,11 +9,9 @@ SPDX-License-Identifier: GPL-3.0-or-later"""This is a metadata editor that helps out setting the proper metadata"""-import sysimport os # For finding the script location.import csvimport re-import typesfrom pathlib import Path # For reading all the files in a directory.try:from PyQt6.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QPainter, QPalette, QFontDatabase@@ -23,6 +21,7 @@ except:from PyQt5.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QPainter, QPalette, QFontDatabasefrom PyQt5.QtWidgets import QComboBox, QCompleter, QStyledItemDelegate, QLineEdit, QDialog, QDialogButtonBox, QVBoxLayout, QFormLayout, QTabWidget, QWidget, QPlainTextEdit, QHBoxLayout, QSpinBox, QDateEdit, QPushButton, QLabel, QTableViewfrom PyQt5.QtCore import QDir, QLocale, QStringListModel, Qt, QDate, QSize, QUuid, QLibraryInfo+from builtins import i18n, Application"""multi entry completer cobbled together from the two examples on stackoverflow:3779720diff --git a/plugins/python/comics_project_management_tools/comics_project_manager_docker.py b/plugins/python/comics_project_management_tools/comics_project_manager_docker.pyindex 990b400e80..83070ebd2e 100644--- a/plugins/python/comics_project_management_tools/comics_project_manager_docker.py+++ b/plugins/python/comics_project_management_tools/comics_project_manager_docker.py@@ -9,7 +9,6 @@ SPDX-License-Identifier: GPL-3.0-or-later"""This is a docker that helps you organise your comics project."""-import sysimport jsonimport osimport zipfile # quick reading of documents@@ -18,16 +17,16 @@ import enumfrom math import floorimport xml.etree.ElementTree as ETtry:- from PyQt6.QtCore import QElapsedTimer, QSize, Qt, QRect, QFileSystemWatcher, QTimer- from PyQt6.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QFontMetrics, QPainter, QPalette, QFont, QAction+ from PyQt6.QtCore import QElapsedTimer, QSize, Qt, QRect, QFileSystemWatcher, QTimer, QUuid+ from PyQt6.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QFontMetrics, QFont, QActionfrom PyQt6.QtWidgets import QHBoxLayout, QVBoxLayout, QListView, QToolButton, QMenu, QPushButton, QSpacerItem, QSizePolicy, QWidget, QAbstractItemView, QProgressDialog, QDialog, QDialogButtonBox, QApplication, QSplitter, QSlider, QLabel, QStyledItemDelegate, QStyle, QMessageBoxexcept:- from PyQt5.QtCore import QElapsedTimer, QSize, Qt, QRect, QFileSystemWatcher, QTimer- from PyQt5.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QFontMetrics, QPainter, QPalette, QFont+ from PyQt5.QtCore import QElapsedTimer, QSize, Qt, QRect, QFileSystemWatcher, QTimer, QUuid+ from PyQt5.QtGui import QStandardItem, QStandardItemModel, QImage, QIcon, QPixmap, QFontMetrics, QFontfrom PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QListView, QToolButton, QMenu, QAction, QPushButton, QSpacerItem, QSizePolicy, QWidget, QAbstractItemView, QProgressDialog, QDialog, QDialogButtonBox, QApplication, QSplitter, QSlider, QLabel, QStyledItemDelegate, QStyle, QMessageBox-import math-from krita import *+from krita import DockWidget, DockWidgetFactory, DockWidgetFactoryBase, FileDialog+from builtins import i18n, Applicationfrom . import comics_metadata_dialog, comics_exporter, comics_export_dialog, comics_project_setup_wizard, comics_template_dialog, comics_project_settings_dialog, comics_project_page_viewer, comics_project_translation_scraper"""diff --git a/plugins/python/comics_project_management_tools/comics_project_page_viewer.py b/plugins/python/comics_project_management_tools/comics_project_page_viewer.pyindex ee788dd569..922204c513 100644--- a/plugins/python/comics_project_management_tools/comics_project_page_viewer.py+++ b/plugins/python/comics_project_management_tools/comics_project_page_viewer.py@@ -17,14 +17,14 @@ import jsonimport zipfiletry:from PyQt6.QtGui import QImage, QPainter, QShortcut- from PyQt6.QtWidgets import QDialog, QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QSizePolicy, QDialogButtonBox, QLabel+ from PyQt6.QtWidgets import QDialog, QHBoxLayout, QVBoxLayout, QPushButton, QSizePolicyfrom PyQt6.QtCore import QSize, Qt# To run standalonefrom PyQt6.QtWidgets import QApplicationexcept:from PyQt5.QtGui import QImage, QPainter- from PyQt5.QtWidgets import QDialog, QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QSizePolicy, QDialogButtonBox, QShortcut, QLabel+ from PyQt5.QtWidgets import QDialog, QHBoxLayout, QVBoxLayout, QPushButton, QSizePolicy, QShortcutfrom PyQt5.QtCore import QSize, Qt# To run standalone@@ -288,7 +288,7 @@ if __name__ == '__main__':page_viewer_dialog.go_to_page_index(0)page_viewer_dialog.show()else:- print('No comic found in {comic}'.format(comic=comic))+ print('No comic found in {comic}'.format(comic=path_to_config))else:print('Pass the path to a Krita comicConfig.json file to this script, to view the comic.')diff --git a/plugins/python/comics_project_management_tools/comics_project_settings_dialog.py b/plugins/python/comics_project_management_tools/comics_project_settings_dialog.pyindex ea786ac972..8e1194a854 100644--- a/plugins/python/comics_project_management_tools/comics_project_settings_dialog.py+++ b/plugins/python/comics_project_management_tools/comics_project_settings_dialog.py@@ -11,13 +11,14 @@ A dialog for editing the general project settings."""import ostry:- from PyQt6.QtWidgets import QWidget, QDialog, QDialogButtonBox, QHBoxLayout, QFormLayout, QPushButton, QLabel, QLineEdit, QToolButton, QFrame, QComboBox, QSizePolicy+ from PyQt6.QtWidgets import QWidget, QDialog, QDialogButtonBox, QHBoxLayout, QFormLayout, QLabel, QLineEdit, QToolButton, QFrame, QComboBox, QSizePolicyfrom PyQt6.QtCore import QDir, Qt, pyqtSignalfrom PyQt6.QtGui import QActionexcept:- from PyQt5.QtWidgets import QWidget, QDialog, QDialogButtonBox, QHBoxLayout, QFormLayout, QPushButton, QLabel, QLineEdit, QToolButton, QFrame, QAction, QComboBox, QSizePolicy+ from PyQt5.QtWidgets import QWidget, QDialog, QDialogButtonBox, QHBoxLayout, QFormLayout, QLabel, QLineEdit, QToolButton, QFrame, QAction, QComboBox, QSizePolicyfrom PyQt5.QtCore import QDir, Qt, pyqtSignal-from krita import *+from krita import FileDialog+from builtins import i18n, Application"""A Widget that contains both a qlabel and a button for selecting a path.diff --git a/plugins/python/comics_project_management_tools/comics_project_setup_wizard.py b/plugins/python/comics_project_management_tools/comics_project_setup_wizard.pyindex 3f296936bc..408bb610d3 100644--- a/plugins/python/comics_project_management_tools/comics_project_setup_wizard.py+++ b/plugins/python/comics_project_management_tools/comics_project_setup_wizard.py@@ -15,12 +15,13 @@ import os # For finding the script location.from pathlib import Path # For reading all the files in a directory.import random # For selecting two random words from a list.try:- from PyQt6.QtWidgets import QWidget, QWizard, QWizardPage, QHBoxLayout, QFormLayout, QLineEdit, QPushButton, QCheckBox, QLabel, QDialog- from PyQt6.QtCore import QDate, QLocale, QUuid+ from PyQt6.QtWidgets import QWizard, QWizardPage, QHBoxLayout, QFormLayout, QLineEdit, QPushButton, QCheckBox, QLabel, QDialog, QMessageBox+ from PyQt6.QtCore import QLocale, QUuidexcept:- from PyQt5.QtWidgets import QWidget, QWizard, QWizardPage, QHBoxLayout, QFormLayout, QLineEdit, QPushButton, QCheckBox, QLabel, QDialog- from PyQt5.QtCore import QDate, QLocale, QUuid-from krita import *+ from PyQt5.QtWidgets import QWizard, QWizardPage, QHBoxLayout, QFormLayout, QLineEdit, QPushButton, QCheckBox, QLabel, QDialog, QMessageBox+ from PyQt5.QtCore import QLocale, QUuid+from krita import FileDialog+from builtins import i18nfrom . import comics_metadata_dialog"""diff --git a/plugins/python/comics_project_management_tools/comics_project_translation_scraper.py b/plugins/python/comics_project_management_tools/comics_project_translation_scraper.pyindex 8dd85a08ff..b46abfc8bf 100644--- a/plugins/python/comics_project_management_tools/comics_project_translation_scraper.py+++ b/plugins/python/comics_project_management_tools/comics_project_translation_scraper.py@@ -16,11 +16,8 @@ This class does several things:4) Writing to a csv file was considered until the realisation hit that comic dialog itself contains commas."""-import sysimport os-import csvimport zipfile-import typesfrom xml.dom import minidomtry:from PyQt6.QtCore import QDateTime, Qtdiff --git a/plugins/python/comics_project_management_tools/comics_template_dialog.py b/plugins/python/comics_project_management_tools/comics_template_dialog.pyindex 254527b8de..561951fe92 100644--- a/plugins/python/comics_project_management_tools/comics_template_dialog.py+++ b/plugins/python/comics_project_management_tools/comics_template_dialog.py@@ -11,16 +11,16 @@ Template dialog"""import osimport shutil-#from PyQt5.QtGui import *try:- from PyQt6.QtWidgets import QDialog, QComboBox, QDialogButtonBox, QVBoxLayout, QFormLayout, QGridLayout, QWidget, QPushButton, QHBoxLayout, QLabel, QSpinBox, QDoubleSpinBox, QLineEdit, QTabWidget, QColorDialog, QProgressDialog+ from PyQt6.QtWidgets import QDialog, QComboBox, QDialogButtonBox, QVBoxLayout, QFormLayout, QGridLayout, QWidget, QPushButton, QHBoxLayout, QLabel, QSpinBox, QDoubleSpinBox, QLineEdit, QTabWidget, QColorDialog, QProgressDialog, QApplicationfrom PyQt6.QtCore import QLocale, Qt, QByteArray, QRectF- from PyQt6.QtGui import QImage, QPainter, QPixmap+ from PyQt6.QtGui import QImage, QPainter, QPixmap, QColorexcept:- from PyQt5.QtWidgets import QDialog, QComboBox, QDialogButtonBox, QVBoxLayout, QFormLayout, QGridLayout, QWidget, QPushButton, QHBoxLayout, QLabel, QSpinBox, QDoubleSpinBox, QLineEdit, QTabWidget, QColorDialog, QProgressDialog+ from PyQt5.QtWidgets import QDialog, QComboBox, QDialogButtonBox, QVBoxLayout, QFormLayout, QGridLayout, QWidget, QPushButton, QHBoxLayout, QLabel, QSpinBox, QDoubleSpinBox, QLineEdit, QTabWidget, QColorDialog, QProgressDialog, QApplicationfrom PyQt5.QtCore import QLocale, Qt, QByteArray, QRectF- from PyQt5.QtGui import QImage, QPainter, QPixmap-from krita import *+ from PyQt5.QtGui import QImage, QPainter, QPixmap, QColor+from krita import FileDialog, InfoObject+from builtins import i18n, Application"""Quick and dirty QComboBox subclassing that handles unitconversion for us."""diff --git a/plugins/python/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.py b/plugins/python/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.pyindex 13774fc2db..bbdab6dcba 100644--- a/plugins/python/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.py+++ b/plugins/python/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.py@@ -17,12 +17,12 @@ import osimport retry:from PyQt6.QtCore import QDate, Qt, QPointF, QByteArray, QBuffer, QLocale- from PyQt6.QtGui import QImage, QColor, QFont, QRawFont- from PyQt6.QtXml import QDomDocument, QDomElement, QDomText, QDomNodeList+ from PyQt6.QtGui import QImage, QColor+ from PyQt6.QtXml import QDomDocument, QDomElementexcept:from PyQt5.QtCore import QDate, Qt, QPointF, QByteArray, QBuffer, QLocale- from PyQt5.QtGui import QImage, QColor, QFont, QRawFont- from PyQt5.QtXml import QDomDocument, QDomElement, QDomText, QDomNodeList+ from PyQt5.QtGui import QImage, QColor+ from PyQt5.QtXml import QDomDocument, QDomElementfrom . import CPMT_po_parser as po_parserdef write_xml(configDictionary = {}, pageData = [], pagesLocationList = [], locationBasic = str(), locationStandAlone = str(), projectUrl = str()):diff --git a/plugins/python/comics_project_management_tools/exporters/CPMT_EPUB_exporter.py b/plugins/python/comics_project_management_tools/exporters/CPMT_EPUB_exporter.pyindex 55bc951176..eda5067257 100644--- a/plugins/python/comics_project_management_tools/exporters/CPMT_EPUB_exporter.py+++ b/plugins/python/comics_project_management_tools/exporters/CPMT_EPUB_exporter.py@@ -15,13 +15,14 @@ import osfrom pathlib import Pathimport zipfiletry:- from PyQt6.QtXml import QDomDocument, QDomElement, QDomText, QDomNodeList+ from PyQt6.QtXml import QDomDocumentfrom PyQt6.QtCore import Qt, QDateTime, QPointFfrom PyQt6.QtGui import QImage, QPolygonF, QColorexcept:- from PyQt5.QtXml import QDomDocument, QDomElement, QDomText, QDomNodeList+ from PyQt5.QtXml import QDomDocumentfrom PyQt5.QtCore import Qt, QDateTime, QPointFfrom PyQt5.QtGui import QImage, QPolygonF, QColor+from builtins import i18ndef export(configDictionary = {}, projectURL = str(), pagesLocationList = [], pageData = []):path = Path(os.path.join(projectURL, configDictionary["exportLocation"]))diff --git a/plugins/python/comics_project_management_tools/exporters/CPMT_po_parser.py b/plugins/python/comics_project_management_tools/exporters/CPMT_po_parser.pyindex 73a1227443..a2830ae6d9 100644--- a/plugins/python/comics_project_management_tools/exporters/CPMT_po_parser.py+++ b/plugins/python/comics_project_management_tools/exporters/CPMT_po_parser.py@@ -10,7 +10,6 @@ SPDX-License-Identifier: GPL-3.0-or-laterA thing that parses through POT files."""-import sysimport osimport rediff --git a/plugins/python/documenttools/documenttools.py b/plugins/python/documenttools/documenttools.pyindex eda0655465..3fae714b3d 100644--- a/plugins/python/documenttools/documenttools.py+++ b/plugins/python/documenttools/documenttools.py@@ -1,10 +1,11 @@# SPDX-License-Identifier: CC0-1.0-import krita+from krita import Extension+from builtins import i18nfrom . import uidocumenttools-class DocumentToolsExtension(krita.Extension):+class DocumentToolsExtension(Extension):def __init__(self, parent):super(DocumentToolsExtension, self).__init__(parent)diff --git a/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py b/plugins/python/documenttools/tools/canvassizetool/canvassizetool.pyindex 0ca40b0444..08e0019f17 100644--- a/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py+++ b/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py@@ -6,7 +6,7 @@ try:except:from PyQt5.QtWidgets import (QWidget, QSpinBox,QVBoxLayout, QFormLayout)-+from builtins import i18nclass CanvasSizeTool(QWidget):diff --git a/plugins/python/documenttools/tools/rotatetool/rotatetool.py b/plugins/python/documenttools/tools/rotatetool/rotatetool.pyindex 8995db9937..040ad8e390 100644--- a/plugins/python/documenttools/tools/rotatetool/rotatetool.py+++ b/plugins/python/documenttools/tools/rotatetool/rotatetool.py@@ -5,7 +5,7 @@ try:except:from PyQt5.QtWidgets import QWidget, QSpinBox, QFormLayoutimport math-+from builtins import i18nclass RotateTool(QWidget):diff --git a/plugins/python/documenttools/tools/scaletool/scaletool.py b/plugins/python/documenttools/tools/scaletool/scaletool.pyindex e4404d2e1d..96129ed365 100644--- a/plugins/python/documenttools/tools/scaletool/scaletool.py+++ b/plugins/python/documenttools/tools/scaletool/scaletool.py@@ -6,7 +6,7 @@ try:except:from PyQt5.QtWidgets import (QWidget, QSpinBox,QVBoxLayout, QFormLayout, QComboBox)-+from builtins import i18n, i18ncclass ScaleTool(QWidget):diff --git a/plugins/python/documenttools/uidocumenttools.py b/plugins/python/documenttools/uidocumenttools.pyindex 869813e727..8957ed271c 100644--- a/plugins/python/documenttools/uidocumenttools.py+++ b/plugins/python/documenttools/uidocumenttools.py@@ -11,9 +11,9 @@ except:from PyQt5.QtWidgets import (QFormLayout, QListWidget, QAbstractItemView,QDialogButtonBox, QVBoxLayout, QFrame, QTabWidget,QPushButton, QAbstractScrollArea, QMessageBox)-import krita+from krita import Kritaimport importlib-+from builtins import i18nclass UIDocumentTools(object):@@ -28,7 +28,7 @@ class UIDocumentTools(object):self.buttonBox = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)- self.kritaInstance = krita.Krita.instance()+ self.kritaInstance = Krita.instance()self.documentsList = []self.refreshButton.clicked.connect(self.refreshButtonClicked)diff --git a/plugins/python/exportlayers/exportlayers.py b/plugins/python/exportlayers/exportlayers.pyindex d98225cc35..4580d0825d 100644--- a/plugins/python/exportlayers/exportlayers.py+++ b/plugins/python/exportlayers/exportlayers.py@@ -1,10 +1,11 @@# SPDX-License-Identifier: CC0-1.0-import krita+from krita import Extension+from builtins import i18nfrom . import uiexportlayers-class ExportLayersExtension(krita.Extension):+class ExportLayersExtension(Extension):def __init__(self, parent):super(ExportLayersExtension, self).__init__(parent)diff --git a/plugins/python/exportlayers/uiexportlayers.py b/plugins/python/exportlayers/uiexportlayers.pyindex 805029df64..4100d7fca9 100644--- a/plugins/python/exportlayers/uiexportlayers.py+++ b/plugins/python/exportlayers/uiexportlayers.py@@ -17,6 +17,7 @@ except:QComboBox, QListWidgetItem)import osfrom krita import Krita, InfoObject, FileDialog+from builtins import i18n, Applicationclass UIExportLayers(object):diff --git a/plugins/python/filtermanager/components/filtermanagertreemodel.py b/plugins/python/filtermanager/components/filtermanagertreemodel.pyindex ef0612a8f6..44935537f3 100644--- a/plugins/python/filtermanager/components/filtermanagertreemodel.py+++ b/plugins/python/filtermanager/components/filtermanagertreemodel.py@@ -6,6 +6,7 @@ try:except:from PyQt5.QtCore import QAbstractItemModel, QModelIndex, Qtfrom PyQt5.QtGui import QPixmap+from builtins import i18nfrom . import filtermanagertreeitemdiff --git a/plugins/python/filtermanager/filtermanager.py b/plugins/python/filtermanager/filtermanager.pyindex 910b8f79a6..750aba5961 100644--- a/plugins/python/filtermanager/filtermanager.py+++ b/plugins/python/filtermanager/filtermanager.py@@ -1,10 +1,11 @@# SPDX-License-Identifier: CC0-1.0-import krita+from krita import Extension+from builtins import i18nfrom . import uifiltermanager-class FilterManagerExtension(krita.Extension):+class FilterManagerExtension(Extension):def __init__(self, parent):super(FilterManagerExtension, self).__init__(parent)diff --git a/plugins/python/filtermanager/uifiltermanager.py b/plugins/python/filtermanager/uifiltermanager.pyindex cc3917832f..5233e4c3d2 100644--- a/plugins/python/filtermanager/uifiltermanager.py+++ b/plugins/python/filtermanager/uifiltermanager.py@@ -10,7 +10,8 @@ except:from PyQt5.QtCore import Qtfrom PyQt5.QtWidgets import (QFormLayout, QAbstractItemView, QDialogButtonBox,QVBoxLayout, QFrame, QTreeView)-import krita+from krita import Krita+from builtins import i18n, i18ncclass UIFilterManager(object):@@ -22,7 +23,7 @@ class UIFilterManager(object):self.buttonBox = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)- self.kritaInstance = krita.Krita.instance()+ self.kritaInstance = Krita.instance()self._filters = sorted(self.kritaInstance.filters())self._documents = self.kritaInstance.documents()self.treeModel = filtermanagertreemodel.FilterManagerTreeModel(self)diff --git a/plugins/python/highpass/highpass.py b/plugins/python/highpass/highpass.pyindex 800aabd5e3..5f21f12fea 100644--- a/plugins/python/highpass/highpass.py+++ b/plugins/python/highpass/highpass.py@@ -25,6 +25,7 @@ except:QVBoxLayout,)from krita import Extension+from builtins import i18n, i18nc, Applicationclass HighpassExtension(Extension):diff --git a/plugins/python/krita_script_starter/krita_script_starter.py b/plugins/python/krita_script_starter/krita_script_starter.pyindex 9249d86890..3bea9b96b4 100644--- a/plugins/python/krita_script_starter/krita_script_starter.py+++ b/plugins/python/krita_script_starter/krita_script_starter.py@@ -33,11 +33,9 @@ BBDimport osimport systry:- from PyQt6.QtCore import QStandardPaths, QSettingsfrom PyQt6.QtWidgets import QApplication, QWidget, QMessageBoximport PyQt6.uic as uicexcept:- from PyQt5.QtCore import QStandardPaths, QSettingsfrom PyQt5.QtWidgets import QApplication, QWidget, QMessageBoximport PyQt5.uic as uic@@ -96,7 +94,6 @@ DESKTOP_TEMPLATE = """[Desktop Entry]Type=ServiceServiceTypes=Krita/PythonPluginX-KDE-Library={library_name}-X-Python-2-Compatible=falseX-Krita-Manual=Manual.htmlName={script_name}Comment={script_comment}diff --git a/plugins/python/lastdocumentsdocker/lastdocumentsdocker.py b/plugins/python/lastdocumentsdocker/lastdocumentsdocker.pyindex 1350696158..420663c71a 100644--- a/plugins/python/lastdocumentsdocker/lastdocumentsdocker.py+++ b/plugins/python/lastdocumentsdocker/lastdocumentsdocker.py@@ -4,11 +4,12 @@ try:from PyQt6.QtWidgets import QWidget, QVBoxLayout, QListView, QPushButtonexcept:from PyQt5.QtWidgets import QWidget, QVBoxLayout, QListView, QPushButton-import krita+from krita import DockWidget+from builtins import i18nfrom . import lastdocumentslistmodel-class LastDocumentsDocker(krita.DockWidget):+class LastDocumentsDocker(DockWidget):def __init__(self):super(LastDocumentsDocker, self).__init__()diff --git a/plugins/python/lastdocumentsdocker/lastdocumentslistmodel.py b/plugins/python/lastdocumentsdocker/lastdocumentslistmodel.pyindex 2898a524a4..22d0af21ba 100644--- a/plugins/python/lastdocumentsdocker/lastdocumentslistmodel.py+++ b/plugins/python/lastdocumentsdocker/lastdocumentslistmodel.py@@ -6,7 +6,7 @@ try:except:from PyQt5.QtCore import QAbstractListModel, Qt, QSizefrom PyQt5.QtGui import QImage-import krita+from krita import Kritaimport zipfilefrom pathlib import Path@@ -17,7 +17,7 @@ class LastDocumentsListModel(QAbstractListModel):super(LastDocumentsListModel, self).__init__(parent)self.rootItem = ('Path',)- self.kritaInstance = krita.Krita.instance()+ self.kritaInstance = Krita.instance()self.recentDocuments = []self.devicePixelRatioF = devicePixelRatioFdiff --git a/plugins/python/mixer_slider_docker/mixer_slider_docker.py b/plugins/python/mixer_slider_docker/mixer_slider_docker.pyindex eddf09e32e..dde22c65d9 100644--- a/plugins/python/mixer_slider_docker/mixer_slider_docker.py+++ b/plugins/python/mixer_slider_docker/mixer_slider_docker.py@@ -13,6 +13,7 @@ except:from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QPushButtonfrom krita import Krita, DockWidget, ManagedColor, DockWidgetFactory, DockWidgetFactoryBase+from builtins import i18n, Applicationfrom .slider_line import SliderLinefrom .ui_mixer_slider_docker import UIMixerSliderDockerdiff --git a/plugins/python/mixer_slider_docker/ui_mixer_slider_docker.py b/plugins/python/mixer_slider_docker/ui_mixer_slider_docker.pyindex eaecaa6180..2122fff18c 100644--- a/plugins/python/mixer_slider_docker/ui_mixer_slider_docker.py+++ b/plugins/python/mixer_slider_docker/ui_mixer_slider_docker.py@@ -7,11 +7,9 @@'''try:from PyQt6.QtWidgets import QDialogButtonBox, QLabel, QVBoxLayout, QHBoxLayout, QSpinBox- from PyQt6.QtGui import QIntValidatorfrom PyQt6.QtCore import Qtexcept:from PyQt5.QtWidgets import QDialogButtonBox, QLabel, QVBoxLayout, QHBoxLayout, QSpinBox- from PyQt5.QtGui import QIntValidatorfrom PyQt5.QtCore import Qtimport kritadiff --git a/plugins/python/mutator/mutator.py b/plugins/python/mutator/mutator.pyindex 0f901e1572..b5ab944bd1 100644--- a/plugins/python/mutator/mutator.py+++ b/plugins/python/mutator/mutator.py@@ -24,7 +24,7 @@ SOFTWARE.'''-import sys, math, random, colorsys+import math, randomtry:from PyQt6.QtGui import QIconfrom PyQt6.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QPushButton@@ -32,8 +32,8 @@ try:except:from PyQt5.QtGui import QIconfrom PyQt5.QtWidgets import QWidget, QAction, QVBoxLayout, QSizePolicy, QPushButton-from krita import Extension, DockWidget, DockWidgetFactory, SliderSpinBox, ManagedColor-+from krita import Krita, Extension, DockWidget, DockWidgetFactory, SliderSpinBox, ManagedColor+from builtins import i18n# Global mutation settings...# (Typically normalized within 0.0-1.0 range.diff --git a/plugins/python/palette_docker/palette_docker.py b/plugins/python/palette_docker/palette_docker.pyindex 916ab0e702..c94681b732 100644--- a/plugins/python/palette_docker/palette_docker.py+++ b/plugins/python/palette_docker/palette_docker.py@@ -25,6 +25,7 @@ except:QPlainTextEdit, QCompleter, QMenu)from PyQt5.Qt import Qt, pyqtSlotfrom krita import DockWidget, Palette, PaletteView+from builtins import i18n, i18nc, Application# import the exportersfrom . import (diff --git a/plugins/python/palette_docker/palette_exporter_gimppalette.py b/plugins/python/palette_docker/palette_exporter_gimppalette.pyindex 89a3a70279..40df9131f9 100644--- a/plugins/python/palette_docker/palette_exporter_gimppalette.py+++ b/plugins/python/palette_docker/palette_exporter_gimppalette.py@@ -14,6 +14,7 @@ try:except:from PyQt5.QtWidgets import QMessageBoxfrom krita import Palette, FileDialog+from builtins import Application, i18nclass gimpPaletteExporter:diff --git a/plugins/python/palette_docker/palette_exporter_inkscapeSVG.py b/plugins/python/palette_docker/palette_exporter_inkscapeSVG.pyindex bbbb34bd7a..519e304092 100644--- a/plugins/python/palette_docker/palette_exporter_inkscapeSVG.py+++ b/plugins/python/palette_docker/palette_exporter_inkscapeSVG.py@@ -20,6 +20,7 @@ except:from PyQt5.QtXml import QDomDocumentfrom PyQt5.QtWidgets import QMessageBoxfrom krita import Palette, FileDialog+from builtins import Application, i18nclass inkscapeSVGExporter:diff --git a/plugins/python/palette_docker/palette_sortColors.py b/plugins/python/palette_docker/palette_sortColors.pyindex 917176e4d2..388927bf3f 100644--- a/plugins/python/palette_docker/palette_sortColors.py+++ b/plugins/python/palette_docker/palette_sortColors.py@@ -7,6 +7,7 @@# @package palette_dockerfrom krita import Palette+from builtins import Applicationclass sortColors(object):diff --git a/plugins/python/photobash_images/photobash_images_docker.py b/plugins/python/photobash_images/photobash_images_docker.pyindex abdeaec814..b4cd3408a6 100644--- a/plugins/python/photobash_images/photobash_images_docker.py+++ b/plugins/python/photobash_images/photobash_images_docker.py@@ -16,13 +16,20 @@# along with this program. If not, see <http://www.gnu.org/licenses/>.-from krita import *+from krita import Krita, DockWidget, FileDialog+from builtins import Application, i18n, i18ncimport copyimport mathtry:- from PyQt6 import QtWidgets, QtCore, uic+ from PyQt6 import uic+ from PyQt6.QtCore import Qt, QDirIterator, QMimeData, QUrl, QStandardPaths+ from PyQt6.QtWidgets import QWidget, QSizePolicy, QApplication, QMessageBox+ from PyQt6.QtGui import QImageexcept:- from PyQt5 import QtWidgets, QtCore, uic+ from PyQt5 import uic+ from PyQt5.QtCore import Qt, QDirIterator, QMimeData, QUrl, QStandardPaths+ from PyQt5.QtWidgets import QWidget, QSizePolicy, QApplication, QMessageBox+ from PyQt5.QtGui import QImagefrom .photobash_images_modulo import (Photobash_Display,Photobash_Button,diff --git a/plugins/python/photobash_images/photobash_images_modulo.py b/plugins/python/photobash_images/photobash_images_modulo.pyindex 5e5d5e9108..870388e10c 100644--- a/plugins/python/photobash_images/photobash_images_modulo.py+++ b/plugins/python/photobash_images/photobash_images_modulo.py@@ -15,11 +15,15 @@# You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.-from krita import *+from krita import Kritatry:- from PyQt6 import QtWidgets, QtCore+ from PyQt6.QtGui import QPolygon, QPainter, QPen, QBrush, QImage, QPixmap, QDrag, QPalette+ from PyQt6.QtCore import Qt, QPoint, QMimeData, QUrl, QSize, pyqtSignal+ from PyQt6.QtWidgets import QApplication, QWidget, QMenuexcept:- from PyQt5 import QtWidgets, QtCore+ from PyQt5.QtGui import QPolygon, QPainter, QPen, QBrush, QImage, QPixmap, QDrag, QPalette+ from PyQt5.QtCore import Qt, QPoint, QMimeData, QUrl, QSize, pyqtSignal+ from PyQt5.QtWidgets import QApplication, QWidget, QMenuDRAG_DELTA = 30TRIANGLE_SIZE = 20@@ -32,7 +36,7 @@ FAVOURITE_TRIANGLE = QPolygon([def customPaintEvent(instance, event):painter = QPainter(instance)- painter.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing, True)+ painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)painter.setPen(QPen(Qt.GlobalColor.black, 2, Qt.PenStyle.SolidLine))painter.setBrush(QBrush(Qt.GlobalColor.white, Qt.BrushStyle.SolidPattern))@@ -87,12 +91,12 @@ def customSetImage(instance, image):instance.update()def customMouseMoveEvent(self, event):- if event.modifiers() != QtCore.Qt.KeyboardModifier.ShiftModifier and event.modifiers() != QtCore.Qt.KeyboardModifier.AltModifier:+ if event.modifiers() != Qt.KeyboardModifier.ShiftModifier and event.modifiers() != Qt.KeyboardModifier.AltModifier:self.PREVIOUS_DRAG_X = Nonereturn# alt modifier is reserved for scrolling through- if self.PREVIOUS_DRAG_X and event.modifiers() == QtCore.Qt.KeyboardModifier.AltModifier:+ if self.PREVIOUS_DRAG_X and event.modifiers() == Qt.KeyboardModifier.AltModifier:if self.PREVIOUS_DRAG_X < event.x() - DRAG_DELTA:self.SIGNAL_WUP.emit(0)self.PREVIOUS_DRAG_X = event.x()@@ -138,8 +142,8 @@ def customMouseMoveEvent(self, event):drag.exec(Qt.DropAction.CopyAction)class Photobash_Display(QWidget):- SIGNAL_HOVER = QtCore.pyqtSignal(str)- SIGNAL_CLOSE = QtCore.pyqtSignal(int)+ SIGNAL_HOVER = pyqtSignal(str)+ SIGNAL_CLOSE = pyqtSignal(int)fitCanvasChecked = Falsescale = 100@@ -148,7 +152,7 @@ class Photobash_Display(QWidget):customSetImage(self, None)def sizeHint(self):- return QtCore.QSize(5000,5000)+ return QSize(5000,5000)def enterEvent(self, event):self.SIGNAL_HOVER.emit("D")@@ -157,7 +161,7 @@ class Photobash_Display(QWidget):self.SIGNAL_HOVER.emit("None")def mousePressEvent(self, event):- if (event.modifiers() == QtCore.Qt.KeyboardModifier.NoModifier and event.buttons() == QtCore.Qt.MouseButton.LeftButton):+ if (event.modifiers() == Qt.KeyboardModifier.NoModifier and event.buttons() == Qt.MouseButton.LeftButton):self.SIGNAL_CLOSE.emit(0)def mouseMoveEvent(self, event):@@ -177,16 +181,16 @@ class Photobash_Display(QWidget):customPaintEvent(self, event)class Photobash_Button(QWidget):- SIGNAL_HOVER = QtCore.pyqtSignal(str)- SIGNAL_LMB = QtCore.pyqtSignal(int)- SIGNAL_WUP = QtCore.pyqtSignal(int)- SIGNAL_WDN = QtCore.pyqtSignal(int)- SIGNAL_PREVIEW = QtCore.pyqtSignal(str)- SIGNAL_FAVOURITE = QtCore.pyqtSignal(str)- SIGNAL_UN_FAVOURITE = QtCore.pyqtSignal(str)- SIGNAL_OPEN_NEW = QtCore.pyqtSignal(str)- SIGNAL_REFERENCE = QtCore.pyqtSignal(str)- SIGNAL_DRAG = QtCore.pyqtSignal(int)+ SIGNAL_HOVER = pyqtSignal(str)+ SIGNAL_LMB = pyqtSignal(int)+ SIGNAL_WUP = pyqtSignal(int)+ SIGNAL_WDN = pyqtSignal(int)+ SIGNAL_PREVIEW = pyqtSignal(str)+ SIGNAL_FAVOURITE = pyqtSignal(str)+ SIGNAL_UN_FAVOURITE = pyqtSignal(str)+ SIGNAL_OPEN_NEW = pyqtSignal(str)+ SIGNAL_REFERENCE = pyqtSignal(str)+ SIGNAL_DRAG = pyqtSignal(int)PREVIOUS_DRAG_X = NonefitCanvasChecked = Falsescale = 100@@ -215,7 +219,7 @@ class Photobash_Button(QWidget):self.number = numberdef sizeHint(self):- return QtCore.QSize(2000,2000)+ return QSize(2000,2000)def enterEvent(self, event):self.SIGNAL_HOVER.emit(str(self.number))@@ -224,9 +228,9 @@ class Photobash_Button(QWidget):self.SIGNAL_HOVER.emit("None")def mousePressEvent(self, event):- if event.modifiers() == QtCore.Qt.KeyboardModifier.NoModifier and event.buttons() == QtCore.Qt.MouseButton.LeftButton:+ if event.modifiers() == Qt.KeyboardModifier.NoModifier and event.buttons() == Qt.MouseButton.LeftButton:self.SIGNAL_LMB.emit(self.number)- if event.modifiers() == QtCore.Qt.KeyboardModifier.AltModifier:+ if event.modifiers() == Qt.KeyboardModifier.AltModifier:self.PREVIOUS_DRAG_X = event.x()def mouseDoubleClickEvent(self, event):diff --git a/plugins/python/plugin_importer/plugin_downloader.py b/plugins/python/plugin_importer/plugin_downloader.pyindex 9be1d91d06..c32b77efa9 100644--- a/plugins/python/plugin_importer/plugin_downloader.py+++ b/plugins/python/plugin_importer/plugin_downloader.py@@ -20,6 +20,8 @@ import osimport urllibimport urllib.request+from builtins import i18n+class PluginDownloadError(Exception):"""Base class for all exceptions of this module."""diff --git a/plugins/python/plugin_importer/plugin_importer.py b/plugins/python/plugin_importer/plugin_importer.pyindex 0568bef83f..8e2a024418 100644--- a/plugins/python/plugin_importer/plugin_importer.py+++ b/plugins/python/plugin_importer/plugin_importer.py@@ -18,6 +18,7 @@ import sysfrom tempfile import TemporaryDirectoryimport zipfile+from builtins import i18nclass PluginImportError(Exception):"""Base class for all exceptions of this module."""diff --git a/plugins/python/plugin_importer/plugin_importer_extension.py b/plugins/python/plugin_importer/plugin_importer_extension.pyindex cba9d9dec2..ee037f62df 100644--- a/plugins/python/plugin_importer/plugin_importer_extension.py+++ b/plugins/python/plugin_importer/plugin_importer_extension.py@@ -11,11 +11,10 @@ import tempfilefrom krita import Krita, Extension, FileDialogtry:- from PyQt6.QtCore import QStandardPathsfrom PyQt6.QtWidgets import QMessageBox, QInputDialogexcept:- from PyQt5.QtCore import QStandardPathsfrom PyQt5.QtWidgets import QMessageBox, QInputDialog+from builtins import i18n, Applicationfrom .plugin_importer import PluginImporter, PluginImportErrorfrom .plugin_downloader import download_plugin, PluginDownloadErrordiff --git a/plugins/python/quick_settings_docker/quick_settings_docker.py b/plugins/python/quick_settings_docker/quick_settings_docker.pyindex dbda8e00f8..fe2cd05002 100644--- a/plugins/python/quick_settings_docker/quick_settings_docker.py+++ b/plugins/python/quick_settings_docker/quick_settings_docker.py@@ -21,6 +21,7 @@ except:QPixmap, QImage, QBrush, QPen, QIcon)from PyQt5.QtWidgets import QWidget, QTabWidget, QListView, QVBoxLayoutfrom krita import DockWidget+from builtins import i18n, Applicationclass QuickSettingsDocker(DockWidget):diff --git a/plugins/python/scriptdocker/scriptdocker.py b/plugins/python/scriptdocker/scriptdocker.pyindex 022801a27c..6191b490dc 100644--- a/plugins/python/scriptdocker/scriptdocker.py+++ b/plugins/python/scriptdocker/scriptdocker.py@@ -2,10 +2,10 @@from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QFormLayout,QHBoxLayout, QPushButton, QLineEdit)-import krita+from krita import DockWidget+from builtins import i18n--class ScriptDocker(krita.DockWidget):+class ScriptDocker(DockWidget):def __init__(self):super(ScriptDocker, self).__init__()diff --git a/plugins/python/scripter/debugcontroller.py b/plugins/python/scripter/debugcontroller.pyindex 2d9bf65552..0186770b98 100644--- a/plugins/python/scripter/debugcontroller.py+++ b/plugins/python/scripter/debugcontroller.py@@ -5,6 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later"""from .debugger_scripter import debuggerimport asyncio+from builtins import i18nclass DebugController (object):diff --git a/plugins/python/scripter/debugger_scripter/debugger.py b/plugins/python/scripter/debugger_scripter/debugger.pyindex b62d60a8e9..9f78a4ac28 100644--- a/plugins/python/scripter/debugger_scripter/debugger.py+++ b/plugins/python/scripter/debugger_scripter/debugger.py@@ -5,7 +5,6 @@ SPDX-License-Identifier: GPL-2.0-or-later"""import bdbimport multiprocessing-import sysimport asynciofrom . import debuggerformatterdiff --git a/plugins/python/scripter/resources_rc.py b/plugins/python/scripter/resources_rc.pyindex 0c6e353eee..d3976839c9 100644--- a/plugins/python/scripter/resources_rc.py+++ b/plugins/python/scripter/resources_rc.py@@ -847,4 +847,4 @@ def qInitResources():def qCleanupResources():QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)-qInitResources()+qInitResources()\ No newline at end of filediff --git a/plugins/python/scripter/scripter.py b/plugins/python/scripter/scripter.pyindex 301e8a0df2..c600f7396f 100644--- a/plugins/python/scripter/scripter.py+++ b/plugins/python/scripter/scripter.py@@ -8,6 +8,7 @@ try:except:from PyQt5.QtCore import QSettings, QStandardPathsfrom krita import Krita, Extension+from builtins import i18nfrom . import uicontroller, documentcontroller, debugcontrollerdiff --git a/plugins/python/scripter/test.py b/plugins/python/scripter/test.pyindex df0051ee8d..54b5f75901 100644--- a/plugins/python/scripter/test.py+++ b/plugins/python/scripter/test.py@@ -6,13 +6,13 @@ SPDX-License-Identifier: GPL-2.0-or-later# editor.pytry:- from PyQt6.QtCore import *- from PyQt6.QtGui import *- from PyQt6.QtWidgets import *+ from PyQt6.QtCore import QApplication+ from PyQt6.QtGui import QFont+ from PyQt6.QtWidgets import QPlainTextEditexcept:- from PyQt5.QtCore import *- from PyQt5.QtGui import *- from PyQt5.QtWidgets import *+ from PyQt5.QtCore import QApplication+ from PyQt5.QtGui import QFont+ from PyQt5.QtWidgets import QPlainTextEditimport syntaxdiff --git a/plugins/python/scripter/ui_scripter/actions/closeaction/closeaction.py b/plugins/python/scripter/ui_scripter/actions/closeaction/closeaction.pyindex 595632cdaf..3bb576d820 100644--- a/plugins/python/scripter/ui_scripter/actions/closeaction/closeaction.py+++ b/plugins/python/scripter/ui_scripter/actions/closeaction/closeaction.py@@ -11,8 +11,8 @@ except:from PyQt5.QtWidgets import QAction, QMessageBoxfrom PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qt-import krita+from builtins import i18nclass CloseAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/debugaction/debugaction.py b/plugins/python/scripter/ui_scripter/actions/debugaction/debugaction.pyindex 617d1acc55..762f1d13e0 100644--- a/plugins/python/scripter/ui_scripter/actions/debugaction/debugaction.py+++ b/plugins/python/scripter/ui_scripter/actions/debugaction/debugaction.py@@ -4,17 +4,14 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtGui import QIcon, QKeySequence, QAction- from scripter import resources_rc+ from PyQt6.QtGui import QKeySequence, QActionfrom PyQt6.QtCore import Qtexcept:from PyQt5.QtWidgets import QAction- from PyQt5.QtGui import QIcon, QKeySequence- from scripter import resources_rc+ from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtfrom .... import utils-import krita-+from builtins import i18nclass DebugAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/newaction/newaction.py b/plugins/python/scripter/ui_scripter/actions/newaction/newaction.pyindex 488bfc97a4..1c03019471 100644--- a/plugins/python/scripter/ui_scripter/actions/newaction/newaction.py+++ b/plugins/python/scripter/ui_scripter/actions/newaction/newaction.py@@ -11,7 +11,7 @@ except:from PyQt5.QtWidgets import QAction, QMessageBoxfrom PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qt-import krita+from builtins import i18nclass NewAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/openaction/openaction.py b/plugins/python/scripter/ui_scripter/actions/openaction/openaction.pyindex 06278ee480..2919c03bf5 100644--- a/plugins/python/scripter/ui_scripter/actions/openaction/openaction.py+++ b/plugins/python/scripter/ui_scripter/actions/openaction/openaction.py@@ -12,6 +12,7 @@ except:from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtfrom krita import FileDialog+from builtins import i18nimport os.pathdiff --git a/plugins/python/scripter/ui_scripter/actions/reloadaction/reloadaction.py b/plugins/python/scripter/ui_scripter/actions/reloadaction/reloadaction.pyindex 6d7bdecc2e..7b4643a2b5 100644--- a/plugins/python/scripter/ui_scripter/actions/reloadaction/reloadaction.py+++ b/plugins/python/scripter/ui_scripter/actions/reloadaction/reloadaction.py@@ -5,14 +5,14 @@ SPDX-License-Identifier: GPL-2.0-or-later"""try:from PyQt6.QtWidgets import QMessageBox- from PyQt6.QtGui import QIcon, QKeySequence, QAction+ from PyQt6.QtGui import QKeySequence, QActionfrom PyQt6.QtCore import Qtexcept:from PyQt5.QtWidgets import QAction, QMessageBox- from PyQt5.QtGui import QIcon, QKeySequence+ from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtfrom .... import utils-import krita+from builtins import i18nclass ReloadAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/runaction/runaction.py b/plugins/python/scripter/ui_scripter/actions/runaction/runaction.pyindex bf6fb8ded6..b6731ebb97 100644--- a/plugins/python/scripter/ui_scripter/actions/runaction/runaction.py+++ b/plugins/python/scripter/ui_scripter/actions/runaction/runaction.py@@ -4,18 +4,18 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtGui import QIcon, QKeySequence, QAction+ from PyQt6.QtGui import QKeySequence, QActionfrom PyQt6.QtCore import Qtexcept:from PyQt5.QtWidgets import QAction- from PyQt5.QtGui import QIcon, QKeySequence+ from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtimport sysimport tracebackimport inspectfrom . import docwrapperfrom .... import utils-import krita+from builtins import i18nimport importlibfrom importlib.machinery import SourceFileLoaderdiff --git a/plugins/python/scripter/ui_scripter/actions/saveaction/saveaction.py b/plugins/python/scripter/ui_scripter/actions/saveaction/saveaction.pyindex d810983871..e91b3ceead 100644--- a/plugins/python/scripter/ui_scripter/actions/saveaction/saveaction.py+++ b/plugins/python/scripter/ui_scripter/actions/saveaction/saveaction.py@@ -11,6 +11,7 @@ except:from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtfrom krita import FileDialog+from builtins import i18nclass SaveAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/saveasaction/saveasaction.py b/plugins/python/scripter/ui_scripter/actions/saveasaction/saveasaction.pyindex 37cebe849a..d018ebe953 100644--- a/plugins/python/scripter/ui_scripter/actions/saveasaction/saveasaction.py+++ b/plugins/python/scripter/ui_scripter/actions/saveasaction/saveasaction.py@@ -11,6 +11,7 @@ except:from PyQt5.QtGui import QKeySequencefrom PyQt5.QtCore import Qtfrom krita import FileDialog+from builtins import i18nclass SaveAsAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/settingsaction/fontscombobox.py b/plugins/python/scripter/ui_scripter/actions/settingsaction/fontscombobox.pyindex 87eca2680a..2655323577 100644--- a/plugins/python/scripter/ui_scripter/actions/settingsaction/fontscombobox.py+++ b/plugins/python/scripter/ui_scripter/actions/settingsaction/fontscombobox.py@@ -4,13 +4,13 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtWidgets import QComboBox, QCompleter+ from PyQt6.QtWidgets import QComboBoxfrom PyQt6.QtGui import QFontDatabase- from PyQt6.QtCore import Qt, QLibraryInfo+ from PyQt6.QtCore import QLibraryInfoexcept:- from PyQt5.QtWidgets import QComboBox, QCompleter+ from PyQt5.QtWidgets import QComboBoxfrom PyQt5.QtGui import QFontDatabase- from PyQt5.QtCore import Qt, QLibraryInfo+ from PyQt5.QtCore import QLibraryInfoclass FontsComboBox(QComboBox):diff --git a/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsaction.py b/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsaction.pyindex b459fc0137..b75dbd9506 100644--- a/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsaction.py+++ b/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsaction.py@@ -10,7 +10,7 @@ except:from PyQt5.QtWidgets import QActionfrom PyQt5.QtCore import Qtfrom . import settingsdialog-import krita+from builtins import i18nclass SettingsAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsdialog.py b/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsdialog.pyindex 70b8227625..89ad04cf2c 100644--- a/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsdialog.py+++ b/plugins/python/scripter/ui_scripter/actions/settingsaction/settingsdialog.py@@ -8,7 +8,7 @@ try:except:from PyQt5.QtWidgets import QDialog, QFormLayoutfrom . import syntaxstylescombobox, fontscombobox-import krita+from builtins import i18nclass SettingsDialog(QDialog):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggertable.py b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggertable.pyindex d85cbce65c..e18aa8dc3b 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggertable.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggertable.py@@ -7,7 +7,7 @@ try:from PyQt6.QtWidgets import QTableWidget, QTableWidgetItemexcept:from PyQt5.QtWidgets import QTableWidget, QTableWidgetItem-+from builtins import i18n, i18ncclass DebuggerTable(QTableWidget):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggerwidget.py b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggerwidget.pyindex 52e9a29102..105106f865 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggerwidget.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/debuggerwidget.py@@ -4,13 +4,12 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtWidgets import QWidget, QVBoxLayout, QToolBar, QTableWidget- #from PyQt6.QtGui import QAction+ from PyQt6.QtWidgets import QWidget, QVBoxLayout, QToolBarexcept:- from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBar, QTableWidget, QAction+ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBar+from builtins import i18nfrom . import stepaction, stopaction, debuggertable-class DebuggerWidget(QWidget):def __init__(self, scripter, parent=None):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stepaction.py b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stepaction.pyindex c5b672b71a..b1d6d62b54 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stepaction.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stepaction.py@@ -4,14 +4,11 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtGui import QIcon, QAction+ from PyQt6.QtGui import QActionexcept:from PyQt5.QtWidgets import QAction- from PyQt5.QtGui import QIcon-from scripter import resources_rcfrom .... import utils-import krita-+from builtins import i18nclass StepAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stopaction.py b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stopaction.pyindex c1fec4848b..d3ebf41cdb 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stopaction.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/debuggerwidget/stopaction.py@@ -8,8 +8,7 @@ try:except:from PyQt5.QtWidgets import QActionfrom PyQt5.QtGui import QIcon-from scripter import resources_rc-import krita+from builtins import i18nclass StopAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/clearaction.py b/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/clearaction.pyindex d7640b4538..1b77be8028 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/clearaction.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/clearaction.py@@ -8,7 +8,7 @@ try:except:from PyQt5.QtWidgets import QAction# from PyQt5.QtGui import QIcon-import krita+from builtins import i18nclass ClearAction(QAction):diff --git a/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/outputwidget.py b/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/outputwidget.pyindex 42673dd44f..c30ce7aad3 100644--- a/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/outputwidget.py+++ b/plugins/python/scripter/ui_scripter/tabwidgets/outputwidget/outputwidget.py@@ -4,11 +4,11 @@ SPDX-FileCopyrightText: 2017 Eliakin Costa <[email protected]>SPDX-License-Identifier: GPL-2.0-or-later"""try:- from PyQt6.QtWidgets import QWidget, QVBoxLayout, QToolBar, QTableWidget- #from PyQt6.QtGui import QAction+ from PyQt6.QtWidgets import QWidget, QVBoxLayout, QToolBarexcept:- from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBar, QTableWidget, QAction+ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBarfrom . import clearaction, outputtextedit+from builtins import i18nclass OutPutWidget(QWidget):diff --git a/plugins/python/scripter/uicontroller.py b/plugins/python/scripter/uicontroller.pyindex 05324bc2e3..c760e05685 100644--- a/plugins/python/scripter/uicontroller.py+++ b/plugins/python/scripter/uicontroller.py@@ -19,7 +19,7 @@ from .ui_scripter.syntax import syntax, syntaxstylesfrom .ui_scripter.editor import pythoneditorfrom . import scripterdialog, utilsimport importlib-import krita+from builtins import i18nfrom scripter import resources_rc # Loads the icons qrcdiff --git a/plugins/python/selectionsbagdocker/selectionsbagdocker.py b/plugins/python/selectionsbagdocker/selectionsbagdocker.pyindex cbece64d62..8a08195f3f 100644--- a/plugins/python/selectionsbagdocker/selectionsbagdocker.py+++ b/plugins/python/selectionsbagdocker/selectionsbagdocker.py@@ -9,6 +9,7 @@ except:from PyQt5 import uicfrom krita import DockWidget+from builtins import i18nimport osdiff --git a/plugins/python/tenbrushes/tenbrushes.py b/plugins/python/tenbrushes/tenbrushes.pyindex d0abc65126..5147fda8f7 100644--- a/plugins/python/tenbrushes/tenbrushes.py+++ b/plugins/python/tenbrushes/tenbrushes.py@@ -1,6 +1,7 @@# SPDX-License-Identifier: CC0-1.0-import krita+from krita import Krita, Extension+from builtins import i18n, Applicationtry:from PyQt6.QtGui import QPixmap, QIconexcept:@@ -8,7 +9,7 @@ except:from . import uitenbrushes-class TenBrushesExtension(krita.Extension):+class TenBrushesExtension(Extension):def __init__(self, parent):super(TenBrushesExtension, self).__init__(parent)diff --git a/plugins/python/tenbrushes/uitenbrushes.py b/plugins/python/tenbrushes/uitenbrushes.pyindex 09e781f944..4532750e3e 100644--- a/plugins/python/tenbrushes/uitenbrushes.py+++ b/plugins/python/tenbrushes/uitenbrushes.py@@ -11,13 +11,14 @@ except:from PyQt5.QtWidgets import (QDialogButtonBox, QLabel, QVBoxLayout,QHBoxLayout, QCheckBox)from . import tenbrushesdialog, dropbutton-import krita+from krita import Krita, PresetChooser+from builtins import i18n, Applicationclass UITenBrushes(object):def __init__(self):- self.kritaInstance = krita.Krita.instance()+ self.kritaInstance = Krita.instance()self.mainDialog = tenbrushesdialog.TenBrushesDialog(self, self.kritaInstance.activeWindow().qwindow())@@ -45,7 +46,7 @@ class UITenBrushes(object):self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)- self.presetChooser = krita.PresetChooser(self.mainDialog)+ self.presetChooser = PresetChooser(self.mainDialog)def initialize(self, tenbrushes):self.tenbrushes = tenbrushesdiff --git a/plugins/python/tenscripts/tenscripts.py b/plugins/python/tenscripts/tenscripts.pyindex b9296b5172..8c9b4ad395 100644--- a/plugins/python/tenscripts/tenscripts.py+++ b/plugins/python/tenscripts/tenscripts.py@@ -1,7 +1,7 @@# SPDX-License-Identifier: CC0-1.0from krita import Extension-import krita+from builtins import i18n, Applicationtry:from PyQt6.QtGui import QIconexcept:@@ -11,7 +11,7 @@ from . import uitenscriptsimport importlib-class TenScriptsExtension(krita.Extension):+class TenScriptsExtension(Extension):def __init__(self, parent):super(TenScriptsExtension, self).__init__(parent)diff --git a/plugins/python/tenscripts/uitenscripts.py b/plugins/python/tenscripts/uitenscripts.pyindex 16e8f93c5a..9d54f8839d 100644--- a/plugins/python/tenscripts/uitenscripts.py+++ b/plugins/python/tenscripts/uitenscripts.py@@ -14,6 +14,7 @@ except:from PyQt5.QtGui import QKeySequencefrom . import tenscriptsdialogfrom krita import Krita, FileDialog+from builtins import i18n, Applicationclass UITenScripts(object):diff --git a/plugins/python/workflow_buttons/buttons_settings_dialog.py b/plugins/python/workflow_buttons/buttons_settings_dialog.pyindex 5250262ba9..5ce3a395d6 100644--- a/plugins/python/workflow_buttons/buttons_settings_dialog.py+++ b/plugins/python/workflow_buttons/buttons_settings_dialog.py@@ -18,6 +18,7 @@ except:from krita import Krita, PresetChooser, ManagedColor, FileDialogfrom .flow_layout import FlowLayoutimport copy+from builtins import i18nINSTANCE = Krita.instance()diff --git a/plugins/python/workflow_buttons/workflow_buttons.py b/plugins/python/workflow_buttons/workflow_buttons.pyindex d8493ffafa..d114a1d107 100644--- a/plugins/python/workflow_buttons/workflow_buttons.py+++ b/plugins/python/workflow_buttons/workflow_buttons.py@@ -12,6 +12,7 @@ except:from PyQt5.QtGui import QIcon, QPixmapfrom PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QScrollArea, QToolButton, QPushButton, QToolBar, QAction, QSizePolicyfrom krita import Krita, DockWidget, DockWidgetFactory, DockWidgetFactoryBase, ManagedColor+from builtins import i18n, i18nc, Applicationfrom .flow_layout import FlowLayoutfrom .buttons_settings_dialog import LISTOFTOOLS, LISTOFSIZES, ButtonsSettingsDialogimport ast