Graphics/ApplicationDiagram.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
17 from .PackageItem import PackageItem, PackageModel 17 from .PackageItem import PackageItem, PackageModel
18 from .AssociationItem import AssociationItem, Imports 18 from .AssociationItem import AssociationItem, Imports
19 19
20 import Utilities.ModuleParser 20 import Utilities.ModuleParser
21 import Utilities 21 import Utilities
22
22 23
23 class ApplicationDiagram(UMLDialog): 24 class ApplicationDiagram(UMLDialog):
24 """ 25 """
25 Class implementing a dialog showing an imports diagram of the application. 26 Class implementing a dialog showing an imports diagram of the application.
26 """ 27 """
27 def __init__(self, project, parent = None, name = None, noModules = False): 28 def __init__(self, project, parent=None, name=None, noModules=False):
28 """ 29 """
29 Constructor 30 Constructor
30 31
31 @param project reference to the project object 32 @param project reference to the project object
32 @param parent parent widget of the view (QWidget) 33 @param parent parent widget of the view (QWidget)
33 @param name name of the view widget (string) 34 @param name name of the view widget (string)
34 @keyparam noModules flag indicating, that no module names should be 35 @keyparam noModules flag indicating, that no module names should be
35 shown (boolean) 36 shown (boolean)
36 """ 37 """
37 self.project = project 38 self.project = project
38 self.noModules = noModules 39 self.noModules = noModules
39 40
68 progress.setValue(prog) 69 progress.setValue(prog)
69 QApplication.processEvents() 70 QApplication.processEvents()
70 prog += 1 71 prog += 1
71 if module.endswith("__init__.py"): 72 if module.endswith("__init__.py"):
72 continue 73 continue
73 try: 74 try:
74 mod = Utilities.ModuleParser.readModule(module) 75 mod = Utilities.ModuleParser.readModule(module)
75 except ImportError: 76 except ImportError:
76 continue 77 continue
77 else: 78 else:
78 name = mod.name 79 name = mod.name
218 @param x x-coordinate (float) 219 @param x x-coordinate (float)
219 @param y y-coordinate (float) 220 @param y y-coordinate (float)
220 """ 221 """
221 modules.sort() 222 modules.sort()
222 pm = PackageModel(name, modules) 223 pm = PackageModel(name, modules)
223 pw = PackageItem(pm, x, y, noModules = self.noModules, scene = self.scene) 224 pw = PackageItem(pm, x, y, noModules=self.noModules, scene=self.scene)
224 return pw 225 return pw
225 226
226 def __createAssociations(self, shapes): 227 def __createAssociations(self, shapes):
227 """ 228 """
228 Private method to generate the associations between the package shapes. 229 Private method to generate the associations between the package shapes.

eric ide

mercurial