55 from eric7.Sessions.SessionFile import SessionFile |
55 from eric7.Sessions.SessionFile import SessionFile |
56 |
56 |
57 from eric7.Tasks.TasksFile import TasksFile |
57 from eric7.Tasks.TasksFile import TasksFile |
58 |
58 |
59 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction |
59 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction |
|
60 from eric7.CodeFormatting.BlackUtilities import aboutBlack |
60 |
61 |
61 |
62 |
62 class Project(QObject): |
63 class Project(QObject): |
63 """ |
64 """ |
64 Class implementing the project management functionality. |
65 Class implementing the project management functionality. |
4884 self.tr( |
4885 self.tr( |
4885 "<b>Black</b>" |
4886 "<b>Black</b>" |
4886 "<p>This shows some information about the installed 'Black' tool.</p>" |
4887 "<p>This shows some information about the installed 'Black' tool.</p>" |
4887 ) |
4888 ) |
4888 ) |
4889 ) |
4889 self.blackAboutAct.triggered.connect(self.__aboutBlack) |
4890 self.blackAboutAct.triggered.connect(aboutBlack) |
4890 self.actions.append(self.blackAboutAct) |
4891 self.actions.append(self.blackAboutAct) |
4891 font = self.blackAboutAct.font() |
4892 font = self.blackAboutAct.font() |
4892 font.setBold(True) |
4893 font.setBold(True) |
4893 self.blackAboutAct.setFont(font) |
4894 self.blackAboutAct.setFont(font) |
4894 |
4895 |
6735 """ |
6736 """ |
6736 Private slot called before the 'Code Formatting' menu is shown. |
6737 Private slot called before the 'Code Formatting' menu is shown. |
6737 """ |
6738 """ |
6738 self.showMenu.emit("Formatting", self.formattingMenu) |
6739 self.showMenu.emit("Formatting", self.formattingMenu) |
6739 |
6740 |
6740 @pyqtSlot() |
|
6741 def __aboutBlack(self): |
|
6742 """ |
|
6743 Private slot to show some information about the installed 'Black' tool. |
|
6744 """ |
|
6745 import black |
|
6746 |
|
6747 EricMessageBox.information( |
|
6748 None, |
|
6749 self.tr("About Black"), |
|
6750 self.tr( |
|
6751 """<p><b>Black Version {0}</b></p>""" |
|
6752 """<p><i>Black</i> is the uncompromising Python code""" |
|
6753 """ formatter.</p>""" |
|
6754 ).format(black.__version__), |
|
6755 ) |
|
6756 |
|
6757 def __performFormatWithBlack(self, action): |
6741 def __performFormatWithBlack(self, action): |
6758 """ |
6742 """ |
6759 Private method to format the project sources using the 'Black' tool. |
6743 Private method to format the project sources using the 'Black' tool. |
6760 |
6744 |
6761 Following actions are supported. |
6745 Following actions are supported. |