eric7.CodeFormatting.BlackConfigurationDialog

Module implementing a dialog to enter the parameters for a Black formatting run.

Global Attributes

None

Classes

BlackConfigurationDialog Class implementing a dialog to enter the parameters for a Black formatting run.

Functions

None


BlackConfigurationDialog

Class implementing a dialog to enter the parameters for a Black formatting run.

Derived from

QDialog, Ui_BlackConfigurationDialog

Class Attributes

None

Class Methods

None

Methods

BlackConfigurationDialog Constructor
__createTomlSnippet Private slot to generate a TOML snippet of the current configuration.
__getTargetList Private method to get the list of checked target versions.
__loadConfiguration Private method to load the configuration section with data of the given dictionary.
__populateTargetVersionsList Private method to populate the target versions list widget with checkable Python version entries.
getConfiguration Public method to get the current configuration parameters.
on_excludeEdit_textChanged Private slot to enable the validate button depending on the exclude text.
on_sourceComboBox_currentTextChanged Private slot to handle the selection of a configuration source.
on_validateButton_clicked Private slot to validate the entered exclusion regular expression.

Static Methods

None

BlackConfigurationDialog (Constructor)

BlackConfigurationDialog(withProject=True, onlyProject=False, parent=None)

Constructor

withProject (bool (optional))
flag indicating to look for project configurations (defaults to True)
onlyProject (bool (optional))
flag indicating to only look for project configurations (defaults to False)
parent (QWidget (optional))
reference to the parent widget (defaults to None)

BlackConfigurationDialog.__createTomlSnippet

__createTomlSnippet()

Private slot to generate a TOML snippet of the current configuration.

Note: Only non-default values are included in this snippet.

The code snippet is copied to the clipboard and may be placed inside the 'pyproject.toml' file.

BlackConfigurationDialog.__getTargetList

__getTargetList()

Private method to get the list of checked target versions.

Return:
list of target versions
Return Type:
list of str

BlackConfigurationDialog.__loadConfiguration

__loadConfiguration(configurationDict)

Private method to load the configuration section with data of the given dictionary.

configurationDict (dict)
reference to the data to be loaded

BlackConfigurationDialog.__populateTargetVersionsList

__populateTargetVersionsList()

Private method to populate the target versions list widget with checkable Python version entries.

BlackConfigurationDialog.getConfiguration

getConfiguration(saveToProject=False)

Public method to get the current configuration parameters.

saveToProject (bool (optional))
flag indicating to save the configuration data in the project file (defaults to False)
Return:
dictionary containing the configuration parameters
Return Type:
dict

BlackConfigurationDialog.on_excludeEdit_textChanged

on_excludeEdit_textChanged()

Private slot to enable the validate button depending on the exclude text.

BlackConfigurationDialog.on_sourceComboBox_currentTextChanged

on_sourceComboBox_currentTextChanged(selection)

Private slot to handle the selection of a configuration source.

selection (str)
text of the currently selected item

BlackConfigurationDialog.on_validateButton_clicked

on_validateButton_clicked()

Private slot to validate the entered exclusion regular expression.

Up