Skip to content

Commit

Permalink
Ctrl-Shift-J lists objects and the memory they take—for diagnostics.
Browse files Browse the repository at this point in the history
  • Loading branch information
psb1558 committed May 30, 2023
1 parent f51e8b8 commit 859beb0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ygt/ygHintEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3206,6 +3206,24 @@ def keyPressEvent(self, event) -> None:
self.yg_glyph_scene.delete_selected_hints()
elif event.key() == Qt.Key.Key_Plus:
self.yg_glyph_scene.add_to_set()
elif event.key() == Qt.Key.Key_J:
with_ctrl = (
QApplication.keyboardModifiers() & Qt.KeyboardModifier.ControlModifier
) == Qt.KeyboardModifier.ControlModifier
with_shift = (
QApplication.keyboardModifiers() & Qt.KeyboardModifier.ShiftModifier
) == Qt.KeyboardModifier.ShiftModifier
if with_ctrl and with_shift:
print("========= locals() =========")
g = locals()
gg = g.keys()
for ggg in gg:
print(str(ggg)+ ": " + str(sys.getsizeof(g[ggg])))
print("========= globals() =========")
g = globals()
gg = g.keys()
for ggg in gg:
print(str(ggg)+ ": " + str(sys.getsizeof(g[ggg])))
elif event.key() == Qt.Key.Key_Minus:
self.yg_glyph_scene.delete_from_set()
elif event.key() == 32 and not event.isAutoRepeat():
Expand Down

0 comments on commit 859beb0

Please sign in to comment.