51 """ |
51 """ |
52 Public method to initialize the object. |
52 Public method to initialize the object. |
53 """ |
53 """ |
54 pname = self.project.getProjectName() |
54 pname = self.project.getProjectName() |
55 if pname: |
55 if pname: |
56 name = self.trUtf8("Package Diagram {0}: {1}").format( |
56 name = self.tr("Package Diagram {0}: {1}").format( |
57 pname, self.project.getRelativePath(self.package)) |
57 pname, self.project.getRelativePath(self.package)) |
58 else: |
58 else: |
59 name = self.trUtf8("Package Diagram: {0}").format(self.package) |
59 name = self.tr("Package Diagram: {0}").format(self.package) |
60 self.umlView.setDiagramName(name) |
60 self.umlView.setDiagramName(name) |
61 |
61 |
62 def __getCurrentShape(self, name): |
62 def __getCurrentShape(self, name): |
63 """ |
63 """ |
64 Private method to get the named shape. |
64 Private method to get the named shape. |
91 for ext in supportedExt: |
91 for ext in supportedExt: |
92 modules.extend(glob.glob( |
92 modules.extend(glob.glob( |
93 Utilities.normjoinpath(self.package, ext))) |
93 Utilities.normjoinpath(self.package, ext))) |
94 tot = len(modules) |
94 tot = len(modules) |
95 progress = E5ProgressDialog( |
95 progress = E5ProgressDialog( |
96 self.trUtf8("Parsing modules..."), |
96 self.tr("Parsing modules..."), |
97 None, 0, tot, self.trUtf8("%v/%m Modules"), self.parent()) |
97 None, 0, tot, self.tr("%v/%m Modules"), self.parent()) |
98 try: |
98 try: |
99 prog = 0 |
99 prog = 0 |
100 progress.show() |
100 progress.show() |
101 QApplication.processEvents() |
101 QApplication.processEvents() |
102 |
102 |
150 tot = 0 |
150 tot = 0 |
151 for ext in supportedExt: |
151 for ext in supportedExt: |
152 for subpackage in subpackagesList: |
152 for subpackage in subpackagesList: |
153 tot += len(glob.glob(Utilities.normjoinpath(subpackage, ext))) |
153 tot += len(glob.glob(Utilities.normjoinpath(subpackage, ext))) |
154 progress = E5ProgressDialog( |
154 progress = E5ProgressDialog( |
155 self.trUtf8("Parsing modules..."), |
155 self.tr("Parsing modules..."), |
156 None, 0, tot, self.trUtf8("%v/%m Modules"), self.parent()) |
156 None, 0, tot, self.tr("%v/%m Modules"), self.parent()) |
157 try: |
157 try: |
158 prog = 0 |
158 prog = 0 |
159 progress.show() |
159 progress.show() |
160 QApplication.processEvents() |
160 QApplication.processEvents() |
161 |
161 |
200 |
200 |
201 initlist = glob.glob(os.path.join(self.package, '__init__.*')) |
201 initlist = glob.glob(os.path.join(self.package, '__init__.*')) |
202 if len(initlist) == 0: |
202 if len(initlist) == 0: |
203 ct = QGraphicsTextItem(None, self.scene) |
203 ct = QGraphicsTextItem(None, self.scene) |
204 ct.setHtml( |
204 ct.setHtml( |
205 self.trUtf8("The directory <b>'{0}'</b> is not a package.") |
205 self.tr("The directory <b>'{0}'</b> is not a package.") |
206 .format(self.package)) |
206 .format(self.package)) |
207 return |
207 return |
208 |
208 |
209 modules = self.__buildModulesDict() |
209 modules = self.__buildModulesDict() |
210 if not modules: |
210 if not modules: |
211 ct = QGraphicsTextItem(None, self.scene) |
211 ct = QGraphicsTextItem(None, self.scene) |
212 ct.setHtml( |
212 ct.setHtml( |
213 self.trUtf8( |
213 self.tr( |
214 "The package <b>'{0}'</b> does not contain any modules.") |
214 "The package <b>'{0}'</b> does not contain any modules.") |
215 .format(self.package)) |
215 .format(self.package)) |
216 return |
216 return |
217 |
217 |
218 # step 1: build all classes found in the modules |
218 # step 1: build all classes found in the modules |
224 classesFound = True |
224 classesFound = True |
225 self.__addLocalClass(cls, module.classes[cls], 0, 0) |
225 self.__addLocalClass(cls, module.classes[cls], 0, 0) |
226 if not classesFound: |
226 if not classesFound: |
227 ct = QGraphicsTextItem(None, self.scene) |
227 ct = QGraphicsTextItem(None, self.scene) |
228 ct.setHtml( |
228 ct.setHtml( |
229 self.trUtf8( |
229 self.tr( |
230 "The package <b>'{0}'</b> does not contain any classes.") |
230 "The package <b>'{0}'</b> does not contain any classes.") |
231 .format(self.package)) |
231 .format(self.package)) |
232 return |
232 return |
233 |
233 |
234 # step 2: build the class hierarchies |
234 # step 2: build the class hierarchies |