46 """ |
46 """ |
47 Public method to initialize the object. |
47 Public method to initialize the object. |
48 """ |
48 """ |
49 pname = self.project.getProjectName() |
49 pname = self.project.getProjectName() |
50 if pname: |
50 if pname: |
51 name = self.trUtf8("Package Diagram {0}: {1}").format( |
51 name = self.tr("Package Diagram {0}: {1}").format( |
52 pname, self.project.getRelativePath(self.package)) |
52 pname, self.project.getRelativePath(self.package)) |
53 else: |
53 else: |
54 name = self.trUtf8("Package Diagram: {0}").format(self.package) |
54 name = self.tr("Package Diagram: {0}").format(self.package) |
55 self.umlView.setDiagramName(name) |
55 self.umlView.setDiagramName(name) |
56 |
56 |
57 def __getCurrentShape(self, name): |
57 def __getCurrentShape(self, name): |
58 """ |
58 """ |
59 Private method to get the named shape. |
59 Private method to get the named shape. |
86 for ext in supportedExt: |
86 for ext in supportedExt: |
87 modules.extend(glob.glob( |
87 modules.extend(glob.glob( |
88 Utilities.normjoinpath(self.package, ext))) |
88 Utilities.normjoinpath(self.package, ext))) |
89 tot = len(modules) |
89 tot = len(modules) |
90 progress = E5ProgressDialog( |
90 progress = E5ProgressDialog( |
91 self.trUtf8("Parsing modules..."), |
91 self.tr("Parsing modules..."), |
92 None, 0, tot, self.trUtf8("%v/%m Modules"), self.parent()) |
92 None, 0, tot, self.tr("%v/%m Modules"), self.parent()) |
93 try: |
93 try: |
94 prog = 0 |
94 prog = 0 |
95 progress.show() |
95 progress.show() |
96 QApplication.processEvents() |
96 QApplication.processEvents() |
97 |
97 |
145 tot = 0 |
145 tot = 0 |
146 for ext in supportedExt: |
146 for ext in supportedExt: |
147 for subpackage in subpackagesList: |
147 for subpackage in subpackagesList: |
148 tot += len(glob.glob(Utilities.normjoinpath(subpackage, ext))) |
148 tot += len(glob.glob(Utilities.normjoinpath(subpackage, ext))) |
149 progress = E5ProgressDialog( |
149 progress = E5ProgressDialog( |
150 self.trUtf8("Parsing modules..."), |
150 self.tr("Parsing modules..."), |
151 None, 0, tot, self.trUtf8("%v/%m Modules"), self.parent()) |
151 None, 0, tot, self.tr("%v/%m Modules"), self.parent()) |
152 try: |
152 try: |
153 prog = 0 |
153 prog = 0 |
154 progress.show() |
154 progress.show() |
155 QApplication.processEvents() |
155 QApplication.processEvents() |
156 |
156 |
195 |
195 |
196 initlist = glob.glob(os.path.join(self.package, '__init__.*')) |
196 initlist = glob.glob(os.path.join(self.package, '__init__.*')) |
197 if len(initlist) == 0: |
197 if len(initlist) == 0: |
198 ct = QGraphicsTextItem(None, self.scene) |
198 ct = QGraphicsTextItem(None, self.scene) |
199 ct.setHtml( |
199 ct.setHtml( |
200 self.trUtf8("The directory <b>'{0}'</b> is not a package.") |
200 self.tr("The directory <b>'{0}'</b> is not a package.") |
201 .format(self.package)) |
201 .format(self.package)) |
202 return |
202 return |
203 |
203 |
204 modules = self.__buildModulesDict() |
204 modules = self.__buildModulesDict() |
205 if not modules: |
205 if not modules: |
206 ct = QGraphicsTextItem(None, self.scene) |
206 ct = QGraphicsTextItem(None, self.scene) |
207 ct.setHtml( |
207 ct.setHtml( |
208 self.trUtf8( |
208 self.tr( |
209 "The package <b>'{0}'</b> does not contain any modules.") |
209 "The package <b>'{0}'</b> does not contain any modules.") |
210 .format(self.package)) |
210 .format(self.package)) |
211 return |
211 return |
212 |
212 |
213 # step 1: build all classes found in the modules |
213 # step 1: build all classes found in the modules |
219 classesFound = True |
219 classesFound = True |
220 self.__addLocalClass(cls, module.classes[cls], 0, 0) |
220 self.__addLocalClass(cls, module.classes[cls], 0, 0) |
221 if not classesFound: |
221 if not classesFound: |
222 ct = QGraphicsTextItem(None, self.scene) |
222 ct = QGraphicsTextItem(None, self.scene) |
223 ct.setHtml( |
223 ct.setHtml( |
224 self.trUtf8( |
224 self.tr( |
225 "The package <b>'{0}'</b> does not contain any classes.") |
225 "The package <b>'{0}'</b> does not contain any classes.") |
226 .format(self.package)) |
226 .format(self.package)) |
227 return |
227 return |
228 |
228 |
229 # step 2: build the class hierarchies |
229 # step 2: build the class hierarchies |