Skip to content

Commit

Permalink
[pyqgis-console] shows also derived class name in object browser widget
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Apr 22, 2013
1 parent 4696e01 commit 12a8390
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions python/console/console_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,14 +763,27 @@ def listObject(self, tab):
try:
reload(pyclbr)
dictObject = {}
superClassName = []
readModule = pyclbr.readmodule(module)
readModuleFunction = pyclbr.readmodule_ex(module)
for name, class_data in sorted(readModule.items(), key=lambda x:x[1].lineno):
if class_data.file == tabWidget.path:
for superClass in class_data.super:
if superClass == 'object':
continue
if isinstance(superClass, basestring):
superClassName.append(superClass)
else:
superClassName.append(superClass.name)
classItem = QTreeWidgetItem()
classItem.setText(0, name)
if superClassName:
for i in superClassName: super = i
classItem.setText(0, name + ' [' + super + ']')
classItem.setToolTip(0, name + ' [' + super + ']')
else:
classItem.setText(0, name)
classItem.setToolTip(0, name)
classItem.setText(1, str(class_data.lineno))
classItem.setToolTip(0, name)
classItem.setIcon(0, QgsApplication.getThemeIcon("console/iconClassTreeWidgetConsole.png"))
dictObject[name] = class_data.lineno
for meth, lineno in sorted(class_data.methods.items(), key=itemgetter(1)):
Expand Down

0 comments on commit 12a8390

Please sign in to comment.