34 """ |
34 """ |
35 super(EditorOutlineModel, self).__init__(nopopulate=True) |
35 super(EditorOutlineModel, self).__init__(nopopulate=True) |
36 |
36 |
37 self.__editor = editor |
37 self.__editor = editor |
38 |
38 |
39 self.__filename = self.__editor.getFileName() |
|
40 self.__module = os.path.basename(self.__filename) |
|
41 |
|
42 self.__populated = False |
39 self.__populated = False |
43 |
40 |
44 rootData = QCoreApplication.translate("EditorOutlineModel", "Name") |
41 rootData = QCoreApplication.translate("EditorOutlineModel", "Name") |
45 self.rootItem = BrowserItem(None, rootData) |
42 self.rootItem = BrowserItem(None, rootData) |
46 |
43 |
51 Private slot to populate the model. |
48 Private slot to populate the model. |
52 |
49 |
53 @param repopulate flag indicating a repopulation |
50 @param repopulate flag indicating a repopulation |
54 @type bool |
51 @type bool |
55 """ |
52 """ |
|
53 self.__filename = self.__editor.getFileName() |
|
54 self.__module = os.path.basename(self.__filename) |
|
55 |
56 language = self.__editor.getLanguage() |
56 language = self.__editor.getLanguage() |
57 if language in EditorOutlineModel.SupportedLanguages: |
57 if language in EditorOutlineModel.SupportedLanguages: |
58 if language in ("Python3", "MicroPython"): |
58 if language in ("Python3", "MicroPython"): |
59 from Utilities.ClassBrowsers import pyclbr |
59 from Utilities.ClassBrowsers import pyclbr |
60 dictionary = pyclbr.scan(self.__editor.text(), self.__filename, |
60 dictionary = pyclbr.scan(self.__editor.text(), self.__filename, |