Project/Project.py

changeset 2408
dc3a7c9d8f6e
parent 2380
0121b9ab8edb
child 2427
46481fe988d2
equal deleted inserted replaced
2407:b98cc8ee1142 2408:dc3a7c9d8f6e
23 23
24 from E5Gui.E5Application import e5App 24 from E5Gui.E5Application import e5App
25 from E5Gui import E5FileDialog, E5MessageBox 25 from E5Gui import E5FileDialog, E5MessageBox
26 26
27 from Globals import recentNameProject 27 from Globals import recentNameProject
28
29 from .ProjectBrowserModel import ProjectBrowserModel
30
31 from .AddLanguageDialog import AddLanguageDialog
32 from .AddFileDialog import AddFileDialog
33 from .AddDirectoryDialog import AddDirectoryDialog
34 from .PropertiesDialog import PropertiesDialog
35 from .AddFoundFilesDialog import AddFoundFilesDialog
36 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog
37 from .FiletypeAssociationDialog import FiletypeAssociationDialog
38 from .LexerAssociationDialog import LexerAssociationDialog
39 from .UserPropertiesDialog import UserPropertiesDialog
40
41 from E5XML.ProjectReader import ProjectReader
42 from E5XML.ProjectWriter import ProjectWriter
43 from E5XML.UserProjectReader import UserProjectReader
44 from E5XML.UserProjectWriter import UserProjectWriter
45 from E5XML.SessionReader import SessionReader
46 from E5XML.SessionWriter import SessionWriter
47 from E5XML.TasksReader import TasksReader
48 from E5XML.TasksWriter import TasksWriter
49 from E5XML.DebuggerPropertiesReader import DebuggerPropertiesReader
50 from E5XML.DebuggerPropertiesWriter import DebuggerPropertiesWriter
51
52 import VCS
53 from VCS.CommandOptionsDialog import vcsCommandOptionsDialog
54 from VCS.ProjectHelper import VcsProjectHelper
55
56 from Graphics.UMLDialog import UMLDialog
57
58 from DataViews.CodeMetricsDialog import CodeMetricsDialog
59 from DataViews.PyCoverageDialog import PyCoverageDialog
60 from DataViews.PyProfileDialog import PyProfileDialog
61 28
62 import UI.PixmapCache 29 import UI.PixmapCache
63 30
64 from E5Gui.E5Action import E5Action, createActionGroup 31 from E5Gui.E5Action import E5Action, createActionGroup
65 32
231 if filename is not None: 198 if filename is not None:
232 self.openProject(filename) 199 self.openProject(filename)
233 else: 200 else:
234 self.vcs = self.initVCS() 201 self.vcs = self.initVCS()
235 202
203 from .ProjectBrowserModel import ProjectBrowserModel
236 self.__model = ProjectBrowserModel(self) 204 self.__model = ProjectBrowserModel(self)
237 205
238 self.codemetrics = None 206 self.codemetrics = None
239 self.codecoverage = None 207 self.codecoverage = None
240 self.profiledata = None 208 self.profiledata = None
673 @param fn filename of the project file to be read (string) 641 @param fn filename of the project file to be read (string)
674 @return flag indicating success 642 @return flag indicating success
675 """ 643 """
676 f = QFile(fn) 644 f = QFile(fn)
677 if f.open(QIODevice.ReadOnly): 645 if f.open(QIODevice.ReadOnly):
646 from E5XML.ProjectReader import ProjectReader
678 reader = ProjectReader(f, self) 647 reader = ProjectReader(f, self)
679 reader.readXML() 648 reader.readXML()
680 res = not reader.hasError() 649 res = not reader.hasError()
681 f.close() 650 f.close()
682 else: 651 else:
769 if fn is None: 738 if fn is None:
770 fn = self.pfile 739 fn = self.pfile
771 740
772 f = QFile(fn) 741 f = QFile(fn)
773 if f.open(QIODevice.WriteOnly): 742 if f.open(QIODevice.WriteOnly):
743 from E5XML.ProjectWriter import ProjectWriter
774 ProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML() 744 ProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML()
775 res = True 745 res = True
776 else: 746 else:
777 E5MessageBox.critical(self.ui, 747 E5MessageBox.critical(self.ui,
778 self.trUtf8("Save project file"), 748 self.trUtf8("Save project file"),
802 fn, ext = os.path.splitext(os.path.basename(self.pfile)) 772 fn, ext = os.path.splitext(os.path.basename(self.pfile))
803 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4q'.format(fn)) 773 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4q'.format(fn))
804 if os.path.exists(fn): 774 if os.path.exists(fn):
805 f = QFile(fn) 775 f = QFile(fn)
806 if f.open(QIODevice.ReadOnly): 776 if f.open(QIODevice.ReadOnly):
777 from E5XML.UserProjectReader import UserProjectReader
807 reader = UserProjectReader(f, self) 778 reader = UserProjectReader(f, self)
808 reader.readXML() 779 reader.readXML()
809 f.close() 780 f.close()
810 else: 781 else:
811 E5MessageBox.critical(self.ui, 782 E5MessageBox.critical(self.ui,
823 fn, ext = os.path.splitext(os.path.basename(self.pfile)) 794 fn, ext = os.path.splitext(os.path.basename(self.pfile))
824 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4q'.format(fn)) 795 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4q'.format(fn))
825 796
826 f = QFile(fn) 797 f = QFile(fn)
827 if f.open(QIODevice.WriteOnly): 798 if f.open(QIODevice.WriteOnly):
799 from E5XML.UserProjectWriter import UserProjectWriter
828 UserProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML() 800 UserProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML()
829 f.close() 801 f.close()
830 else: 802 else:
831 E5MessageBox.critical(self.ui, 803 E5MessageBox.critical(self.ui,
832 self.trUtf8("Save user project properties"), 804 self.trUtf8("Save user project properties"),
852 fn = os.path.join(self.getProjectManagementDir(), 824 fn = os.path.join(self.getProjectManagementDir(),
853 '{0}{1}.e4s'.format(fn, indicator)) 825 '{0}{1}.e4s'.format(fn, indicator))
854 826
855 f = QFile(fn) 827 f = QFile(fn)
856 if f.open(QIODevice.ReadOnly): 828 if f.open(QIODevice.ReadOnly):
829 from E5XML.SessionReader import SessionReader
857 reader = SessionReader(f, False) 830 reader = SessionReader(f, False)
858 reader.readXML(quiet=quiet) 831 reader.readXML(quiet=quiet)
859 f.close() 832 f.close()
860 else: 833 else:
861 if not quiet: 834 if not quiet:
883 fn = os.path.join(self.getProjectManagementDir(), 856 fn = os.path.join(self.getProjectManagementDir(),
884 '{0}{1}.e4s'.format(fn, indicator)) 857 '{0}{1}.e4s'.format(fn, indicator))
885 858
886 f = QFile(fn) 859 f = QFile(fn)
887 if f.open(QIODevice.WriteOnly): 860 if f.open(QIODevice.WriteOnly):
861 from E5XML.SessionWriter import SessionWriter
888 SessionWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML() 862 SessionWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML()
889 f.close() 863 f.close()
890 else: 864 else:
891 if not quiet: 865 if not quiet:
892 E5MessageBox.critical(self.ui, 866 E5MessageBox.critical(self.ui,
930 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4t'.format(fn)) 904 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4t'.format(fn))
931 if not os.path.exists(fn): 905 if not os.path.exists(fn):
932 return 906 return
933 f = QFile(fn) 907 f = QFile(fn)
934 if f.open(QIODevice.ReadOnly): 908 if f.open(QIODevice.ReadOnly):
909 from E5XML.TasksReader import TasksReader
935 reader = TasksReader(f, True) 910 reader = TasksReader(f, True)
936 reader.readXML() 911 reader.readXML()
937 f.close() 912 f.close()
938 else: 913 else:
939 E5MessageBox.critical(self.ui, 914 E5MessageBox.critical(self.ui,
958 self.trUtf8("Save tasks"), 933 self.trUtf8("Save tasks"),
959 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>") 934 self.trUtf8("<p>The tasks file <b>{0}</b> could not be written.</p>")
960 .format(fn)) 935 .format(fn))
961 return 936 return
962 937
938 from E5XML.TasksWriter import TasksWriter
963 TasksWriter(f, True, os.path.splitext(os.path.basename(fn))[0]).writeXML() 939 TasksWriter(f, True, os.path.splitext(os.path.basename(fn))[0]).writeXML()
964 f.close() 940 f.close()
965 941
966 def __readDebugProperties(self, quiet=False): 942 def __readDebugProperties(self, quiet=False):
967 """ 943 """
980 fn, ext = os.path.splitext(os.path.basename(self.pfile)) 956 fn, ext = os.path.splitext(os.path.basename(self.pfile))
981 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4d'.format(fn)) 957 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4d'.format(fn))
982 958
983 f = QFile(fn) 959 f = QFile(fn)
984 if f.open(QIODevice.ReadOnly): 960 if f.open(QIODevice.ReadOnly):
961 from E5XML.DebuggerPropertiesReader import DebuggerPropertiesReader
985 reader = DebuggerPropertiesReader(f, self) 962 reader = DebuggerPropertiesReader(f, self)
986 reader.readXML(quiet=quiet) 963 reader.readXML(quiet=quiet)
987 f.close() 964 f.close()
988 else: 965 else:
989 if not quiet: 966 if not quiet:
1009 fn, ext = os.path.splitext(os.path.basename(self.pfile)) 986 fn, ext = os.path.splitext(os.path.basename(self.pfile))
1010 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4d'.format(fn)) 987 fn = os.path.join(self.getProjectManagementDir(), '{0}.e4d'.format(fn))
1011 988
1012 f = QFile(fn) 989 f = QFile(fn)
1013 if f.open(QIODevice.WriteOnly): 990 if f.open(QIODevice.WriteOnly):
991 from E5XML.DebuggerPropertiesWriter import DebuggerPropertiesWriter
1014 DebuggerPropertiesWriter(f, os.path.splitext(os.path.basename(fn))[0])\ 992 DebuggerPropertiesWriter(f, os.path.splitext(os.path.basename(fn))[0])\
1015 .writeXML() 993 .writeXML()
1016 f.close() 994 f.close()
1017 else: 995 else:
1018 if not quiet: 996 if not quiet:
1070 1048
1071 def __showDebugProperties(self): 1049 def __showDebugProperties(self):
1072 """ 1050 """
1073 Private slot to display the debugger properties dialog. 1051 Private slot to display the debugger properties dialog.
1074 """ 1052 """
1053 from .DebuggerPropertiesDialog import DebuggerPropertiesDialog
1075 dlg = DebuggerPropertiesDialog(self) 1054 dlg = DebuggerPropertiesDialog(self)
1076 if dlg.exec_() == QDialog.Accepted: 1055 if dlg.exec_() == QDialog.Accepted:
1077 dlg.storeData() 1056 dlg.storeData()
1078 1057
1079 def getDebugProperty(self, key): 1058 def getDebugProperty(self, key):
1135 E5MessageBox.critical(self.ui, 1114 E5MessageBox.critical(self.ui,
1136 self.trUtf8("Add Language"), 1115 self.trUtf8("Add Language"),
1137 self.trUtf8("You have to specify a translation pattern first.")) 1116 self.trUtf8("You have to specify a translation pattern first."))
1138 return 1117 return
1139 1118
1119 from .AddLanguageDialog import AddLanguageDialog
1140 dlg = AddLanguageDialog(self.parent()) 1120 dlg = AddLanguageDialog(self.parent())
1141 if dlg.exec_() == QDialog.Accepted: 1121 if dlg.exec_() == QDialog.Accepted:
1142 lang = dlg.getSelectedLanguage() 1122 lang = dlg.getSelectedLanguage()
1143 if self.pdata["PROJECTTYPE"][0] in \ 1123 if self.pdata["PROJECTTYPE"][0] in \
1144 ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]: 1124 ["Qt4", "Qt4C", "E4Plugin", "PySide", "PySideC"]:
1346 (string out of source, form, resource, interface, others) 1326 (string out of source, form, resource, interface, others)
1347 @param startdir start directory for the selection dialog 1327 @param startdir start directory for the selection dialog
1348 """ 1328 """
1349 if startdir is None: 1329 if startdir is None:
1350 startdir = self.ppath 1330 startdir = self.ppath
1331 from .AddFileDialog import AddFileDialog
1351 dlg = AddFileDialog(self, self.parent(), filter, startdir=startdir) 1332 dlg = AddFileDialog(self, self.parent(), filter, startdir=startdir)
1352 if dlg.exec_() == QDialog.Accepted: 1333 if dlg.exec_() == QDialog.Accepted:
1353 fnames, target, isSource = dlg.getData() 1334 fnames, target, isSource = dlg.getData()
1354 if target != '': 1335 if target != '':
1355 for fn in fnames: 1336 for fn in fnames:
1478 (string out of source, form, resource, interface, others) 1459 (string out of source, form, resource, interface, others)
1479 @param startdir start directory for the selection dialog (string) 1460 @param startdir start directory for the selection dialog (string)
1480 """ 1461 """
1481 if startdir is None: 1462 if startdir is None:
1482 startdir = self.ppath 1463 startdir = self.ppath
1464 from .AddDirectoryDialog import AddDirectoryDialog
1483 dlg = AddDirectoryDialog(self, filter, self.parent(), startdir=startdir) 1465 dlg = AddDirectoryDialog(self, filter, self.parent(), startdir=startdir)
1484 if dlg.exec_() == QDialog.Accepted: 1466 if dlg.exec_() == QDialog.Accepted:
1485 filetype, source, target, recursive = dlg.getData() 1467 filetype, source, target, recursive = dlg.getData()
1486 if target == '': 1468 if target == '':
1487 E5MessageBox.critical(self.ui, 1469 E5MessageBox.critical(self.ui,
1879 the project object with the data entered. 1861 the project object with the data entered.
1880 """ 1862 """
1881 if not self.checkDirty(): 1863 if not self.checkDirty():
1882 return 1864 return
1883 1865
1866 from .PropertiesDialog import PropertiesDialog
1884 dlg = PropertiesDialog(self, True) 1867 dlg = PropertiesDialog(self, True)
1885 if dlg.exec_() == QDialog.Accepted: 1868 if dlg.exec_() == QDialog.Accepted:
1886 self.closeProject() 1869 self.closeProject()
1887 dlg.storeData() 1870 dlg.storeData()
1888 self.__makePpathRe() 1871 self.__makePpathRe()
2037 vcores = E5MessageBox.yesNo(self.ui, 2020 vcores = E5MessageBox.yesNo(self.ui,
2038 self.trUtf8("New Project"), 2021 self.trUtf8("New Project"),
2039 self.trUtf8("""Would you like to edit the VCS""" 2022 self.trUtf8("""Would you like to edit the VCS"""
2040 """ command options?""")) 2023 """ command options?"""))
2041 if vcores: 2024 if vcores:
2025 from VCS.CommandOptionsDialog import \
2026 vcsCommandOptionsDialog
2042 codlg = vcsCommandOptionsDialog(self.vcs) 2027 codlg = vcsCommandOptionsDialog(self.vcs)
2043 if codlg.exec_() == QDialog.Accepted: 2028 if codlg.exec_() == QDialog.Accepted:
2044 self.vcs.vcsSetOptions(codlg.getOptions()) 2029 self.vcs.vcsSetOptions(codlg.getOptions())
2045 # add project file to repository 2030 # add project file to repository
2046 if res == 0: 2031 if res == 0:
2197 2182
2198 def __showProperties(self): 2183 def __showProperties(self):
2199 """ 2184 """
2200 Private slot to display the properties dialog. 2185 Private slot to display the properties dialog.
2201 """ 2186 """
2187 from .PropertiesDialog import PropertiesDialog
2202 dlg = PropertiesDialog(self, False) 2188 dlg = PropertiesDialog(self, False)
2203 if dlg.exec_() == QDialog.Accepted: 2189 if dlg.exec_() == QDialog.Accepted:
2204 projectType = self.pdata["PROJECTTYPE"][0] 2190 projectType = self.pdata["PROJECTTYPE"][0]
2205 dlg.storeData() 2191 dlg.storeData()
2206 self.setDirty(True) 2192 self.setDirty(True)
2244 """ 2230 """
2245 vcsSystem = self.pdata["VCS"] and self.pdata["VCS"][0] or None 2231 vcsSystem = self.pdata["VCS"] and self.pdata["VCS"][0] or None
2246 vcsSystemOverride = \ 2232 vcsSystemOverride = \
2247 self.pudata["VCSOVERRIDE"] and self.pudata["VCSOVERRIDE"][0] or None 2233 self.pudata["VCSOVERRIDE"] and self.pudata["VCSOVERRIDE"][0] or None
2248 2234
2235 from .UserPropertiesDialog import UserPropertiesDialog
2249 dlg = UserPropertiesDialog(self) 2236 dlg = UserPropertiesDialog(self)
2250 if dlg.exec_() == QDialog.Accepted: 2237 if dlg.exec_() == QDialog.Accepted:
2251 dlg.storeData() 2238 dlg.storeData()
2252 2239
2253 if (self.pdata["VCS"] and \ 2240 if (self.pdata["VCS"] and \
2257 (vcsSystemOverride is not None and \ 2244 (vcsSystemOverride is not None and \
2258 len(self.pudata["VCSOVERRIDE"]) == 0): 2245 len(self.pudata["VCSOVERRIDE"]) == 0):
2259 # stop the VCS monitor thread and shutdown VCS 2246 # stop the VCS monitor thread and shutdown VCS
2260 if self.vcs is not None: 2247 if self.vcs is not None:
2261 self.vcs.stopStatusMonitor() 2248 self.vcs.stopStatusMonitor()
2262 ## self.vcs.vcsStatusMonitorData.disconnect(self.__model.changeVCSStates)
2263 ## self.vcs.vcsStatusMonitorStatus.disconnect(self.__statusMonitorStatus)
2264 self.vcs.vcsShutdown() 2249 self.vcs.vcsShutdown()
2265 self.vcs.deleteLater() 2250 self.vcs.deleteLater()
2266 self.vcs = None 2251 self.vcs = None
2267 e5App().getObject("PluginManager").deactivateVcsPlugins() 2252 e5App().getObject("PluginManager").deactivateVcsPlugins()
2268 # reinit VCS 2253 # reinit VCS
2283 2268
2284 def __showFiletypeAssociations(self): 2269 def __showFiletypeAssociations(self):
2285 """ 2270 """
2286 Public slot to display the filetype association dialog. 2271 Public slot to display the filetype association dialog.
2287 """ 2272 """
2273 from .FiletypeAssociationDialog import FiletypeAssociationDialog
2288 dlg = FiletypeAssociationDialog(self) 2274 dlg = FiletypeAssociationDialog(self)
2289 if dlg.exec_() == QDialog.Accepted: 2275 if dlg.exec_() == QDialog.Accepted:
2290 dlg.transferData() 2276 dlg.transferData()
2291 self.setDirty(True) 2277 self.setDirty(True)
2292 2278
2293 def __showLexerAssociations(self): 2279 def __showLexerAssociations(self):
2294 """ 2280 """
2295 Public slot to display the lexer association dialog. 2281 Public slot to display the lexer association dialog.
2296 """ 2282 """
2283 from .LexerAssociationDialog import LexerAssociationDialog
2297 dlg = LexerAssociationDialog(self) 2284 dlg = LexerAssociationDialog(self)
2298 if dlg.exec_() == QDialog.Accepted: 2285 if dlg.exec_() == QDialog.Accepted:
2299 dlg.transferData() 2286 dlg.transferData()
2300 self.setDirty(True) 2287 self.setDirty(True)
2301 self.lexerAssociationsChanged.emit() 2288 self.lexerAssociationsChanged.emit()
2621 return False 2608 return False
2622 2609
2623 # stop the VCS monitor thread 2610 # stop the VCS monitor thread
2624 if self.vcs is not None: 2611 if self.vcs is not None:
2625 self.vcs.stopStatusMonitor() 2612 self.vcs.stopStatusMonitor()
2626 ## try:
2627 ## self.vcs.vcsStatusMonitorData.disconnect(
2628 ## self.__model.changeVCSStates)
2629 ## except TypeError:
2630 ## pass
2631 ## try:
2632 ## self.vcs.vcsStatusMonitorStatus.disconnect(
2633 ## self.__statusMonitorStatus)
2634 ## except TypeError:
2635 ## pass
2636 2613
2637 # now save the tasks 2614 # now save the tasks
2638 if not noSave: 2615 if not noSave:
2639 self.writeTasks() 2616 self.writeTasks()
2640 self.ui.taskViewer.clearProjectTasks() 2617 self.ui.taskViewer.clearProjectTasks()
3760 self.trUtf8("Search New Files"), 3737 self.trUtf8("Search New Files"),
3761 self.trUtf8("There were no new files found to be added.")) 3738 self.trUtf8("There were no new files found to be added."))
3762 return 3739 return
3763 3740
3764 # autoInclude is not set, show a dialog 3741 # autoInclude is not set, show a dialog
3742 from .AddFoundFilesDialog import AddFoundFilesDialog
3765 dlg = AddFoundFilesDialog(newFiles, self.parent(), None) 3743 dlg = AddFoundFilesDialog(newFiles, self.parent(), None)
3766 res = dlg.exec_() 3744 res = dlg.exec_()
3767 3745
3768 # the 'Add All' button was pressed 3746 # the 'Add All' button was pressed
3769 if res == 1: 3747 if res == 1:
3869 not nooverride: 3847 not nooverride:
3870 vcsSystem = self.pudata["VCSOVERRIDE"][0] 3848 vcsSystem = self.pudata["VCSOVERRIDE"][0]
3871 override = True 3849 override = True
3872 3850
3873 if vcsSystem is not None: 3851 if vcsSystem is not None:
3852 import VCS
3874 try: 3853 try:
3875 vcs = VCS.factory(vcsSystem) 3854 vcs = VCS.factory(vcsSystem)
3876 except ImportError: 3855 except ImportError:
3877 if override: 3856 if override:
3878 # override failed, revert to original 3857 # override failed, revert to original
3919 vcs.vcsSetOtherData(vcsother) 3898 vcs.vcsSetOtherData(vcsother)
3920 except LookupError: 3899 except LookupError:
3921 pass 3900 pass
3922 3901
3923 if vcs is None: 3902 if vcs is None:
3903 from VCS.ProjectHelper import VcsProjectHelper
3924 self.vcsProjectHelper = VcsProjectHelper(None, self) 3904 self.vcsProjectHelper = VcsProjectHelper(None, self)
3925 self.vcsBasicHelper = True 3905 self.vcsBasicHelper = True
3926 else: 3906 else:
3927 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self) 3907 self.vcsProjectHelper = vcs.vcsGetProjectHelper(self)
3928 self.vcsBasicHelper = False 3908 self.vcsBasicHelper = False
3988 """ 3968 """
3989 Private slot used to calculate some code metrics for the project files. 3969 Private slot used to calculate some code metrics for the project files.
3990 """ 3970 """
3991 files = [os.path.join(self.ppath, file) \ 3971 files = [os.path.join(self.ppath, file) \
3992 for file in self.pdata["SOURCES"] if file.endswith(".py")] 3972 for file in self.pdata["SOURCES"] if file.endswith(".py")]
3973 from DataViews.CodeMetricsDialog import CodeMetricsDialog
3993 self.codemetrics = CodeMetricsDialog() 3974 self.codemetrics = CodeMetricsDialog()
3994 self.codemetrics.show() 3975 self.codemetrics.show()
3995 self.codemetrics.prepare(files, self) 3976 self.codemetrics.prepare(files, self)
3996 3977
3997 def __showCodeCoverage(self): 3978 def __showCodeCoverage(self):
4034 else: 4015 else:
4035 return 4016 return
4036 4017
4037 files = [os.path.join(self.ppath, file) \ 4018 files = [os.path.join(self.ppath, file) \
4038 for file in self.pdata["SOURCES"] if file.endswith(".py")] 4019 for file in self.pdata["SOURCES"] if file.endswith(".py")]
4020 from DataViews.PyCoverageDialog import PyCoverageDialog
4039 self.codecoverage = PyCoverageDialog() 4021 self.codecoverage = PyCoverageDialog()
4040 self.codecoverage.show() 4022 self.codecoverage.show()
4041 self.codecoverage.start(fn, files) 4023 self.codecoverage.start(fn, files)
4042 4024
4043 def __showProfileData(self): 4025 def __showProfileData(self):
4078 else: 4060 else:
4079 fn = files[0] 4061 fn = files[0]
4080 else: 4062 else:
4081 return 4063 return
4082 4064
4065 from DataViews.PyProfileDialog import PyProfileDialog
4083 self.profiledata = PyProfileDialog() 4066 self.profiledata = PyProfileDialog()
4084 self.profiledata.show() 4067 self.profiledata.show()
4085 self.profiledata.start(fn) 4068 self.profiledata.start(fn)
4086 4069
4087 def __showContextMenuShow(self): 4070 def __showContextMenuShow(self):
4123 res = E5MessageBox.yesNo(self.ui, 4106 res = E5MessageBox.yesNo(self.ui,
4124 self.trUtf8("Application Diagram"), 4107 self.trUtf8("Application Diagram"),
4125 self.trUtf8("""Include module names?"""), 4108 self.trUtf8("""Include module names?"""),
4126 yesDefault=True) 4109 yesDefault=True)
4127 4110
4111 from Graphics.UMLDialog import UMLDialog
4128 self.applicationDiagram = UMLDialog(UMLDialog.ApplicationDiagram, self, 4112 self.applicationDiagram = UMLDialog(UMLDialog.ApplicationDiagram, self,
4129 self.parent(), noModules=not res) 4113 self.parent(), noModules=not res)
4130 self.applicationDiagram.show() 4114 self.applicationDiagram.show()
4131 4115
4132 def __loadDiagram(self): 4116 def __loadDiagram(self):
4133 """ 4117 """
4134 Private slot to load a diagram from file. 4118 Private slot to load a diagram from file.
4135 """ 4119 """
4120 from Graphics.UMLDialog import UMLDialog
4136 self.loadedDiagram = None 4121 self.loadedDiagram = None
4137 loadedDiagram = UMLDialog(UMLDialog.NoDiagram, self, parent=self.parent()) 4122 loadedDiagram = UMLDialog(UMLDialog.NoDiagram, self, parent=self.parent())
4138 if loadedDiagram.load(): 4123 if loadedDiagram.load():
4139 self.loadedDiagram = loadedDiagram 4124 self.loadedDiagram = loadedDiagram
4140 self.loadedDiagram.show(fromFile=True) 4125 self.loadedDiagram.show(fromFile=True)

eric ide

mercurial