def __init__(self, pid): self.pid = int(pid) Node.__init__(self, self.pid) proc_exists(self.pid) self.file = '/proc/%s/stat' % self.pid self.ppid = int(self.status()[PPID])
def make_tree(tupletree): n = Node(tupletree[0]) for child in tupletree[1]: n.append(make_tree(child)) return n