1331 else: |
1335 else: |
1332 oaccess = '' |
1336 oaccess = '' |
1333 try: |
1337 try: |
1334 exec 'mdict = dict%s.__dict__' % access |
1338 exec 'mdict = dict%s.__dict__' % access |
1335 ndict.update(mdict) # __IGNORE_WARNING__ |
1339 ndict.update(mdict) # __IGNORE_WARNING__ |
|
1340 exec 'obj = dict%s' % access |
|
1341 if "PyQt4." in str(type(obj)): |
|
1342 qtVariable = True |
|
1343 qvar = obj |
|
1344 qvtype = ("%s" % type(qvar))[1:-1].split()[1][1:-1] |
1336 except: |
1345 except: |
1337 pass |
1346 pass |
1338 try: |
1347 try: |
1339 exec 'mcdict = dict%s.__class__.__dict__' % access |
1348 exec 'mcdict = dict%s.__class__.__dict__' % access |
1340 ndict.update(mcdict) # __IGNORE_WARNING__ |
1349 ndict.update(mcdict) # __IGNORE_WARNING__ |
1341 exec 'obj = dict%s' % access |
|
1342 if mdict and not "sipThis" in mdict.keys(): # __IGNORE_WARNING__ |
1350 if mdict and not "sipThis" in mdict.keys(): # __IGNORE_WARNING__ |
1343 del rvar[0:2] |
1351 del rvar[0:2] |
1344 access = "" |
1352 access = "" |
1345 except: |
1353 except: |
1346 pass |
1354 pass |
1353 except: |
1361 except: |
1354 pass |
1362 pass |
1355 ndict.update(cdict) |
1363 ndict.update(cdict) |
1356 exec 'obj = dict%s' % access |
1364 exec 'obj = dict%s' % access |
1357 access = "" |
1365 access = "" |
|
1366 if "PyQt4." in str(type(obj)): |
|
1367 qtVariable = True |
|
1368 qvar = obj |
|
1369 qvtype = ("%s" % type(qvar))[1:-1].split()[1][1:-1] |
1358 except: |
1370 except: |
1359 pass |
1371 pass |
1360 else: |
1372 else: |
1361 try: |
1373 try: |
1362 ndict.update(dict[var[i]].__dict__) |
1374 ndict.update(dict[var[i]].__dict__) |
1363 ndict.update(dict[var[i]].__class__.__dict__) |
1375 ndict.update(dict[var[i]].__class__.__dict__) |
1364 del rvar[0] |
1376 del rvar[0] |
1365 obj = dict[var[i]] |
1377 obj = dict[var[i]] |
|
1378 if "PyQt4." in str(type(obj)): |
|
1379 qtVariable = True |
|
1380 qvar = obj |
|
1381 qvtype = ("%s" % type(qvar))[1:-1].split()[1][1:-1] |
1366 except: |
1382 except: |
1367 pass |
1383 pass |
1368 try: |
1384 try: |
1369 cdict = {} |
1385 cdict = {} |
1370 slv = dict[var[i]].__slots__ |
1386 slv = dict[var[i]].__slots__ |
1373 exec 'cdict[v] = dict[var[i]].%s' % v |
1389 exec 'cdict[v] = dict[var[i]].%s' % v |
1374 except: |
1390 except: |
1375 pass |
1391 pass |
1376 ndict.update(cdict) |
1392 ndict.update(cdict) |
1377 obj = dict[var[i]] |
1393 obj = dict[var[i]] |
|
1394 if "PyQt4." in str(type(obj)): |
|
1395 qtVariable = True |
|
1396 qvar = obj |
|
1397 qvtype = ("%s" % type(qvar))[1:-1].split()[1][1:-1] |
1378 except: |
1398 except: |
1379 pass |
1399 pass |
1380 odict = dict |
1400 odict = dict |
1381 dict = ndict |
1401 dict = ndict |
1382 i += 1 |
1402 i += 1 |
1383 |
1403 |
1384 if ("sipThis" in dict.keys() and len(dict) == 1) or \ |
1404 if qtVariable: |
|
1405 vlist = self.__formatQt4Variable(qvar, qvtype) |
|
1406 elif ("sipThis" in dict.keys() and len(dict) == 1) or \ |
1385 (len(dict) == 0 and len(udict) > 0): |
1407 (len(dict) == 0 and len(udict) > 0): |
1386 if access: |
1408 if access: |
1387 exec 'qvar = udict%s' % access |
1409 exec 'qvar = udict%s' % access |
1388 # this has to be in line with VariablesViewer.indicators |
1410 # this has to be in line with VariablesViewer.indicators |
1389 elif rvar and rvar[0][-2:] in ["[]", "()", "{}"]: |
1411 elif rvar and rvar[0][-2:] in ["[]", "()", "{}"]: |
1452 qttype = vtype.split('.')[-1] |
1474 qttype = vtype.split('.')[-1] |
1453 varlist = [] |
1475 varlist = [] |
1454 if qttype == 'QChar': |
1476 if qttype == 'QChar': |
1455 varlist.append(("", "QChar", "%s" % unichr(value.unicode()))) |
1477 varlist.append(("", "QChar", "%s" % unichr(value.unicode()))) |
1456 varlist.append(("", "int", "%d" % value.unicode())) |
1478 varlist.append(("", "int", "%d" % value.unicode())) |
|
1479 elif qttype == 'QByteArray': |
|
1480 varlist.append(("hex", "QByteArray", "%s" % value.toHex())) |
|
1481 varlist.append(("base64", "QByteArray", "%s" % value.toBase64())) |
|
1482 varlist.append(("percent encoding", "QByteArray", |
|
1483 "%s" % value.toPercentEncoding())) |
|
1484 elif qttype == 'QString': |
|
1485 varlist.append(("", "QString", "%s" % value)) |
|
1486 elif qttype == 'QStringList': |
|
1487 for i in range(value.count()): |
|
1488 varlist.append(("%d" % i, "QString", "%s" % value[i])) |
1457 elif qttype == 'QPoint': |
1489 elif qttype == 'QPoint': |
1458 varlist.append(("x", "int", "%d" % value.x())) |
1490 varlist.append(("x", "int", "%d" % value.x())) |
1459 varlist.append(("y", "int", "%d" % value.y())) |
1491 varlist.append(("y", "int", "%d" % value.y())) |
1460 elif qttype == 'QPointF': |
1492 elif qttype == 'QPointF': |
1461 varlist.append(("x", "float", "%g" % value.x())) |
1493 varlist.append(("x", "float", "%g" % value.x())) |
1622 if valtype == "classobj": |
1654 if valtype == "classobj": |
1623 if ConfigVarTypeStrings.index('instance') in filter: |
1655 if ConfigVarTypeStrings.index('instance') in filter: |
1624 continue |
1656 continue |
1625 elif valtype == "sip.methoddescriptor": |
1657 elif valtype == "sip.methoddescriptor": |
1626 if ConfigVarTypeStrings.index('instance method') in filter: |
1658 if ConfigVarTypeStrings.index('instance method') in filter: |
|
1659 continue |
|
1660 elif valtype == "sip.enumtype": |
|
1661 if ConfigVarTypeStrings.index('class') in filter: |
1627 continue |
1662 continue |
1628 elif not valtype.startswith("PySide") and \ |
1663 elif not valtype.startswith("PySide") and \ |
1629 ConfigVarTypeStrings.index('other') in filter: |
1664 ConfigVarTypeStrings.index('other') in filter: |
1630 continue |
1665 continue |
1631 |
1666 |