10 import itertools |
10 import itertools |
11 |
11 |
12 from PyQt4.QtGui import QGraphicsTextItem |
12 from PyQt4.QtGui import QGraphicsTextItem |
13 |
13 |
14 import Utilities.ModuleParser |
14 import Utilities.ModuleParser |
|
15 import Preferences |
15 |
16 |
16 from .UMLDialog import UMLDialog |
17 from .UMLDialog import UMLDialog |
17 from .ClassItem import ClassItem, ClassModel |
18 from .ClassItem import ClassItem, ClassModel |
18 from .AssociationItem import AssociationItem, Generalisation |
19 from .AssociationItem import AssociationItem, Generalisation |
19 from . import GraphicsUtilities |
20 from . import GraphicsUtilities |
61 Private method to build the class shapes of the class diagram. |
62 Private method to build the class shapes of the class diagram. |
62 |
63 |
63 The algorithm is borrowed from Boa Constructor. |
64 The algorithm is borrowed from Boa Constructor. |
64 """ |
65 """ |
65 try: |
66 try: |
66 module = Utilities.ModuleParser.readModule(self.file) |
67 extensions = Preferences.getPython("PythonExtensions") + \ |
|
68 Preferences.getPython("Python3Extensions") + ['.rb'] |
|
69 module = Utilities.ModuleParser.readModule(self.file, extensions=extensions) |
67 except ImportError: |
70 except ImportError: |
68 ct = QGraphicsTextItem(None, self.scene) |
71 ct = QGraphicsTextItem(None, self.scene) |
69 ct.setHtml( |
72 ct.setHtml( |
70 self.trUtf8("The module <b>'{0}'</b> could not be found.") |
73 self.trUtf8("The module <b>'{0}'</b> could not be found.") |
71 .format(self.file)) |
74 .format(self.file)) |