Graphics/UMLClassDiagram.py

changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
10 from PyQt4.QtCore import * 10 from PyQt4.QtCore import *
11 from PyQt4.QtGui import * 11 from PyQt4.QtGui import *
12 12
13 import Utilities.ModuleParser 13 import Utilities.ModuleParser
14 14
15 from UMLDialog import UMLDialog 15 from .UMLDialog import UMLDialog
16 from ClassItem import ClassItem, ClassModel 16 from .ClassItem import ClassItem, ClassModel
17 from AssociationItem import AssociationItem, Generalisation 17 from .AssociationItem import AssociationItem, Generalisation
18 import GraphicsUtilities 18 from . import GraphicsUtilities
19 19
20 class UMLClassDiagram(UMLDialog): 20 class UMLClassDiagram(UMLDialog):
21 """ 21 """
22 Class implementing a dialog showing a UML like class diagram. 22 Class implementing a dialog showing a UML like class diagram.
23 """ 23 """
67 ct.setHtml(\ 67 ct.setHtml(\
68 self.trUtf8("The module <b>'{0}'</b> could not be found.") 68 self.trUtf8("The module <b>'{0}'</b> could not be found.")
69 .format(self.file)) 69 .format(self.file))
70 return 70 return
71 71
72 if not self.allModules.has_key(self.file): 72 if self.file not in self.allModules:
73 self.allModules[self.file] = [] 73 self.allModules[self.file] = []
74 74
75 routes = [] 75 routes = []
76 nodes = [] 76 nodes = []
77 todo = [module.createHierarchy()] 77 todo = [module.createHierarchy()]
111 self.__addExternalClass(className, 0, 0) 111 self.__addExternalClass(className, 0, 0)
112 nodes.append(className) 112 nodes.append(className)
113 113
114 if hierarchy.get(className): 114 if hierarchy.get(className):
115 todo.append(hierarchy.get(className)) 115 todo.append(hierarchy.get(className))
116 children = hierarchy.get(className).keys() 116 children = list(hierarchy.get(className).keys())
117 for child in children: 117 for child in children:
118 if (className, child) not in routes: 118 if (className, child) not in routes:
119 routes.append((className, child)) 119 routes.append((className, child))
120 120
121 del todo[0] 121 del todo[0]

eric ide

mercurial