42 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor |
42 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor |
43 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
43 from eric7.EricWidgets import EricFileDialog, EricMessageBox |
44 from eric7.EricWidgets.EricApplication import ericApp |
44 from eric7.EricWidgets.EricApplication import ericApp |
45 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
45 from eric7.EricWidgets.EricListSelectionDialog import EricListSelectionDialog |
46 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog |
46 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog |
|
47 from eric7.EricXML.DebuggerPropertiesReader import DebuggerPropertiesReader |
|
48 from eric7.EricXML.ProjectReader import ProjectReader |
|
49 from eric7.EricXML.SessionReader import SessionReader |
|
50 from eric7.EricXML.TasksReader import TasksReader |
|
51 from eric7.EricXML.UserProjectReader import UserProjectReader |
47 from eric7.Globals import recentNameProject |
52 from eric7.Globals import recentNameProject |
48 from eric7.Sessions.SessionFile import SessionFile |
53 from eric7.Sessions.SessionFile import SessionFile |
49 from eric7.Tasks.TasksFile import TasksFile |
54 from eric7.Tasks.TasksFile import TasksFile |
50 from eric7.UI import Config |
55 from eric7.UI import Config |
51 from eric7.UI.NotificationWidget import NotificationTypes |
56 from eric7.UI.NotificationWidget import NotificationTypes |
52 |
57 |
53 from .DebuggerPropertiesFile import DebuggerPropertiesFile |
58 from .DebuggerPropertiesFile import DebuggerPropertiesFile |
|
59 from .ProjectBrowserModel import ProjectBrowserModel |
54 from .ProjectFile import ProjectFile |
60 from .ProjectFile import ProjectFile |
55 from .UserProjectFile import UserProjectFile |
61 from .UserProjectFile import UserProjectFile |
56 |
62 |
57 |
63 |
58 class Project(QObject): |
64 class Project(QObject): |
218 if filename is not None: |
224 if filename is not None: |
219 self.openProject(filename) |
225 self.openProject(filename) |
220 else: |
226 else: |
221 self.vcs = self.initVCS() |
227 self.vcs = self.initVCS() |
222 |
228 |
223 from .ProjectBrowserModel import ProjectBrowserModel |
|
224 |
|
225 self.__model = ProjectBrowserModel(self) |
229 self.__model = ProjectBrowserModel(self) |
226 |
230 |
227 self.codemetrics = None |
231 self.codemetrics = None |
228 self.codecoverage = None |
232 self.codecoverage = None |
229 self.profiledata = None |
233 self.profiledata = None |
863 res = self.__projectFile.readFile(fn) |
867 res = self.__projectFile.readFile(fn) |
864 else: |
868 else: |
865 # old XML based format |
869 # old XML based format |
866 f = QFile(fn) |
870 f = QFile(fn) |
867 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
871 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
868 from eric7.EricXML.ProjectReader import ProjectReader |
|
869 |
|
870 reader = ProjectReader(f, self) |
872 reader = ProjectReader(f, self) |
871 reader.readXML() |
873 reader.readXML() |
872 res = not reader.hasError() |
874 res = not reader.hasError() |
873 f.close() |
875 f.close() |
874 |
876 |
1005 # try the old XML based format second |
1007 # try the old XML based format second |
1006 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4q".format(fn1)) |
1008 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4q".format(fn1)) |
1007 if os.path.exists(fn): |
1009 if os.path.exists(fn): |
1008 f = QFile(fn) |
1010 f = QFile(fn) |
1009 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1011 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1010 from eric7.EricXML.UserProjectReader import UserProjectReader |
|
1011 |
|
1012 reader = UserProjectReader(f, self) |
1012 reader = UserProjectReader(f, self) |
1013 reader.readXML() |
1013 reader.readXML() |
1014 f.close() |
1014 f.close() |
1015 else: |
1015 else: |
1016 EricMessageBox.critical( |
1016 EricMessageBox.critical( |
1081 self.getProjectManagementDir(), "{0}{1}.e5s".format(fn1, indicator) |
1081 self.getProjectManagementDir(), "{0}{1}.e5s".format(fn1, indicator) |
1082 ) |
1082 ) |
1083 if os.path.exists(fn): |
1083 if os.path.exists(fn): |
1084 f = QFile(fn) |
1084 f = QFile(fn) |
1085 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1085 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1086 from eric7.EricXML.SessionReader import SessionReader |
|
1087 |
|
1088 reader = SessionReader(f, False) |
1086 reader = SessionReader(f, False) |
1089 reader.readXML(quiet=quiet) |
1087 reader.readXML(quiet=quiet) |
1090 f.close() |
1088 f.close() |
1091 else: |
1089 else: |
1092 if not quiet: |
1090 if not quiet: |
1176 # try old style XML file second |
1174 # try old style XML file second |
1177 fn = os.path.join(self.getProjectManagementDir(), "{0}.e6t".format(base)) |
1175 fn = os.path.join(self.getProjectManagementDir(), "{0}.e6t".format(base)) |
1178 if os.path.exists(fn): |
1176 if os.path.exists(fn): |
1179 f = QFile(fn) |
1177 f = QFile(fn) |
1180 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1178 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1181 from eric7.EricXML.TasksReader import TasksReader |
|
1182 |
|
1183 reader = TasksReader(f, True) |
1179 reader = TasksReader(f, True) |
1184 reader.readXML() |
1180 reader.readXML() |
1185 f.close() |
1181 f.close() |
1186 else: |
1182 else: |
1187 EricMessageBox.critical( |
1183 EricMessageBox.critical( |
1255 # try the old XML based format second |
1251 # try the old XML based format second |
1256 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4d".format(fn1)) |
1252 fn = os.path.join(self.getProjectManagementDir(), "{0}.e4d".format(fn1)) |
1257 |
1253 |
1258 f = QFile(fn) |
1254 f = QFile(fn) |
1259 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1255 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1260 from eric7.EricXML.DebuggerPropertiesReader import ( |
|
1261 DebuggerPropertiesReader, |
|
1262 ) |
|
1263 |
|
1264 reader = DebuggerPropertiesReader(f, self) |
1256 reader = DebuggerPropertiesReader(f, self) |
1265 reader.readXML(quiet=quiet) |
1257 reader.readXML(quiet=quiet) |
1266 f.close() |
1258 f.close() |
1267 self.debugPropertiesLoaded = True |
1259 self.debugPropertiesLoaded = True |
1268 self.debugPropertiesChanged = False |
1260 self.debugPropertiesChanged = False |
1479 |
1471 |
1480 def addLanguage(self): |
1472 def addLanguage(self): |
1481 """ |
1473 """ |
1482 Public slot used to add a language to the project. |
1474 Public slot used to add a language to the project. |
1483 """ |
1475 """ |
|
1476 from .AddLanguageDialog import AddLanguageDialog |
|
1477 |
1484 if not self.pdata["TRANSLATIONPATTERN"]: |
1478 if not self.pdata["TRANSLATIONPATTERN"]: |
1485 EricMessageBox.critical( |
1479 EricMessageBox.critical( |
1486 self.ui, |
1480 self.ui, |
1487 self.tr("Add Language"), |
1481 self.tr("Add Language"), |
1488 self.tr("You have to specify a translation pattern first."), |
1482 self.tr("You have to specify a translation pattern first."), |
1489 ) |
1483 ) |
1490 return |
1484 return |
1491 |
|
1492 from .AddLanguageDialog import AddLanguageDialog |
|
1493 |
1485 |
1494 dlg = AddLanguageDialog(self.parent()) |
1486 dlg = AddLanguageDialog(self.parent()) |
1495 if dlg.exec() == QDialog.DialogCode.Accepted: |
1487 if dlg.exec() == QDialog.DialogCode.Accepted: |
1496 lang = dlg.getSelectedLanguage() |
1488 lang = dlg.getSelectedLanguage() |
1497 if self.pdata["PROJECTTYPE"] in [ |
1489 if self.pdata["PROJECTTYPE"] in [ |
1580 Public slot to delete a translation from the project directory. |
1572 Public slot to delete a translation from the project directory. |
1581 |
1573 |
1582 @param langFile the translation file to be removed (string) |
1574 @param langFile the translation file to be removed (string) |
1583 """ |
1575 """ |
1584 try: |
1576 try: |
1585 from send2trash import send2trash as s2t |
1577 from send2trash import send2trash as s2t # __IGNORE_WARNING_I10__ |
1586 except ImportError: |
1578 except ImportError: |
1587 s2t = os.remove |
1579 s2t = os.remove |
1588 |
1580 |
1589 langFile = self.getRelativePath(langFile) |
1581 langFile = self.getRelativePath(langFile) |
1590 qmFile = self.__binaryTranslationFile(langFile) |
1582 qmFile = self.__binaryTranslationFile(langFile) |
1734 @param fileTypeFilter filter to be used by the add file dialog |
1726 @param fileTypeFilter filter to be used by the add file dialog |
1735 @type str out of source, form, resource, interface, protocol, others |
1727 @type str out of source, form, resource, interface, protocol, others |
1736 @param startdir start directory for the selection dialog |
1728 @param startdir start directory for the selection dialog |
1737 @type str |
1729 @type str |
1738 """ |
1730 """ |
|
1731 from .AddFileDialog import AddFileDialog |
|
1732 |
1739 if startdir is None: |
1733 if startdir is None: |
1740 startdir = self.ppath |
1734 startdir = self.ppath |
1741 from .AddFileDialog import AddFileDialog |
|
1742 |
1735 |
1743 dlg = AddFileDialog(self, self.parent(), fileTypeFilter, startdir=startdir) |
1736 dlg = AddFileDialog(self, self.parent(), fileTypeFilter, startdir=startdir) |
1744 if dlg.exec() == QDialog.DialogCode.Accepted: |
1737 if dlg.exec() == QDialog.DialogCode.Accepted: |
1745 fnames, target, isSource = dlg.getData() |
1738 fnames, target, isSource = dlg.getData() |
1746 if target != "": |
1739 if target != "": |
1905 @param fileTypeFilter filter to be used by the add directory dialog |
1898 @param fileTypeFilter filter to be used by the add directory dialog |
1906 @type str out of source, form, resource, interface, protocol, others |
1899 @type str out of source, form, resource, interface, protocol, others |
1907 @param startdir start directory for the selection dialog |
1900 @param startdir start directory for the selection dialog |
1908 @type str |
1901 @type str |
1909 """ |
1902 """ |
|
1903 from .AddDirectoryDialog import AddDirectoryDialog |
|
1904 |
1910 if startdir is None: |
1905 if startdir is None: |
1911 startdir = self.ppath |
1906 startdir = self.ppath |
1912 from .AddDirectoryDialog import AddDirectoryDialog |
|
1913 |
1907 |
1914 dlg = AddDirectoryDialog(self, fileTypeFilter, self.parent(), startdir=startdir) |
1908 dlg = AddDirectoryDialog(self, fileTypeFilter, self.parent(), startdir=startdir) |
1915 if dlg.exec() == QDialog.DialogCode.Accepted: |
1909 if dlg.exec() == QDialog.DialogCode.Accepted: |
1916 filetype, source, target, recursive = dlg.getData() |
1910 filetype, source, target, recursive = dlg.getData() |
1917 if target == "": |
1911 if target == "": |
2408 """ |
2402 """ |
2409 if not os.path.isabs(dn): |
2403 if not os.path.isabs(dn): |
2410 dn = os.path.join(self.ppath, dn) |
2404 dn = os.path.join(self.ppath, dn) |
2411 try: |
2405 try: |
2412 try: |
2406 try: |
2413 from send2trash import send2trash |
2407 from send2trash import send2trash # __IGNORE_WARNING_I10__ |
2414 |
2408 |
2415 send2trash(dn) |
2409 send2trash(dn) |
2416 except ImportError: |
2410 except ImportError: |
2417 shutil.rmtree(dn, True) |
2411 shutil.rmtree(dn, True) |
2418 except OSError as err: |
2412 except OSError as err: |
2451 Public slot to built a new project. |
2445 Public slot to built a new project. |
2452 |
2446 |
2453 This method displays the new project dialog and initializes |
2447 This method displays the new project dialog and initializes |
2454 the project object with the data entered. |
2448 the project object with the data entered. |
2455 """ |
2449 """ |
|
2450 from eric7.VCS.CommandOptionsDialog import VcsCommandOptionsDialog |
|
2451 |
|
2452 from .PropertiesDialog import PropertiesDialog |
|
2453 |
2456 if not self.checkDirty(): |
2454 if not self.checkDirty(): |
2457 return |
2455 return |
2458 |
|
2459 from .PropertiesDialog import PropertiesDialog |
|
2460 |
2456 |
2461 dlg = PropertiesDialog(self, True) |
2457 dlg = PropertiesDialog(self, True) |
2462 if dlg.exec() == QDialog.DialogCode.Accepted: |
2458 if dlg.exec() == QDialog.DialogCode.Accepted: |
2463 self.closeProject() |
2459 self.closeProject() |
2464 dlg.storeData() |
2460 dlg.storeData() |
2695 ), |
2691 ), |
2696 ) |
2692 ) |
2697 else: |
2693 else: |
2698 vcores = False |
2694 vcores = False |
2699 if vcores: |
2695 if vcores: |
2700 from eric7.VCS.CommandOptionsDialog import ( |
|
2701 VcsCommandOptionsDialog, |
|
2702 ) |
|
2703 |
|
2704 codlg = VcsCommandOptionsDialog(self.vcs) |
2696 codlg = VcsCommandOptionsDialog(self.vcs) |
2705 if codlg.exec() == QDialog.DialogCode.Accepted: |
2697 if codlg.exec() == QDialog.DialogCode.Accepted: |
2706 self.vcs.vcsSetOptions(codlg.getOptions()) |
2698 self.vcs.vcsSetOptions(codlg.getOptions()) |
2707 # add project file to repository |
2699 # add project file to repository |
2708 if res == 0: |
2700 if res == 0: |
2772 ), |
2764 ), |
2773 ) |
2765 ) |
2774 else: |
2766 else: |
2775 vcores = False |
2767 vcores = False |
2776 if vcores: |
2768 if vcores: |
2777 from eric7.VCS.CommandOptionsDialog import ( |
|
2778 VcsCommandOptionsDialog, |
|
2779 ) |
|
2780 |
|
2781 codlg = VcsCommandOptionsDialog(self.vcs) |
2769 codlg = VcsCommandOptionsDialog(self.vcs) |
2782 if codlg.exec() == QDialog.DialogCode.Accepted: |
2770 if codlg.exec() == QDialog.DialogCode.Accepted: |
2783 self.vcs.vcsSetOptions(codlg.getOptions()) |
2771 self.vcs.vcsSetOptions(codlg.getOptions()) |
2784 |
2772 |
2785 # create the project in the VCS |
2773 # create the project in the VCS |
2970 |
2958 |
2971 def __showUserProperties(self): |
2959 def __showUserProperties(self): |
2972 """ |
2960 """ |
2973 Private slot to display the user specific properties dialog. |
2961 Private slot to display the user specific properties dialog. |
2974 """ |
2962 """ |
|
2963 from .UserPropertiesDialog import UserPropertiesDialog |
|
2964 |
2975 vcsSystem = self.pdata["VCS"] or None |
2965 vcsSystem = self.pdata["VCS"] or None |
2976 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None |
2966 vcsSystemOverride = self.pudata["VCSOVERRIDE"] or None |
2977 |
|
2978 from .UserPropertiesDialog import UserPropertiesDialog |
|
2979 |
2967 |
2980 dlg = UserPropertiesDialog(self) |
2968 dlg = UserPropertiesDialog(self) |
2981 if dlg.exec() == QDialog.DialogCode.Accepted: |
2969 if dlg.exec() == QDialog.DialogCode.Accepted: |
2982 dlg.storeData() |
2970 dlg.storeData() |
2983 |
2971 |
5372 |
5360 |
5373 @param toolbarManager reference to a toolbar manager object |
5361 @param toolbarManager reference to a toolbar manager object |
5374 (EricToolBarManager) |
5362 (EricToolBarManager) |
5375 @return tuple of the generated toolbars (tuple of two QToolBar) |
5363 @return tuple of the generated toolbars (tuple of two QToolBar) |
5376 """ |
5364 """ |
|
5365 from eric7 import VCS |
|
5366 |
5377 tb = QToolBar(self.tr("Project"), self.ui) |
5367 tb = QToolBar(self.tr("Project"), self.ui) |
5378 tb.setIconSize(Config.ToolBarIconSize) |
5368 tb.setIconSize(Config.ToolBarIconSize) |
5379 tb.setObjectName("ProjectToolbar") |
5369 tb.setObjectName("ProjectToolbar") |
5380 tb.setToolTip(self.tr("Project")) |
5370 tb.setToolTip(self.tr("Project")) |
5381 |
5371 |
5389 toolbarManager.addAction(self.addFilesAct, tb.windowTitle()) |
5379 toolbarManager.addAction(self.addFilesAct, tb.windowTitle()) |
5390 toolbarManager.addAction(self.addDirectoryAct, tb.windowTitle()) |
5380 toolbarManager.addAction(self.addDirectoryAct, tb.windowTitle()) |
5391 toolbarManager.addAction(self.addLanguageAct, tb.windowTitle()) |
5381 toolbarManager.addAction(self.addLanguageAct, tb.windowTitle()) |
5392 toolbarManager.addAction(self.propsAct, tb.windowTitle()) |
5382 toolbarManager.addAction(self.propsAct, tb.windowTitle()) |
5393 toolbarManager.addAction(self.userPropsAct, tb.windowTitle()) |
5383 toolbarManager.addAction(self.userPropsAct, tb.windowTitle()) |
5394 |
|
5395 from eric7 import VCS |
|
5396 |
5384 |
5397 vcstb = VCS.getBasicHelper(self).initBasicToolbar(self.ui, toolbarManager) |
5385 vcstb = VCS.getBasicHelper(self).initBasicToolbar(self.ui, toolbarManager) |
5398 |
5386 |
5399 return tb, vcstb |
5387 return tb, vcstb |
5400 |
5388 |
5478 |
5466 |
5479 def __searchProjectFile(self): |
5467 def __searchProjectFile(self): |
5480 """ |
5468 """ |
5481 Private slot to show the Find Project File dialog. |
5469 Private slot to show the Find Project File dialog. |
5482 """ |
5470 """ |
|
5471 from .QuickFindFileDialog import QuickFindFileDialog |
|
5472 |
5483 if self.__findProjectFileDialog is None: |
5473 if self.__findProjectFileDialog is None: |
5484 from .QuickFindFileDialog import QuickFindFileDialog |
|
5485 |
|
5486 self.__findProjectFileDialog = QuickFindFileDialog(self) |
5474 self.__findProjectFileDialog = QuickFindFileDialog(self) |
5487 self.__findProjectFileDialog.sourceFile.connect(self.sourceFile) |
5475 self.__findProjectFileDialog.sourceFile.connect(self.sourceFile) |
5488 self.__findProjectFileDialog.designerFile.connect(self.designerFile) |
5476 self.__findProjectFileDialog.designerFile.connect(self.designerFile) |
5489 self.__findProjectFileDialog.linguistFile.connect(self.linguistFile) |
5477 self.__findProjectFileDialog.linguistFile.connect(self.linguistFile) |
5490 self.__findProjectFileDialog.show() |
5478 self.__findProjectFileDialog.show() |
5503 @param AI flag indicating whether the automatic inclusion should |
5491 @param AI flag indicating whether the automatic inclusion should |
5504 be honoured (boolean) |
5492 be honoured (boolean) |
5505 @param onUserDemand flag indicating whether this method was |
5493 @param onUserDemand flag indicating whether this method was |
5506 requested by the user via a menu action (boolean) |
5494 requested by the user via a menu action (boolean) |
5507 """ |
5495 """ |
|
5496 from .AddFoundFilesDialog import AddFoundFilesDialog |
|
5497 |
5508 autoInclude = Preferences.getProject("AutoIncludeNewFiles") |
5498 autoInclude = Preferences.getProject("AutoIncludeNewFiles") |
5509 recursiveSearch = Preferences.getProject("SearchNewFilesRecursively") |
5499 recursiveSearch = Preferences.getProject("SearchNewFilesRecursively") |
5510 newFiles = [] |
5500 newFiles = [] |
5511 |
5501 |
5512 ignore_patterns = [ |
5502 ignore_patterns = [ |
5603 self.tr("There were no new files found to be added."), |
5593 self.tr("There were no new files found to be added."), |
5604 ) |
5594 ) |
5605 return |
5595 return |
5606 |
5596 |
5607 # autoInclude is not set, show a dialog |
5597 # autoInclude is not set, show a dialog |
5608 from .AddFoundFilesDialog import AddFoundFilesDialog |
|
5609 |
|
5610 dlg = AddFoundFilesDialog(newFiles, self.parent(), None) |
5598 dlg = AddFoundFilesDialog(newFiles, self.parent(), None) |
5611 res = dlg.exec() |
5599 res = dlg.exec() |
5612 |
5600 |
5613 # the 'Add All' button was pressed |
5601 # the 'Add All' button was pressed |
5614 if res == 1: |
5602 if res == 1: |
5776 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"]) |
5764 vcsother = copy.deepcopy(self.pdata["VCSOTHERDATA"]) |
5777 vcs.vcsSetOtherData(vcsother) |
5765 vcs.vcsSetOtherData(vcsother) |
5778 |
5766 |
5779 if forProject: |
5767 if forProject: |
5780 if vcs is None: |
5768 if vcs is None: |
5781 from eric7 import VCS |
|
5782 |
|
5783 self.vcsProjectHelper = VCS.getBasicHelper(self) |
5769 self.vcsProjectHelper = VCS.getBasicHelper(self) |
5784 self.vcsBasicHelper = True |
5770 self.vcsBasicHelper = True |
5785 else: |
5771 else: |
5786 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) |
5772 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) |
5787 self.vcsBasicHelper = False |
5773 self.vcsBasicHelper = False |
5878 |
5864 |
5879 def __showCodeMetrics(self): |
5865 def __showCodeMetrics(self): |
5880 """ |
5866 """ |
5881 Private slot used to calculate some code metrics for the project files. |
5867 Private slot used to calculate some code metrics for the project files. |
5882 """ |
5868 """ |
|
5869 from eric7.DataViews.CodeMetricsDialog import CodeMetricsDialog |
|
5870 |
5883 files = [ |
5871 files = [ |
5884 os.path.join(self.ppath, file) |
5872 os.path.join(self.ppath, file) |
5885 for file in self.pdata["SOURCES"] |
5873 for file in self.pdata["SOURCES"] |
5886 if file.endswith(".py") |
5874 if file.endswith(".py") |
5887 ] |
5875 ] |
5888 from eric7.DataViews.CodeMetricsDialog import CodeMetricsDialog |
|
5889 |
|
5890 self.codemetrics = CodeMetricsDialog() |
5876 self.codemetrics = CodeMetricsDialog() |
5891 self.codemetrics.show() |
5877 self.codemetrics.show() |
5892 self.codemetrics.prepare(files) |
5878 self.codemetrics.prepare(files) |
5893 |
5879 |
5894 def __showCodeCoverage(self): |
5880 def __showCodeCoverage(self): |
5895 """ |
5881 """ |
5896 Private slot used to show the code coverage information for the |
5882 Private slot used to show the code coverage information for the |
5897 project files. |
5883 project files. |
5898 """ |
5884 """ |
|
5885 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog |
|
5886 |
5899 fn = self.getMainScript(True) |
5887 fn = self.getMainScript(True) |
5900 if fn is None: |
5888 if fn is None: |
5901 EricMessageBox.critical( |
5889 EricMessageBox.critical( |
5902 self.ui, |
5890 self.ui, |
5903 self.tr("Coverage Data"), |
5891 self.tr("Coverage Data"), |
5929 files = [ |
5917 files = [ |
5930 os.path.join(self.ppath, file) |
5918 os.path.join(self.ppath, file) |
5931 for file in self.pdata["SOURCES"] |
5919 for file in self.pdata["SOURCES"] |
5932 if os.path.splitext(file)[1].startswith(".py") |
5920 if os.path.splitext(file)[1].startswith(".py") |
5933 ] |
5921 ] |
5934 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog |
|
5935 |
|
5936 self.codecoverage = PyCoverageDialog() |
5922 self.codecoverage = PyCoverageDialog() |
5937 self.codecoverage.show() |
5923 self.codecoverage.show() |
5938 self.codecoverage.start(fn, files) |
5924 self.codecoverage.start(fn, files) |
5939 |
5925 |
5940 def __showProfileData(self): |
5926 def __showProfileData(self): |
5941 """ |
5927 """ |
5942 Private slot used to show the profiling information for the project. |
5928 Private slot used to show the profiling information for the project. |
5943 """ |
5929 """ |
|
5930 from eric7.DataViews.PyProfileDialog import PyProfileDialog |
|
5931 |
5944 fn = self.getMainScript(True) |
5932 fn = self.getMainScript(True) |
5945 if fn is None: |
5933 if fn is None: |
5946 EricMessageBox.critical( |
5934 EricMessageBox.critical( |
5947 self.ui, |
5935 self.ui, |
5948 self.tr("Profile Data"), |
5936 self.tr("Profile Data"), |
6006 |
5992 |
6007 def handleApplicationDiagram(self): |
5993 def handleApplicationDiagram(self): |
6008 """ |
5994 """ |
6009 Public method to handle the application diagram context menu action. |
5995 Public method to handle the application diagram context menu action. |
6010 """ |
5996 """ |
|
5997 from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType |
|
5998 |
6011 res = EricMessageBox.yesNo( |
5999 res = EricMessageBox.yesNo( |
6012 self.ui, |
6000 self.ui, |
6013 self.tr("Application Diagram"), |
6001 self.tr("Application Diagram"), |
6014 self.tr("""Include module names?"""), |
6002 self.tr("""Include module names?"""), |
6015 yesDefault=True, |
6003 yesDefault=True, |
6016 ) |
6004 ) |
6017 |
|
6018 from eric7.Graphics.UMLDialog import UMLDialog, UMLDialogType |
|
6019 |
6005 |
6020 self.applicationDiagram = UMLDialog( |
6006 self.applicationDiagram = UMLDialog( |
6021 UMLDialogType.APPLICATION_DIAGRAM, self, self.parent(), noModules=not res |
6007 UMLDialogType.APPLICATION_DIAGRAM, self, self.parent(), noModules=not res |
6022 ) |
6008 ) |
6023 self.applicationDiagram.show() |
6009 self.applicationDiagram.show() |
6821 @pyqtSlot() |
6807 @pyqtSlot() |
6822 def __createSBOMFile(self): |
6808 def __createSBOMFile(self): |
6823 """ |
6809 """ |
6824 Private slot to create a SBOM file of the project dependencies. |
6810 Private slot to create a SBOM file of the project dependencies. |
6825 """ |
6811 """ |
6826 import CycloneDXInterface |
6812 import CycloneDXInterface # __IGNORE_WARNING_I102__ |
6827 |
6813 |
6828 CycloneDXInterface.createCycloneDXFile("<project>") |
6814 CycloneDXInterface.createCycloneDXFile("<project>") |
6829 |
6815 |
6830 ######################################################################### |
6816 ######################################################################### |
6831 ## Below are methods implementing the 'Code Formatting' support |
6817 ## Below are methods implementing the 'Code Formatting' support |