def getVarsInfo(self,vartype,res): if self.active or not self.running: return res ch=self.changed self.write('info {}'.format(vartype)) lines,ok=self.read() self.changed=ch if not ok: #print "Failed to evaluate {}".format(var) return res if type(lines) is list: lines='\n'.join(lines) lines=lines.split('\n') groups=[] for line in lines: if line: if line[0]!=' ': groups.append([]) groups[-1].append(line) for group in groups: all='\n'.join(group) import xparse #from xparse.xparse import Node cur=xparse.parse(all) if cur: res[cur.name]=cur
def getLocals(self): res={} if self.active or not self.running: return res ch=self.changed self.write('info locals') lines,ok=self.read() self.changed=ch if not ok: #print "Failed to evaluate {}".format(var) return res if type(lines) is list: lines='\n'.join(lines) #open("locals.txt","w").write(lines) lines=lines.split('\n') groups=[] for line in lines: if line[0]!=' ': groups.append([]) groups[-1].append(line) for group in groups: all='\n'.join(group) import xparse from xparse.xparse import Node cur=xparse.parse(all) if cur: res[cur.name]=cur return res
def evaluate(self,var): import xparse lines=self.printVar(var) if globals.dev: print "@@@\n{}\n@@@".format(lines) return xparse.parse(lines)
def evaluate(self,var): import xparse from xparse.xparse import Node lines=self.printVar(var) return xparse.parse(lines)