19 from .AssociationItem import AssociationItem, Imports |
19 from .AssociationItem import AssociationItem, Imports |
20 from . import GraphicsUtilities |
20 from . import GraphicsUtilities |
21 |
21 |
22 import Utilities.ModuleParser |
22 import Utilities.ModuleParser |
23 import Utilities |
23 import Utilities |
|
24 import Preferences |
24 |
25 |
25 class ImportsDiagram(UMLDialog): |
26 class ImportsDiagram(UMLDialog): |
26 """ |
27 """ |
27 Class implementing a dialog showing an imports diagram of a package. |
28 Class implementing a dialog showing an imports diagram of a package. |
28 |
29 |
64 Private method to build a dictionary of modules contained in the package. |
65 Private method to build a dictionary of modules contained in the package. |
65 |
66 |
66 @return dictionary of modules contained in the package. |
67 @return dictionary of modules contained in the package. |
67 """ |
68 """ |
68 moduleDict = {} |
69 moduleDict = {} |
69 # TODO: change this to use configured Python extensions |
70 modules = [] |
70 modules = glob.glob(Utilities.normjoinpath(self.packagePath,'*.py')) + \ |
71 for ext in Preferences.getPython("PythonExtensions") + \ |
71 glob.glob(Utilities.normjoinpath(self.packagePath,'*.pyw')) + \ |
72 Preferences.getPython("Python3Extensions"): |
72 glob.glob(Utilities.normjoinpath(self.packagePath,'*.ptl')) |
73 modules.extend( |
|
74 glob.glob(Utilities.normjoinpath(self.packagePath, '*%s' % ext))) |
|
75 |
73 tot = len(modules) |
76 tot = len(modules) |
74 try: |
77 try: |
75 prog = 0 |
78 prog = 0 |
76 progress = QProgressDialog(self.trUtf8("Parsing modules..."), |
79 progress = QProgressDialog(self.trUtf8("Parsing modules..."), |
77 None, 0, tot, self) |
80 None, 0, tot, self) |