def info(self):
        info = {'state': 'unknown',
                'PID': None,
                'LastExitStatus': None}
        launchctl_cmd = ['/bin/launchctl', 'list']
        proc = subprocess.Popen(launchctl_cmd, shell=False, bufsize=-1,
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE)
        output = proc.communicate()[0]
        if proc.returncode or not output:
            return info
        else:
            lines = str(output).splitlines()
            # search launchctl list output for our job label
            job_lines = [item for item in lines
                         if item.endswith('\t' + self.label)]
            if len(job_lines) != 1:
                # unexpected number of lines matched our label
                return info
            job_info = job_lines[0].split('\t')
            if len(job_info) != 3:
                # unexpected number of fields in the line
                return info
            if job_info[0] == '-':
                info['PID'] = None
                info['state'] = 'stopped'
            else:
                info['PID'] = int(job_info[0])
                info['state'] = 'running'
            if job_info[1] == '-':
                info['LastExitStatus'] = None
            else:
                info['LastExitStatus'] = int(job_info[1])
            return info
Called by Twisted when the cftp client prints data to stderr.
dataset/ETHPy150Open munki/munki/code/client/munkilib/launchd.py/Job.info--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/test/test_cftp.py/SFTPTestProcess.errReceived