eric6/Debugger/VariablesViewer.py

branch
Variables Viewer
changeset 6978
720247f98e1f
parent 6969
fd7af2312383
child 6979
c272ec33ea11
equal deleted inserted replaced
6972:bb4d5692f966 6978:720247f98e1f
129 @type str 129 @type str
130 """ 130 """
131 # Python class? 131 # Python class?
132 if dtype.startswith('class '): 132 if dtype.startswith('class '):
133 dtype = dtype[7:-1] 133 dtype = dtype[7:-1]
134 self.hasChilds = True 134 if dtype not in ('method_descriptor', 'wrapper_descriptor'):
135 elif dtype == 'classobj': 135 self.hasChilds = True
136 dtype = 'instance'
137 # Qt related stuff? 136 # Qt related stuff?
138 elif (dtype.startswith(ConfigQtNames) and 137 elif (dtype.startswith(ConfigQtNames) and
139 dtype.endswith(ConfigKnownQtTypes)): 138 dtype.endswith(ConfigKnownQtTypes)):
140 self.hasChilds = True 139 self.hasChilds = True
140
141 elif dtype in ('instance', 'class'):
142 self.hasChilds = True
141 143
142 vtype = ConfigVarTypeDispStrings.get(dtype, dtype) 144 vtype = ConfigVarTypeDispStrings.get(dtype, dtype)
145 # Unkown types should be expandable by default
146 if (vtype is dtype and
147 dtype not in ('method_descriptor', 'wrapper_descriptor')):
148 self.hasChilds = True
143 self.type = QCoreApplication.translate("VariablesViewer", vtype) 149 self.type = QCoreApplication.translate("VariablesViewer", vtype)
144 150
145 def __getValue(self, dtype, dvalue): 151 def __getValue(self, dtype, dvalue):
146 """ 152 """
147 Private method to process the variables value. 153 Private method to process the variables value.
181 except Exception: 187 except Exception:
182 pass 188 pass
183 try: 189 try:
184 dvalue = str(dvalue) 190 dvalue = str(dvalue)
185 except UnicodeDecodeError: # Never reached under Python 3 191 except UnicodeDecodeError: # Never reached under Python 3
186 dvalue = unicode(dvalue, 'utf-8') 192 dvalue = unicode(dvalue, 'utf-8') # __IGNORE_WARNING__
187 193
188 self.value = dvalue 194 self.value = dvalue
189 195
190 if len(dvalue) > 2048: # 2 kB 196 if len(dvalue) > 2048: # 2 kB
191 self.tooltip = dvalue[:2048] 197 self.tooltip = dvalue[:2048]

eric ide

mercurial