eric6/Graphics/ImportsDiagramBuilder.py

changeset 8291
3d79b1e5bf3c
parent 8287
30eb7bc13d63
child 8295
3f5e8b0a338e
equal deleted inserted replaced
8290:6970128e3d71 8291:3d79b1e5bf3c
48 super().__init__(dialog, view, project) 48 super().__init__(dialog, view, project)
49 self.setObjectName("ImportsDiagram") 49 self.setObjectName("ImportsDiagram")
50 50
51 self.showExternalImports = showExternalImports 51 self.showExternalImports = showExternalImports
52 self.packagePath = os.path.abspath(package) 52 self.packagePath = os.path.abspath(package)
53
54 self.__relPackagePath = (
55 self.project.getRelativePath(self.packagePath)
56 if self.project.isProjectSource(self.packagePath) else
57 ""
58 )
53 59
54 def initialize(self): 60 def initialize(self):
55 """ 61 """
56 Public method to initialize the object. 62 Public method to initialize the object.
57 """ 63 """
356 parts[1].split("=", 1)[1].strip()) 362 parts[1].split("=", 1)[1].strip())
357 363
358 self.initialize() 364 self.initialize()
359 365
360 return True 366 return True
367
368 def toDict(self):
369 """
370 Public method to collect data to be persisted.
371
372 @return dictionary containing data to be persisted
373 @rtype dict
374 """
375 data = {
376 "project_name": self.project.getProjectName(),
377 "show_external": self.showExternalImports,
378 }
379
380 data["package"] = (
381 Utilities.fromNativeSeparators(self.__relPackagePath)
382 if self.__relPackagePath else
383 Utilities.fromNativeSeparators(self.packagePath)
384 )
385
386 return data

eric ide

mercurial