11 |
11 |
12 from itertools import zip_longest |
12 from itertools import zip_longest |
13 |
13 |
14 from PyQt6.QtWidgets import QGraphicsTextItem |
14 from PyQt6.QtWidgets import QGraphicsTextItem |
15 |
15 |
16 from eric7 import Preferences, Utilities |
16 from eric7 import Globals, Preferences |
|
17 from eric7.SystemUtilities import FileSystemUtilities |
17 |
18 |
18 from .UMLDiagramBuilder import UMLDiagramBuilder |
19 from .UMLDiagramBuilder import UMLDiagramBuilder |
19 |
20 |
20 |
21 |
21 class UMLClassDiagramBuilder(UMLDiagramBuilder): |
22 class UMLClassDiagramBuilder(UMLDiagramBuilder): |
371 """ |
372 """ |
372 data = { |
373 data = { |
373 "project_name": self.project.getProjectName(), |
374 "project_name": self.project.getProjectName(), |
374 "no_attributes": self.noAttrs, |
375 "no_attributes": self.noAttrs, |
375 "file": ( |
376 "file": ( |
376 Utilities.fromNativeSeparators(self.__relFile) |
377 FileSystemUtilities.fromNativeSeparators(self.__relFile) |
377 if self.__relFile |
378 if self.__relFile |
378 else Utilities.fromNativeSeparators(self.file) |
379 else FileSystemUtilities.fromNativeSeparators(self.file) |
379 ), |
380 ), |
380 } |
381 } |
381 |
382 |
382 return data |
383 return data |
383 |
384 |
394 @rtype tuple of (bool, str) |
395 @rtype tuple of (bool, str) |
395 """ |
396 """ |
396 try: |
397 try: |
397 self.noAttrs = data["no_attributes"] |
398 self.noAttrs = data["no_attributes"] |
398 |
399 |
399 file = Utilities.toNativeSeparators(data["file"]) |
400 file = FileSystemUtilities.toNativeSeparators(data["file"]) |
400 if os.path.isabs(file): |
401 if os.path.isabs(file): |
401 self.file = file |
402 self.file = file |
402 self.__relFile = "" |
403 self.__relFile = "" |
403 else: |
404 else: |
404 # relative file paths indicate a project file |
405 # relative file paths indicate a project file |