Tue, 20 Sep 2022 18:33:03 +0200
Corrected another oversight in the 'Black' configuration dialog.
--- a/eric7.epj Tue Sep 20 17:23:57 2022 +0200 +++ b/eric7.epj Tue Sep 20 18:33:03 2022 +0200 @@ -977,11 +977,11 @@ "skip-string-normalization": false, "source": "project", "target-version": [ - "py37", - "py38", + "py311", + "py310", "py39", - "py310", - "py311" + "py38", + "py37" ] }, "CodeMetrics": {
--- a/src/eric7/APIs/Python3/eric7.api Tue Sep 20 17:23:57 2022 +0200 +++ b/src/eric7/APIs/Python3/eric7.api Tue Sep 20 18:33:03 2022 +0200 @@ -1,4 +1,4 @@ -eric7.CodeFormatting.BlackConfigurationDialog.BlackConfigurationDialog.getConfiguration?4() +eric7.CodeFormatting.BlackConfigurationDialog.BlackConfigurationDialog.getConfiguration?4(saveToProject=False) eric7.CodeFormatting.BlackConfigurationDialog.BlackConfigurationDialog.on_excludeEdit_textChanged?4() eric7.CodeFormatting.BlackConfigurationDialog.BlackConfigurationDialog.on_sourceComboBox_currentTextChanged?4(selection) eric7.CodeFormatting.BlackConfigurationDialog.BlackConfigurationDialog.on_validateButton_clicked?4()
--- a/src/eric7/CodeFormatting/BlackConfigurationDialog.py Tue Sep 20 17:23:57 2022 +0200 +++ b/src/eric7/CodeFormatting/BlackConfigurationDialog.py Tue Sep 20 18:33:03 2022 +0200 @@ -249,10 +249,13 @@ ), ) - def getConfiguration(self): + def getConfiguration(self, saveToProject=False): """ Public method to get the current configuration parameters. + @param saveToProject flag indicating to save the configuration data in the + project file (defaults to False) + @type bool (optional) @return dictionary containing the configuration parameters @rtype dict """ @@ -269,7 +272,7 @@ ] = self.skipMagicCommaCheckBox.isChecked() configuration["extend-exclude"] = self.excludeEdit.toPlainText().strip() - if self.__project: + if saveToProject and self.__project: self.__project.setData("OTHERTOOLSPARMS", "Black", configuration) return configuration
--- a/src/eric7/Documentation/Source/eric7.CodeFormatting.BlackConfigurationDialog.html Tue Sep 20 17:23:57 2022 +0200 +++ b/src/eric7/Documentation/Source/eric7.CodeFormatting.BlackConfigurationDialog.html Tue Sep 20 18:33:03 2022 +0200 @@ -179,12 +179,20 @@ </p> <a NAME="BlackConfigurationDialog.getConfiguration" ID="BlackConfigurationDialog.getConfiguration"></a> <h4>BlackConfigurationDialog.getConfiguration</h4> -<b>getConfiguration</b>(<i></i>) +<b>getConfiguration</b>(<i>saveToProject=False</i>) <p> Public method to get the current configuration parameters. </p> <dl> + +<dt><i>saveToProject</i> (bool (optional))</dt> +<dd> +flag indicating to save the configuration data in the + project file (defaults to False) +</dd> +</dl> +<dl> <dt>Return:</dt> <dd> dictionary containing the configuration parameters
--- a/src/eric7/Project/Project.py Tue Sep 20 17:23:57 2022 +0200 +++ b/src/eric7/Project/Project.py Tue Sep 20 18:33:03 2022 +0200 @@ -6722,7 +6722,7 @@ if ericApp().getObject("ViewManager").checkAllDirty(): dlg = BlackConfigurationDialog(withProject=True) if dlg.exec() == QDialog.DialogCode.Accepted: - config = dlg.getConfiguration() + config = dlg.getConfiguration(saveToProject=True) formattingDialog = BlackFormattingDialog( config, @@ -6742,7 +6742,7 @@ dlg = BlackConfigurationDialog(withProject=True, onlyProject=True) if dlg.exec() == QDialog.DialogCode.Accepted: - dlg.getConfiguration() + dlg.getConfiguration(saveToProject=True) # The data is saved to the project as a side effect. #########################################################################