src/eric7/DebugClients/Python/DebugClientBase.py

branch
eric7
changeset 9397
a415cb83dafb
parent 9396
06699e5600a3
child 9401
38514063ecee
equal deleted inserted replaced
9396:06699e5600a3 9397:a415cb83dafb
1375 while f is not None and frmnr > 0: 1375 while f is not None and frmnr > 0:
1376 f = f.f_back 1376 f = f.f_back
1377 frmnr -= 1 1377 frmnr -= 1
1378 1378
1379 if f is None: 1379 if f is None:
1380 if scope: 1380 if scope == 1:
1381 varDict = self.debugMod.__dict__ 1381 varDict = self.debugMod.__dict__
1382 else: 1382 else:
1383 scope = -2 1383 scope = -2
1384 elif scope: 1384 elif scope == 1:
1385 varDict = f.f_globals 1385 varDict = f.f_globals
1386 elif f.f_globals is f.f_locals: 1386 elif f.f_globals is f.f_locals:
1387 scope = -1 1387 scope = -1
1388 else: 1388 else:
1389 varDict = f.f_locals 1389 varDict = f.f_locals
1427 while f is not None and frmnr > 0: 1427 while f is not None and frmnr > 0:
1428 f = f.f_back 1428 f = f.f_back
1429 frmnr -= 1 1429 frmnr -= 1
1430 1430
1431 if f is None: 1431 if f is None:
1432 if scope: 1432 if scope == 1:
1433 varDict = self.debugMod.__dict__ 1433 varDict = self.debugMod.__dict__
1434 else: 1434 else:
1435 scope = -1 1435 scope = -1
1436 elif scope: 1436 elif scope == 1:
1437 varDict = f.f_globals 1437 varDict = f.f_globals
1438 elif f.f_globals is f.f_locals: 1438 elif f.f_globals is f.f_locals:
1439 scope = -1 1439 scope = -1
1440 else: 1440 else:
1441 varDict = f.f_locals 1441 varDict = f.f_locals
1446 if scope != -1 and str(var) in self.resolverCache[scope]: 1446 if scope != -1 and str(var) in self.resolverCache[scope]:
1447 varGen = self.resolverCache[scope][str(var)] 1447 varGen = self.resolverCache[scope][str(var)]
1448 idx, varDict = next(varGen) 1448 idx, varDict = next(varGen)
1449 if idx != -2: # more elements available 1449 if idx != -2: # more elements available
1450 var.insert(0, idx) 1450 var.insert(0, idx)
1451 varlist = self.__formatVariablesList(varDict, scope, filterList, var) 1451 varlist = self.__formatVariablesList(varDict, scope, filterList, var[1:])
1452 elif scope != -1: 1452 elif scope != -1:
1453 variable = varDict 1453 variable = varDict
1454 # Lookup the wanted attribute 1454 # Lookup the wanted attribute
1455 for attribute in var: 1455 for attribute in var:
1456 resolver = DebugVariables.getResolver(variable) 1456 resolver = DebugVariables.getResolver(variable)
1500 1500
1501 @param variables variables list to be processed 1501 @param variables variables list to be processed
1502 @type list of tuple of (str, Any) or (str, str, Any) 1502 @type list of tuple of (str, Any) or (str, str, Any)
1503 @param scope 1 to filter using the globals filter, 0 using the locals 1503 @param scope 1 to filter using the globals filter, 0 using the locals
1504 filter. 1504 filter.
1505 Variables are only added to the list, if their name do not match 1505 Variables are only added to the list, if their access path does not match
1506 any of the filter expressions. 1506 any of the filter expressions and the 'show/no show' indication.
1507 @type int 1507 @type int
1508 @param filterList list of variable types to be filtered. 1508 @param filterList list of variable types to be filtered.
1509 Variables are only added to the list, if their type is not 1509 Variables are only added to the list, if their type is not
1510 contained in the filter list. (defaults to None) 1510 contained in the filter list. (defaults to None)
1511 @type list of str (optional) 1511 @type list of str (optional)
1512 @param var list encoded name of the requested variable (defaults to None) 1512 @param var list encoded name of the requested variable (access path) (defaults
1513 to None)
1513 @type list of str and int (optional) 1514 @type list of str and int (optional)
1514 @return A tuple consisting of a list of formatted variables. Each 1515 @return A tuple consisting of a list of formatted variables. Each
1515 variable entry is a tuple of three elements, the variable name, 1516 variable entry is a tuple of three elements, the variable name,
1516 its type and value. 1517 its type and value.
1517 @rtype list of tuple of (str, str, str) 1518 @rtype list of tuple of (str, str, str)
1666 showFlag = False 1667 showFlag = False
1667 filterString = filterString[1:].strip() 1668 filterString = filterString[1:].strip()
1668 else: 1669 else:
1669 showFlag = True 1670 showFlag = True
1670 if filterString: 1671 if filterString:
1671 pattern = filterString.replace(";", "|") 1672 filterList = filterString.split(";")
1673 pattern="|".join(f.strip() for f in filterList)
1672 with contextlib.suppress(re.error): 1674 with contextlib.suppress(re.error):
1673 patternFilterObjects = re.compile(pattern) 1675 patternFilterObjects = re.compile(pattern)
1674 else: 1676 else:
1675 showFlag = False 1677 showFlag = False
1676 1678

eric ide

mercurial