diff --git a/dev-tools/python/dev-requirements.txt b/dev-tools/python/dev-requirements.txt --- a/dev-tools/python/dev-requirements.txt +++ b/dev-tools/python/dev-requirements.txt @@ -1,4 +1,4 @@ -flake8==3.6.0 +flake8==3.7.4 pytest==4.0.2 PyQt5==5.11.3 PyQt5-sip==4.19.13 diff --git a/plugins/python/assignprofiledialog/__init__.py b/plugins/python/assignprofiledialog/__init__.py --- a/plugins/python/assignprofiledialog/__init__.py +++ b/plugins/python/assignprofiledialog/__init__.py @@ -1,2 +1,4 @@ -# let's make a module -from .assignprofiledialog import * +from .assignprofiledialog import AssignProfileDialog + + +Scripter.addExtension(AssignProfileDialog(Application)) diff --git a/plugins/python/assignprofiledialog/assignprofiledialog.py b/plugins/python/assignprofiledialog/assignprofiledialog.py --- a/plugins/python/assignprofiledialog/assignprofiledialog.py +++ b/plugins/python/assignprofiledialog/assignprofiledialog.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QDialogButtonBox, QDialog, QMessageBox, QComboBox, QVBoxLayout) @@ -23,20 +26,25 @@ def assignProfile(self): doc = Application.activeDocument() if doc is None: - QMessageBox.information(Application.activeWindow().qwindow(), i18n("Assign Profile"), i18n("There is no active document.")) + QMessageBox.information( + Application.activeWindow().qwindow(), + i18n("Assign Profile"), + i18n("There is no active document.")) return self.dialog = QDialog(Application.activeWindow().qwindow()) self.cmbProfile = QComboBox(self.dialog) - for profile in sorted(Application.profiles(doc.colorModel(), doc.colorDepth())): + for profile in sorted( + Application.profiles(doc.colorModel(), doc.colorDepth())): self.cmbProfile.addItem(profile) vbox = QVBoxLayout(self.dialog) vbox.addWidget(self.cmbProfile) self.buttonBox = QDialogButtonBox(self.dialog) self.buttonBox.setOrientation(Qt.Horizontal) - self.buttonBox.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) + self.buttonBox.setStandardButtons( + QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.buttonBox.accepted.connect(self.dialog.accept) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.dialog.reject) @@ -53,8 +61,6 @@ pass def createActions(self, window): - action = window.createAction("assing_profile_to_image", i18n("Assign Profile to Image")) + action = window.createAction("assing_profile_to_image", + i18n("Assign Profile to Image")) action.triggered.connect(self.assignProfile) - - -Scripter.addExtension(AssignProfileDialog(Application)) diff --git a/plugins/python/colorspace/__init__.py b/plugins/python/colorspace/__init__.py --- a/plugins/python/colorspace/__init__.py +++ b/plugins/python/colorspace/__init__.py @@ -1,13 +1,18 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' -# let's make a module -from .colorspace import * +# https://creativecommons.org/publicdomain/zero/1.0/legalcode + +import krita +from .colorspace import ColorSpaceExtension + +Scripter.addExtension(ColorSpaceExtension(krita.Krita.instance())) diff --git a/plugins/python/colorspace/colorspace.py b/plugins/python/colorspace/colorspace.py --- a/plugins/python/colorspace/colorspace.py +++ b/plugins/python/colorspace/colorspace.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' import krita from . import uicolorspace @@ -23,12 +26,10 @@ def createActions(self, window): action = window.createAction("color_space", i18n("Color Space")) - action.setToolTip(i18n("Plugin to change color space of selected documents.")) + action.setToolTip( + i18n("Plugin to change color space of selected documents.")) action.triggered.connect(self.initialize) def initialize(self): self.uicolorspace = uicolorspace.UIColorSpace() self.uicolorspace.initialize() - - -Scripter.addExtension(ColorSpaceExtension(krita.Krita.instance())) diff --git a/plugins/python/colorspace/colorspacedialog.py b/plugins/python/colorspace/colorspacedialog.py --- a/plugins/python/colorspace/colorspacedialog.py +++ b/plugins/python/colorspace/colorspacedialog.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtWidgets import QDialog diff --git a/plugins/python/colorspace/components/colordepthcombobox.py b/plugins/python/colorspace/components/colordepthcombobox.py --- a/plugins/python/colorspace/components/colordepthcombobox.py +++ b/plugins/python/colorspace/components/colordepthcombobox.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtWidgets import QComboBox diff --git a/plugins/python/colorspace/components/colormodelcombobox.py b/plugins/python/colorspace/components/colormodelcombobox.py --- a/plugins/python/colorspace/components/colormodelcombobox.py +++ b/plugins/python/colorspace/components/colormodelcombobox.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtWidgets import QComboBox diff --git a/plugins/python/colorspace/components/colorprofilecombobox.py b/plugins/python/colorspace/components/colorprofilecombobox.py --- a/plugins/python/colorspace/components/colorprofilecombobox.py +++ b/plugins/python/colorspace/components/colorprofilecombobox.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtWidgets import QComboBox diff --git a/plugins/python/colorspace/uicolorspace.py b/plugins/python/colorspace/uicolorspace.py --- a/plugins/python/colorspace/uicolorspace.py +++ b/plugins/python/colorspace/uicolorspace.py @@ -1,24 +1,30 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from . import colorspacedialog -from .components import colormodelcombobox, colordepthcombobox, colorprofilecombobox +from .components import ( + colordepthcombobox, + colormodelcombobox, + colorprofilecombobox, +) from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import (QFormLayout, QListWidget, QListWidgetItem, - QAbstractItemView, QComboBox, QDialogButtonBox, +from PyQt5.QtWidgets import (QFormLayout, QListWidget, + QAbstractItemView, QDialogButtonBox, QVBoxLayout, QFrame, QMessageBox, QPushButton, - QHBoxLayout, QAbstractScrollArea) + QAbstractScrollArea) from PyQt5.QtGui import QIcon import krita -from . import resources_rc class UIColorSpace(object): @@ -28,12 +34,15 @@ self.mainLayout = QVBoxLayout(self.mainDialog) self.formLayout = QFormLayout() self.documentLayout = QVBoxLayout() - self.refreshButton = QPushButton(QIcon(':/icons/refresh.svg'), i18n("Refresh")) + self.refreshButton = QPushButton(QIcon(':/icons/refresh.svg'), + i18n("Refresh")) self.widgetDocuments = QListWidget() self.colorModelComboBox = colormodelcombobox.ColorModelComboBox(self) self.colorDepthComboBox = colordepthcombobox.ColorDepthComboBox(self) - self.colorProfileComboBox = colorprofilecombobox.ColorProfileComboBox(self) - self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) + self.colorProfileComboBox = \ + colorprofilecombobox.ColorProfileComboBox(self) + self.buttonBox = QDialogButtonBox( + QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.kritaInstance = krita.Krita.instance() self.documentsList = [] @@ -47,7 +56,8 @@ self.mainDialog.setWindowModality(Qt.NonModal) self.widgetDocuments.setSelectionMode(QAbstractItemView.MultiSelection) - self.widgetDocuments.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents) + self.widgetDocuments.setSizeAdjustPolicy( + QAbstractScrollArea.AdjustToContents) def initialize(self): self.loadDocuments() @@ -61,7 +71,8 @@ self.formLayout.addRow(i18n("Documents:"), self.documentLayout) self.formLayout.addRow(i18n("Color model:"), self.colorModelComboBox) self.formLayout.addRow(i18n("Color depth:"), self.colorDepthComboBox) - self.formLayout.addRow(i18n("Color profile:"), self.colorProfileComboBox) + self.formLayout.addRow(i18n("Color profile:"), + self.colorProfileComboBox) self.line = QFrame() self.line.setFrameShape(QFrame.HLine) @@ -86,38 +97,48 @@ self.colorDepthComboBox.clear() colorModel = self.colorModelComboBox.currentText() - self.colorDepthsList = sorted(self.kritaInstance.colorDepths(colorModel)) + self.colorDepthsList = sorted( + self.kritaInstance.colorDepths(colorModel)) self.colorDepthComboBox.addItems(self.colorDepthsList) def loadColorProfiles(self): self.colorProfileComboBox.clear() colorModel = self.colorModelComboBox.currentText() colorDepth = self.colorDepthComboBox.currentText() - self.colorProfilesList = sorted(self.kritaInstance.profiles(colorModel, colorDepth)) + self.colorProfilesList = sorted( + self.kritaInstance.profiles(colorModel, colorDepth)) self.colorProfileComboBox.addItems(self.colorProfilesList) def loadDocuments(self): self.widgetDocuments.clear() - self.documentsList = [document for document in self.kritaInstance.documents() if document.fileName()] + self.documentsList = [ + document for document in self.kritaInstance.documents() + if document.fileName() + ] for document in self.documentsList: self.widgetDocuments.addItem(document.fileName()) def refreshButtonClicked(self): self.loadDocuments() def confirmButton(self): - selectedPaths = [item.text() for item in self.widgetDocuments.selectedItems()] - selectedDocuments = [document for document in self.documentsList for path in selectedPaths if path == document.fileName()] + selectedPaths = [ + item.text() for item in self.widgetDocuments.selectedItems()] + selectedDocuments = [ + document for document in self.documentsList + for path in selectedPaths if path == document.fileName() + ] self.msgBox = QMessageBox(self.mainDialog) if selectedDocuments: self.convertColorSpace(selectedDocuments) - self.msgBox.setText(i18n("The selected documents has been converted.")) + self.msgBox.setText( + i18n("The selected documents has been converted.")) else: self.msgBox.setText(i18n("Select at least one document.")) self.msgBox.exec_() diff --git a/plugins/python/documenttools/__init__.py b/plugins/python/documenttools/__init__.py --- a/plugins/python/documenttools/__init__.py +++ b/plugins/python/documenttools/__init__.py @@ -1,2 +1,4 @@ -# let's make a module -from .documenttools import * +import krita +from .documenttools import DocumentToolsExtension + +Scripter.addExtension(DocumentToolsExtension(krita.Krita.instance())) diff --git a/plugins/python/documenttools/documenttools.py b/plugins/python/documenttools/documenttools.py --- a/plugins/python/documenttools/documenttools.py +++ b/plugins/python/documenttools/documenttools.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' import krita from . import uidocumenttools @@ -23,12 +26,10 @@ def createActions(self, window): action = window.createAction("document_tools", i18n("Document Tools")) - action.setToolTip(i18n("Plugin to manipulate properties of selected documents.")) + action.setToolTip( + i18n("Plugin to manipulate properties of selected documents.")) action.triggered.connect(self.initialize) def initialize(self): self.uidocumenttools = uidocumenttools.UIDocumentTools() self.uidocumenttools.initialize() - - -Scripter.addExtension(DocumentToolsExtension(krita.Krita.instance())) diff --git a/plugins/python/documenttools/documenttoolsdialog.py b/plugins/python/documenttools/documenttoolsdialog.py --- a/plugins/python/documenttools/documenttoolsdialog.py +++ b/plugins/python/documenttools/documenttoolsdialog.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from PyQt5.QtWidgets import QDialog diff --git a/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py b/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py --- a/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py +++ b/plugins/python/documenttools/tools/canvassizetool/canvassizetool.py @@ -1,17 +1,19 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' -from PyQt5.QtWidgets import (QWidget, QSpinBox, QHBoxLayout, +# https://creativecommons.org/publicdomain/zero/1.0/legalcode + +from PyQt5.QtWidgets import (QWidget, QSpinBox, QVBoxLayout, QFormLayout) -import krita class CanvasSizeTool(QWidget): diff --git a/plugins/python/documenttools/tools/rotatetool/rotatetool.py b/plugins/python/documenttools/tools/rotatetool/rotatetool.py --- a/plugins/python/documenttools/tools/rotatetool/rotatetool.py +++ b/plugins/python/documenttools/tools/rotatetool/rotatetool.py @@ -1,18 +1,19 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' -from PyQt5.QtWidgets import (QWidget, QSpinBox, QHBoxLayout, - QVBoxLayout, QFormLayout) +# https://creativecommons.org/publicdomain/zero/1.0/legalcode + +from PyQt5.QtWidgets import QWidget, QSpinBox, QFormLayout import math -import krita class RotateTool(QWidget): @@ -31,7 +32,8 @@ def initialize(self): self.degreesSpinBox.setRange(-180, 180) - self.degreesSpinBox.setToolTip(i18n("Negative degrees will rotate the image to the left")) + self.degreesSpinBox.setToolTip( + i18n("Negative degrees will rotate the image to the left")) self.layout.addRow(i18n("Degrees:"), self.degreesSpinBox) diff --git a/plugins/python/documenttools/tools/scaletool/scaletool.py b/plugins/python/documenttools/tools/scaletool/scaletool.py --- a/plugins/python/documenttools/tools/scaletool/scaletool.py +++ b/plugins/python/documenttools/tools/scaletool/scaletool.py @@ -1,17 +1,19 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' -from PyQt5.QtWidgets import (QWidget, QSpinBox, QHBoxLayout, +# https://creativecommons.org/publicdomain/zero/1.0/legalcode + +from PyQt5.QtWidgets import (QWidget, QSpinBox, QVBoxLayout, QFormLayout, QComboBox) -import krita class ScaleTool(QWidget): diff --git a/plugins/python/documenttools/uidocumenttools.py b/plugins/python/documenttools/uidocumenttools.py --- a/plugins/python/documenttools/uidocumenttools.py +++ b/plugins/python/documenttools/uidocumenttools.py @@ -1,14 +1,17 @@ -''' -This script is licensed CC 0 1.0, so that you can learn from it. +# This script is licensed CC 0 1.0, so that you can learn from it. ------- CC 0 1.0 --------------- +# ------ CC 0 1.0 --------------- -The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. +# The person who associated a work with this deed has dedicated the +# work to the public domain by waiving all of his or her rights to the +# work worldwide under copyright law, including all related and +# neighboring rights, to the extent allowed by law. -You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. +# You can copy, modify, distribute and perform the work, even for +# commercial purposes, all without asking permission. + +# https://creativecommons.org/publicdomain/zero/1.0/legalcode -https://creativecommons.org/publicdomain/zero/1.0/legalcode -''' from . import documenttoolsdialog from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QFormLayout, QListWidget, QAbstractItemView, @@ -28,7 +31,8 @@ self.refreshButton = QPushButton(i18n("Refresh")) self.widgetDocuments = QListWidget() self.tabTools = QTabWidget() - self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) + self.buttonBox = QDialogButtonBox( + QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.kritaInstance = krita.Krita.instance() self.documentsList = [] @@ -39,7 +43,8 @@ self.mainDialog.setWindowModality(Qt.NonModal) self.widgetDocuments.setSelectionMode(QAbstractItemView.MultiSelection) - self.widgetDocuments.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents) + self.widgetDocuments.setSizeAdjustPolicy( + QAbstractScrollArea.AdjustToContents) def initialize(self): self.loadDocuments() @@ -85,23 +90,30 @@ def loadDocuments(self): self.widgetDocuments.clear() - self.documentsList = [document for document in self.kritaInstance.documents() if document.fileName()] + self.documentsList = [ + document for document in self.kritaInstance.documents() + if document.fileName() + ] for document in self.documentsList: self.widgetDocuments.addItem(document.fileName()) def refreshButtonClicked(self): self.loadDocuments() def confirmButton(self): - selectedPaths = [item.text() for item in self.widgetDocuments.selectedItems()] - selectedDocuments = [document for document in self.documentsList for path in selectedPaths if path == document.fileName()] + selectedPaths = [ + item.text() for item in self.widgetDocuments.selectedItems()] + selectedDocuments = [ + document for document in self.documentsList + for path in selectedPaths if path == document.fileName()] self.msgBox = QMessageBox(self.mainDialog) if selectedDocuments: widget = self.tabTools.currentWidget() widget.adjust(selectedDocuments) - self.msgBox.setText(i18n("The selected documents has been modified.")) + self.msgBox.setText( + i18n("The selected documents has been modified.")) else: self.msgBox.setText(i18n("Select at least one document.")) self.msgBox.exec_() diff --git a/plugins/python/plugin_importer/plugin_importer.py b/plugins/python/plugin_importer/plugin_importer.py --- a/plugins/python/plugin_importer/plugin_importer.py +++ b/plugins/python/plugin_importer/plugin_importer.py @@ -157,8 +157,8 @@ config.read_string( self.archive.read(desktop_filename).decode('utf-8')) except ConfigParserError as e: - raise PluginReadError( - '%s: %s' % (i18n('Desktop file'), str(e))) + raise PluginReadError( + '%s: %s' % (i18n('Desktop file'), str(e))) return config def get_plugin_info(self): diff --git a/setup.cfg b/setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -2,3 +2,4 @@ [flake8] builtins = i18n,Scripter,Application,Krita +exclude = resources_rc.py