Improve :debug-all-objects output.
This commit is contained in:
parent
1239efa615
commit
6b459f43f1
@ -470,7 +470,8 @@ class Application(QApplication):
|
|||||||
lines = []
|
lines = []
|
||||||
for name, registry in objreg.meta_registry.items():
|
for name, registry in objreg.meta_registry.items():
|
||||||
blocks.append((name, registry.dump_objects()))
|
blocks.append((name, registry.dump_objects()))
|
||||||
for name, data in blocks:
|
for name, data in sorted(blocks, key=lambda e: e[0]):
|
||||||
|
lines.append("")
|
||||||
lines.append("{} object registry - {} objects:".format(
|
lines.append("{} object registry - {} objects:".format(
|
||||||
name, len(data)))
|
name, len(data)))
|
||||||
for line in data:
|
for line in data:
|
||||||
@ -480,8 +481,11 @@ class Application(QApplication):
|
|||||||
def get_all_objects(self):
|
def get_all_objects(self):
|
||||||
"""Get all children of an object recursively as a string."""
|
"""Get all children of an object recursively as a string."""
|
||||||
output = ['']
|
output = ['']
|
||||||
output += self._get_registered_objects()
|
widget_lines = self._get_widgets()
|
||||||
output += ['']
|
widget_lines = [' ' + e for e in widget_lines]
|
||||||
|
widget_lines.insert(0, "Qt widgets - {} objects".format(
|
||||||
|
len(widget_lines)))
|
||||||
|
output += widget_lines
|
||||||
pyqt_lines = []
|
pyqt_lines = []
|
||||||
self._get_pyqt_objects(pyqt_lines, self)
|
self._get_pyqt_objects(pyqt_lines, self)
|
||||||
pyqt_lines = [' ' + e for e in pyqt_lines]
|
pyqt_lines = [' ' + e for e in pyqt_lines]
|
||||||
@ -489,11 +493,7 @@ class Application(QApplication):
|
|||||||
len(pyqt_lines)))
|
len(pyqt_lines)))
|
||||||
output += pyqt_lines
|
output += pyqt_lines
|
||||||
output += ['']
|
output += ['']
|
||||||
widget_lines = self._get_widgets()
|
output += self._get_registered_objects()
|
||||||
widget_lines = [' ' + e for e in widget_lines]
|
|
||||||
widget_lines.insert(0, "Qt widgets - {} objects".format(
|
|
||||||
len(widget_lines)))
|
|
||||||
output += widget_lines
|
|
||||||
return '\n'.join(output)
|
return '\n'.join(output)
|
||||||
|
|
||||||
def _recover_pages(self):
|
def _recover_pages(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user