Debugger: Don't hardcode dumper module names

Changed the dumpermodules list to be dynamically retrieved as all
<module_name>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 <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jeremy Ephron
2020-09-09 18:31:50 -07:00
committed by Jeremy Barenholtz
parent b9445d5627
commit 495c08a3eb

View File

@@ -26,6 +26,7 @@
import os import os
import codecs import codecs
import collections import collections
import glob
import struct import struct
import sys import sys
import base64 import base64
@@ -207,13 +208,8 @@ class DumperBase():
self.childrenSuffix = '],' self.childrenSuffix = '],'
self.dumpermodules = [ self.dumpermodules = [
'qttypes', os.path.splitext(os.path.basename(p))[0] for p in
'stdtypes', glob.glob(os.path.join(os.path.dirname(__file__), '*types.py'))
'misctypes',
'boosttypes',
'opencvtypes',
'creatortypes',
'personaltypes',
] ]
# These values are never used, but the variables need to have # These values are never used, but the variables need to have