DebugClients/Python/DebugClientBase.py

changeset 1470
65af67c5b5c3
parent 1305
14d63fe71d53
child 1499
b4d0457afb15
equal deleted inserted replaced
1469:0619b0cf6ecb 1470:65af67c5b5c3
1386 if qvtype.startswith("PyQt4"): 1386 if qvtype.startswith("PyQt4"):
1387 vlist = self.__formatQt4Variable(qvar, qvtype) 1387 vlist = self.__formatQt4Variable(qvar, qvtype)
1388 else: 1388 else:
1389 vlist = [] 1389 vlist = []
1390 else: 1390 else:
1391 # format the dictionary found 1391 qtVariable = False
1392 if dictkeys is None: 1392 if len(udict) > 0:
1393 dictkeys = dict.keys() 1393 if access:
1394 exec 'qvar = udict%s' % access
1395 # this has to be in line with VariablesViewer.indicators
1396 elif rvar and rvar[0][-2:] in ["[]", "()", "{}"]:
1397 exec 'qvar = udict["%s"][%s]' % (rvar[0][:-2], rvar[1])
1398 else:
1399 qvar = udict[var[-1]]
1400 qvtype = ("%s" % type(qvar))[1:-1].split()[1][1:-1]
1401 if qvtype.startswith("PyQt4"):
1402 qtVariable = True
1403
1404 if qtVariable:
1405 vlist = self.__formatQt4Variable(qvar, qvtype)
1394 else: 1406 else:
1395 # treatment for sequences and dictionaries 1407 # format the dictionary found
1396 if access: 1408 if dictkeys is None:
1397 exec "dict = dict%s" % access
1398 else:
1399 dict = dict[dictkeys[0]]
1400 if isDict:
1401 dictkeys = dict.keys() 1409 dictkeys = dict.keys()
1402 else: 1410 else:
1403 dictkeys = range(len(dict)) 1411 # treatment for sequences and dictionaries
1404 vlist = self.__formatVariablesList(dictkeys, dict, scope, filter, 1412 if access:
1405 formatSequences) 1413 exec "dict = dict%s" % access
1414 else:
1415 dict = dict[dictkeys[0]]
1416 if isDict:
1417 dictkeys = dict.keys()
1418 else:
1419 dictkeys = range(len(dict))
1420 vlist = self.__formatVariablesList(dictkeys, dict, scope, filter,
1421 formatSequences)
1406 varlist.extend(vlist) 1422 varlist.extend(vlist)
1407 1423
1408 if obj is not None and not formatSequences: 1424 if obj is not None and not formatSequences:
1409 if unicode(repr(obj)).startswith('{'): 1425 if unicode(repr(obj)).startswith('{'):
1410 varlist.append(('...', 'dict', "%d" % len(obj.keys()))) 1426 varlist.append(('...', 'dict', "%d" % len(obj.keys())))
1596 continue 1612 continue
1597 except ValueError: 1613 except ValueError:
1598 if valtype == "classobj": 1614 if valtype == "classobj":
1599 if ConfigVarTypeStrings.index('instance') in filter: 1615 if ConfigVarTypeStrings.index('instance') in filter:
1600 continue 1616 continue
1601 elif ConfigVarTypeStrings.index('other') in filter: 1617 elif valtype == "sip.methoddescriptor":
1618 if ConfigVarTypeStrings.index('instance method') in filter:
1619 continue
1620 elif not valtype.startswith("PySide") and \
1621 ConfigVarTypeStrings.index('other') in filter:
1602 continue 1622 continue
1603 1623
1604 try: 1624 try:
1605 if valtype not in ['list', 'tuple', 'dict']: 1625 if valtype not in ['list', 'tuple', 'dict']:
1606 rvalue = repr(value) 1626 rvalue = repr(value)

eric ide

mercurial