src/eric7/QScintilla/EditorAssembly.py

Thu, 12 Jan 2023 10:57:50 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 12 Jan 2023 10:57:50 +0100
branch
eric7
changeset 9691
12b8fe65c28c
parent 9689
b18ad1f984b1
child 10180
3a595df36c9a
permissions
-rw-r--r--

Fixed an issue causing the editor navigation selectors to malfunction, when the editor was parsed while a popup was open.

1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
9653
e67609152c5e Updated copyright for 2023.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9567
diff changeset
3 # Copyright (c) 2011 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
7 Module implementing the editor assembly widget containing the navigation
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
8 combos and the editor widget.
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8220
diff changeset
11 import contextlib
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8220
diff changeset
12
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
13 from PyQt6.QtCore import QTimer
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
14 from PyQt6.QtWidgets import QComboBox, QGridLayout, QWidget
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
16 from eric7 import Preferences
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
17 from eric7.EricGui import EricPixmapCache
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
18 from eric7.EricWidgets.EricApplication import ericApp
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
19 from eric7.Utilities.ModuleParser import Function
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
20
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
21 from .Editor import Editor
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
22 from .EditorButtonsWidget import EditorButtonsWidget
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
23 from .EditorOutline import EditorOutlineView
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
24
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 class EditorAssembly(QWidget):
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
28 Class implementing the editor assembly widget containing the navigation
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
29 combos and the editor widget.
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
31
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
32 def __init__(self, dbs, fn="", vm=None, filetype="", editor=None, tv=None):
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 Constructor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
35
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 @param dbs reference to the debug server object
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
37 @type DebugServer
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
38 @param fn name of the file to be opened. If it is None,
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
39 a new (empty) editor is opened.
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
40 @type str
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
41 @param vm reference to the view manager object
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
42 @type ViewManager.ViewManager
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
43 @param filetype type of the source file
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
44 @type str
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 @param editor reference to an Editor object, if this is a cloned view
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
46 @type Editor
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 @param tv reference to the task viewer object
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
48 @type TaskViewer
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8132
diff changeset
50 super().__init__()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
51
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.__layout = QGridLayout(self)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.__layout.setContentsMargins(0, 0, 0, 0)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.__layout.setSpacing(1)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
55
9567
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
56 self.__showNavigator = Preferences.getEditor("ShowSourceNavigator")
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
57 self.__showOutline = Preferences.getEditor("ShowSourceOutline")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
58
8132
311afc776982 EditorAssembly: fixed an issue causing wrong horizontal scrollbar position when loading a file in the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8131
diff changeset
59 self.__editor = Editor(dbs, fn, vm, filetype, editor, tv)
5408
b67e07566aa1 Fix for the new editor button widget on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5394
diff changeset
60 self.__buttonsWidget = EditorButtonsWidget(self.__editor, self)
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.__globalsCombo = QComboBox()
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
62 self.__globalsCombo.setDuplicatesEnabled(True)
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.__membersCombo = QComboBox()
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
64 self.__membersCombo.setDuplicatesEnabled(True)
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
65 self.__sourceOutline = EditorOutlineView(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
66 self.__editor, populate=self.__showOutline
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
67 )
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
68 self.__sourceOutline.setMaximumWidth(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
69 Preferences.getEditor("SourceOutlineWidth")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
70 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
71
5394
b2c6179184f6 Started implementing a format button bar and provider classes for various markup languages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
72 self.__layout.addWidget(self.__buttonsWidget, 1, 0, -1, 1)
b2c6179184f6 Started implementing a format button bar and provider classes for various markup languages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
73 self.__layout.addWidget(self.__globalsCombo, 0, 1)
b2c6179184f6 Started implementing a format button bar and provider classes for various markup languages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
74 self.__layout.addWidget(self.__membersCombo, 0, 2)
7685
0b6e8c0d6403 Started implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
75 self.__layout.addWidget(self.__editor, 1, 1, 1, 2)
0b6e8c0d6403 Started implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
76 self.__layout.addWidget(self.__sourceOutline, 0, 3, -1, -1)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
77
7343
e0808393413f EditorAssembly: fixed an issue causing the assembly widget handling focus instead of the embedded editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7267
diff changeset
78 self.setFocusProxy(self.__editor)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
79
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.__module = None
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81
9687
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
82 self.__aboutToBeClosedCalled = False
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.__parseTimer = QTimer(self)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 self.__parseTimer.setSingleShot(True)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.__parseTimer.setInterval(5 * 1000)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.__editor.textChanged.connect(self.__resetParseTimer)
1807
9898a95461f1 Added a signal to the editor showing a refresh has happend and connected the editor assembly to it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1667
diff changeset
87 self.__editor.refreshed.connect(self.__resetParseTimer)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
89 self.__selectedGlobal = ""
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
90 self.__selectedMember = ""
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
91 self.__globalsBoundaries = {}
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
92 self.__membersBoundaries = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
93
9567
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
94 self.__activateOutline(self.__showNavigator and self.__showOutline)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
95 self.__activateCombos(self.__showNavigator and not self.__showOutline)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
96
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
97 ericApp().getObject("UserInterface").preferencesChanged.connect(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
98 self.__preferencesChanged
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
99 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
100
9687
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
101 def aboutToBeClosed(self):
1421
8fead6686d1c Fixed an issue related to the editor assembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1358
diff changeset
102 """
9687
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
103 Public method to stop and disconnect the timer and disconnect some signals.
1421
8fead6686d1c Fixed an issue related to the editor assembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1358
diff changeset
104 """
8fead6686d1c Fixed an issue related to the editor assembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1358
diff changeset
105 self.__parseTimer.stop()
9687
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
106 if not self.__aboutToBeClosedCalled:
6317
e9ec47d52ff2 EditorAssembly: added a guard against shutdownTimer() being called multiple times.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6297
diff changeset
107 self.__editor.textChanged.disconnect(self.__resetParseTimer)
e9ec47d52ff2 EditorAssembly: added a guard against shutdownTimer() being called multiple times.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6297
diff changeset
108 self.__editor.refreshed.disconnect(self.__resetParseTimer)
9689
b18ad1f984b1 Corrected change 3a240d3f3b8c.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9688
diff changeset
109 ericApp().getObject("UserInterface").preferencesChanged.disconnect(
b18ad1f984b1 Corrected change 3a240d3f3b8c.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9688
diff changeset
110 self.__preferencesChanged
b18ad1f984b1 Corrected change 3a240d3f3b8c.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9688
diff changeset
111 )
9687
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
112
3a240d3f3b8c Fixed an issue caused by a still existing signal slot connection in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
113 self.__aboutToBeClosedCalled = True
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
114
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 def getEditor(self):
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 Public method to get the reference to the editor widget.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
118
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
119 @return reference to the editor widget
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
120 @rtype Editor
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 return self.__editor
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
123
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
124 def __preferencesChanged(self):
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
125 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
126 Private slot handling a change of preferences.
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
127 """
9567
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
128 showNavigator = Preferences.getEditor("ShowSourceNavigator")
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
129 showOutline = Preferences.getEditor("ShowSourceOutline")
9567
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
130 if showOutline != self.__showOutline or showNavigator != self.__showNavigator:
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
131 self.__showOutline = showOutline
9567
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
132 self.__showNavigator = showNavigator
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
133 self.__activateOutline(self.__showNavigator and self.__showOutline)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9482
diff changeset
134 self.__activateCombos(self.__showNavigator and not self.__showOutline)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
135
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
136 #######################################################################
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
137 ## Methods dealing with the navigation combos below
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
138 #######################################################################
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
139
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
140 def __activateCombos(self, activate):
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
141 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
142 Private slot to activate the navigation combo boxes.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
144 @param activate flag indicating to activate the combo boxes
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
145 @type bool
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
146 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
147 self.__globalsCombo.setVisible(activate)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
148 self.__membersCombo.setVisible(activate)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
149 if activate:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 self.__globalsCombo.activated[int].connect(self.__globalsActivated)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 self.__membersCombo.activated[int].connect(self.__membersActivated)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 self.__editor.cursorLineChanged.connect(self.__editorCursorLineChanged)
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
153 self.__parseTimer.timeout.connect(self.__parseEditor)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
155 self.__parseEditor()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
157 line, _ = self.__editor.getCursorPosition()
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
158 self.__editorCursorLineChanged(line)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
159 else:
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8220
diff changeset
160 with contextlib.suppress(TypeError):
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
161 self.__globalsCombo.activated[int].disconnect(self.__globalsActivated)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
162 self.__membersCombo.activated[int].disconnect(self.__membersActivated)
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
163 self.__editor.cursorLineChanged.disconnect(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
164 self.__editorCursorLineChanged
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 )
9688
f3817c476a62 Corrected another glitch in EditorAssembly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9687
diff changeset
166 with contextlib.suppress(TypeError):
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
167 self.__parseTimer.timeout.disconnect(self.__parseEditor)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
169 self.__globalsCombo.clear()
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
170 self.__membersCombo.clear()
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
171 self.__globalsBoundaries = {}
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
172 self.__membersBoundaries = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
174 def __globalsActivated(self, index, moveCursor=True):
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 """
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
176 Private method to jump to the line of the selected global entry and to
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
177 populate the members combo box.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
178
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
179 @param index index of the selected entry
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
180 @type int
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
181 @param moveCursor flag indicating to move the editor cursor
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
182 @type bool
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 # step 1: go to the line of the selected entry
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 lineno = self.__globalsCombo.itemData(index)
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
186 if lineno is not None:
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
187 if moveCursor:
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
188 txt = self.__editor.text(lineno - 1).rstrip()
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
189 pos = len(txt.replace(txt.strip(), ""))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190 self.__editor.gotoLine(lineno, pos if pos == 0 else pos + 1, True)
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
191 self.__editor.setFocus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
192
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
193 # step 2: populate the members combo, if the entry is a class
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
194 self.__membersCombo.clear()
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
195 self.__membersBoundaries = {}
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
196 self.__membersCombo.addItem("")
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
197 memberIndex = 0
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
198 entryName = self.__globalsCombo.itemText(index)
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
199 if self.__module:
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
200 if entryName in self.__module.classes:
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
201 entry = self.__module.classes[entryName]
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
202 elif entryName in self.__module.modules:
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
203 entry = self.__module.modules[entryName]
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
204 # step 2.0: add module classes
8089
e43bf8d7baf9 EditorAssembly: fixed a few issues not detected by the earlier tests performed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8088
diff changeset
205 items = []
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
206 for cl in entry.classes.values():
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
207 if cl.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
208 icon = EricPixmapCache.getIcon("class_private")
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
209 elif cl.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
210 icon = EricPixmapCache.getIcon("class_protected")
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
211 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
212 icon = EricPixmapCache.getIcon("class")
8089
e43bf8d7baf9 EditorAssembly: fixed a few issues not detected by the earlier tests performed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8088
diff changeset
213 items.append((icon, cl.name, cl.lineno, cl.endlineno))
e43bf8d7baf9 EditorAssembly: fixed a few issues not detected by the earlier tests performed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8088
diff changeset
214 for itm in sorted(items, key=lambda x: (x[1], x[2])):
e43bf8d7baf9 EditorAssembly: fixed a few issues not detected by the earlier tests performed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8088
diff changeset
215 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
216 memberIndex += 1
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
217 self.__membersBoundaries[(itm[2], itm[3])] = memberIndex
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
218 else:
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
219 return
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
220
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
221 # step 2.1: add class methods
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
222 items = []
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
223 for meth in entry.methods.values():
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
224 if meth.modifier == Function.Static:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
225 icon = EricPixmapCache.getIcon("method_static")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
226 elif meth.modifier == Function.Class:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
227 icon = EricPixmapCache.getIcon("method_class")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
228 elif meth.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
229 icon = EricPixmapCache.getIcon("method_private")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
230 elif meth.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
231 icon = EricPixmapCache.getIcon("method_protected")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
232 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
233 icon = EricPixmapCache.getIcon("method")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 items.append((icon, meth.name, meth.lineno, meth.endlineno))
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
235 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
236 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
237 memberIndex += 1
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
238 self.__membersBoundaries[(itm[2], itm[3])] = memberIndex
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
239
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
240 # step 2.2: add class instance attributes
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
241 items = []
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
242 for attr in entry.attributes.values():
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
243 if attr.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
244 icon = EricPixmapCache.getIcon("attribute_private")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
245 elif attr.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
246 icon = EricPixmapCache.getIcon("attribute_protected")
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
247 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
248 icon = EricPixmapCache.getIcon("attribute")
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
249 items.append((icon, attr.name, attr.lineno))
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
250 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
251 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
252
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
253 # step 2.3: add class attributes
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
254 items = []
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
255 icon = EricPixmapCache.getIcon("attribute_class")
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
256 for globalVar in entry.globals.values():
8089
e43bf8d7baf9 EditorAssembly: fixed a few issues not detected by the earlier tests performed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8088
diff changeset
257 items.append((icon, globalVar.name, globalVar.lineno))
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
258 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
259 self.__membersCombo.addItem(itm[0], itm[1], itm[2])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
261 def __membersActivated(self, index, moveCursor=True):
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 Private method to jump to the line of the selected members entry.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
264
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
265 @param index index of the selected entry
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
266 @type int
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
267 @param moveCursor flag indicating to move the editor cursor
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
268 @type bool
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 lineno = self.__membersCombo.itemData(index)
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
271 if lineno is not None and moveCursor:
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
272 txt = self.__editor.text(lineno - 1).rstrip()
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
273 pos = len(txt.replace(txt.strip(), ""))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
274 self.__editor.gotoLine(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 lineno, pos if pos == 0 else pos + 1, firstVisible=True, expand=True
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
276 )
1439
953d3f95ee4d Fixed an issue in the editor assembly widget causing it to produce a trackeback.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1421
diff changeset
277 self.__editor.setFocus()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
278
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 def __resetParseTimer(self):
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 Private slot to reset the parse timer.
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 """
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.__parseTimer.stop()
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 self.__parseTimer.start()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
285
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 def __parseEditor(self):
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 """
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
288 Private method to parse the editor source and repopulate the globals
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
289 combo.
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 """
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
291 from eric7.Utilities.ModuleParser import Module, getTypeFromTypeName
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
292
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 self.__module = None
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 sourceType = getTypeFromTypeName(self.__editor.determineFileType())
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 if sourceType != -1:
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 src = self.__editor.text()
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 if src:
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 fn = self.__editor.getFileName()
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 if fn is None:
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 fn = ""
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.__module = Module("", fn, sourceType)
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 self.__module.scan(src)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
303
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
304 # remember the current selections
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
305 self.__selectedGlobal = self.__globalsCombo.currentText()
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
306 self.__selectedMember = self.__membersCombo.currentText()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
307
9691
12b8fe65c28c Fixed an issue causing the editor navigation selectors to malfunction, when the editor was parsed while a popup was open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9689
diff changeset
308 self.__globalsCombo.hidePopup()
12b8fe65c28c Fixed an issue causing the editor navigation selectors to malfunction, when the editor was parsed while a popup was open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9689
diff changeset
309 self.__membersCombo.hidePopup()
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 self.__globalsCombo.clear()
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 self.__membersCombo.clear()
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
312 self.__globalsBoundaries = {}
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
313 self.__membersBoundaries = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
314
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 self.__globalsCombo.addItem("")
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
316 index = 0
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
317
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
318 # step 1: add modules
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
319 items = []
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
320 for module in self.__module.modules.values():
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
321 items.append(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
322 (
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
323 EricPixmapCache.getIcon("module"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
324 module.name,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
325 module.lineno,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
326 module.endlineno,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
327 )
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
328 )
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
329 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
330 self.__globalsCombo.addItem(itm[0], itm[1], itm[2])
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
331 index += 1
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
332 self.__globalsBoundaries[(itm[2], itm[3])] = index
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
333
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
334 # step 2: add classes
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
335 items = []
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 for cl in self.__module.classes.values():
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 if cl.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
338 icon = EricPixmapCache.getIcon("class_private")
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 elif cl.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
340 icon = EricPixmapCache.getIcon("class_protected")
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
342 icon = EricPixmapCache.getIcon("class")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
343 items.append((icon, cl.name, cl.lineno, cl.endlineno))
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
344 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
345 self.__globalsCombo.addItem(itm[0], itm[1], itm[2])
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
346 index += 1
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
347 self.__globalsBoundaries[(itm[2], itm[3])] = index
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
348
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
349 # step 3: add functions
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
350 items = []
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 for func in self.__module.functions.values():
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 if func.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
353 icon = EricPixmapCache.getIcon("method_private")
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 elif func.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
355 icon = EricPixmapCache.getIcon("method_protected")
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
357 icon = EricPixmapCache.getIcon("method")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
358 items.append((icon, func.name, func.lineno, func.endlineno))
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
359 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
360 self.__globalsCombo.addItem(itm[0], itm[1], itm[2])
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
361 index += 1
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
362 self.__globalsBoundaries[(itm[2], itm[3])] = index
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
363
1609
b7717f065282 Added the forgotten code to handle Ruby modules to the EditorAssembly widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1567
diff changeset
364 # step 4: add attributes
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
365 items = []
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
366 for globalValue in self.__module.globals.values():
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
367 if globalValue.isPrivate():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
368 icon = EricPixmapCache.getIcon("attribute_private")
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
369 elif globalValue.isProtected():
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
370 icon = EricPixmapCache.getIcon("attribute_protected")
1358
c1622c708cd9 Added source navigation function for Python 2, Python 3 and Ruby sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 else:
9413
80c06d472826 Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
372 icon = EricPixmapCache.getIcon("attribute")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
373 items.append((icon, globalValue.name, globalValue.lineno))
8088
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
374 for itm in sorted(items, key=lambda x: (x[1], x[2])):
7c454b82b6ed EditorAssembly: changed code of the navigation selectors to allow duplicate entries (e.g. in case of conditionally defined functions).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
375 self.__globalsCombo.addItem(itm[0], itm[1], itm[2])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
376
3011
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
377 # reset the currently selected entries without moving the
18292228c724 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2768
diff changeset
378 # text cursor
1567
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
379 index = self.__globalsCombo.findText(self.__selectedGlobal)
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
380 if index != -1:
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
381 self.__globalsCombo.setCurrentIndex(index)
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
382 self.__globalsActivated(index, moveCursor=False)
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
383 index = self.__membersCombo.findText(self.__selectedMember)
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
384 if index != -1:
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
385 self.__membersCombo.setCurrentIndex(index)
d03369218b6d Fixed the editor combo box navigation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
386 self.__membersActivated(index, moveCursor=False)
7175
68f83a144355 EditorAssembly: fixed an issue causing the navigation combos not being populated for MicroPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
387 else:
9691
12b8fe65c28c Fixed an issue causing the editor navigation selectors to malfunction, when the editor was parsed while a popup was open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9689
diff changeset
388 self.__globalsCombo.hidePopup()
12b8fe65c28c Fixed an issue causing the editor navigation selectors to malfunction, when the editor was parsed while a popup was open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9689
diff changeset
389 self.__membersCombo.hidePopup()
7175
68f83a144355 EditorAssembly: fixed an issue causing the navigation combos not being populated for MicroPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
390 self.__globalsCombo.clear()
68f83a144355 EditorAssembly: fixed an issue causing the navigation combos not being populated for MicroPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
391 self.__membersCombo.clear()
68f83a144355 EditorAssembly: fixed an issue causing the navigation combos not being populated for MicroPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
392 self.__globalsBoundaries = {}
68f83a144355 EditorAssembly: fixed an issue causing the navigation combos not being populated for MicroPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
393 self.__membersBoundaries = {}
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
394
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
395 def __editorCursorLineChanged(self, lineno):
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
396 """
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
397 Private slot handling a line change of the cursor of the editor.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
398
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
399 @param lineno line number of the cursor
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
400 @type int
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
401 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
402 lineno += 1 # cursor position is zero based, code info one based
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
403
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
404 # step 1: search in the globals
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
405 indexFound = 0
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
406 for (lower, upper), index in self.__globalsBoundaries.items():
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
407 if upper == -1:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
408 upper = 1000000 # it is the last line
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
409 if lower <= lineno <= upper:
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
410 indexFound = index
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
411 break
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
412 self.__globalsCombo.setCurrentIndex(indexFound)
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
413 self.__globalsActivated(indexFound, moveCursor=False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
414
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
415 # step 2: search in members
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
416 indexFound = 0
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
417 for (lower, upper), index in self.__membersBoundaries.items():
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
418 if upper == -1:
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
419 upper = 1000000 # it is the last line
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
420 if lower <= lineno <= upper:
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
421 indexFound = index
2768
eab35f6e709f Added support to show the current class/method name in the combo boxes at the top of the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2409
diff changeset
422 break
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
423 self.__membersCombo.setCurrentIndex(indexFound)
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
424 self.__membersActivated(indexFound, moveCursor=False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
425
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
426 #######################################################################
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
427 ## Methods dealing with the source outline below
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
428 #######################################################################
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
429
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
430 def __activateOutline(self, activate):
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
431 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
432 Private slot to activate the source outline view.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
433
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
434 @param activate flag indicating to activate the source outline view
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
435 @type bool
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
436 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
437 self.__sourceOutline.setActive(activate)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
439 if activate:
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
440 self.__sourceOutline.setVisible(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
441 self.__sourceOutline.isSupportedLanguage(self.__editor.getLanguage())
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
442 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
443
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
444 self.__parseTimer.timeout.connect(self.__sourceOutline.repopulate)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
445 self.__editor.languageChanged.connect(self.__editorChanged)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
446 self.__editor.editorRenamed.connect(self.__editorChanged)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
447 else:
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
448 self.__sourceOutline.hide()
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
449
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8220
diff changeset
450 with contextlib.suppress(TypeError):
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
451 self.__parseTimer.timeout.disconnect(self.__sourceOutline.repopulate)
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
452 self.__editor.languageChanged.disconnect(self.__editorChanged)
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
453 self.__editor.editorRenamed.disconnect(self.__editorChanged)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
454
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
455 def __editorChanged(self):
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
456 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
457 Private slot handling changes of the editor language or file name.
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
458 """
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
459 supported = self.__sourceOutline.isSupportedLanguage(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
460 self.__editor.getLanguage()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
461 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
462
7690
a59680062837 Continued implementing the editor outline widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7685
diff changeset
463 self.__sourceOutline.setVisible(supported)
8220
006ee31b4835 Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
464
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
465
8220
006ee31b4835 Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
466 #
006ee31b4835 Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
467 # eflag: noqa = Y113

eric ide

mercurial