def ps(self):
<EOL>pid = self.get()<EOL>parent   = None<EOL>children = []<EOL>if pid:<EOL><INDENT>proc   = Popen(['<STR_LIT>', '<STR_LIT>'], stdout=PIPE)<EOL>for _line in proc.stdout.readlines():<EOL><INDENT>line = self.unicode(_line.rstrip())<EOL>this_pid, this_parent = self._ps_extract_pid(line)<EOL>try:<EOL><INDENT>if int(pid) == int(this_parent):<EOL><INDENT>children.append('<STR_LIT>'.format(this_pid.rstrip(), re.sub('<STR_LIT>', '<STR_LIT:U+0020>', line)))<EOL><DEDENT>if int(pid) == int(this_pid):<EOL><INDENT>parent = re.sub('<STR_LIT>', '<STR_LIT:U+0020>', line)<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>return (parent, children)<EOL>
Get the process information from the system PS command.