From 495c08a3eb018e9c2bb6bec4a8d128861b299973 Mon Sep 17 00:00:00 2001 From: Jeremy Ephron Date: Wed, 9 Sep 2020 18:31:50 -0700 Subject: [PATCH] Debugger: Don't hardcode dumper module names Changed the dumpermodules list to be dynamically retrieved as all types.py files instead of a hardcoded list. I don't know of any reason it should be a hardcoded list, and this allows for more than one custom extra dumper file instead of having to specify one extra one and/or use personaltypes.py. It seems strictly better. The code used is confirmed to be compatible with all versions of Python. Change-Id: Ic1988961d5cb7e6523e84afdd0e6c4ed2993ac97 Reviewed-by: Christian Stenger Reviewed-by: hjk --- share/qtcreator/debugger/dumper.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 3cca1f1f560..13a0986268b 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -26,6 +26,7 @@ import os import codecs import collections +import glob import struct import sys import base64 @@ -207,13 +208,8 @@ class DumperBase(): self.childrenSuffix = '],' self.dumpermodules = [ - 'qttypes', - 'stdtypes', - 'misctypes', - 'boosttypes', - 'opencvtypes', - 'creatortypes', - 'personaltypes', + os.path.splitext(os.path.basename(p))[0] for p in + glob.glob(os.path.join(os.path.dirname(__file__), '*types.py')) ] # These values are never used, but the variables need to have