src/eric7/CodeFormatting/BlackUtilities.py

branch
eric7
changeset 9436
731d146193e2
parent 9221
bf71ee032bb4
child 9453
e5065dde905d
equal deleted inserted replaced
9435:15992d83352b 9436:731d146193e2
7 Module implementing some utility functions for the Black based code formatting. 7 Module implementing some utility functions for the Black based code formatting.
8 """ 8 """
9 9
10 import re 10 import re
11 11
12 from PyQt6.QtCore import QCoreApplication 12 from PyQt6.QtCore import QCoreApplication, pyqtSlot
13
14 from eric7.EricWidgets import EricMessageBox
13 15
14 import black 16 import black
15 17
16 18
17 def getDefaultConfiguration(): 19 def getDefaultConfiguration():
80 False, 82 False,
81 QCoreApplication.translate( 83 QCoreApplication.translate(
82 "BlackUtilities", "A regular expression must be given." 84 "BlackUtilities", "A regular expression must be given."
83 ), 85 ),
84 ) 86 )
87
88
89 @pyqtSlot()
90 def aboutBlack():
91 """
92 Slot to show an 'About Black' dialog.
93 """
94 EricMessageBox.information(
95 None,
96 QCoreApplication.translate("BlackUtilities", "About Black"),
97 QCoreApplication.translate(
98 "BlackUtilities",
99 """<p><b>Black Version {0}</b></p>"""
100 """<p><i>Black</i> is the uncompromising Python code"""
101 """ formatter.</p>"""
102 ).format(black.__version__),
103 )

eric ide

mercurial