Beispiel #1
0
    def _send_process_event(self, py_db, start_method):
        if len(sys.argv) > 0:
            name = sys.argv[0]
        else:
            name = ''

        if isinstance(name, bytes):
            name = name.decode(file_system_encoding, 'replace')
            name = name.encode('utf-8')

        body = ProcessEventBody(
            name=name,
            systemProcessId=os.getpid(),
            isLocalProcess=True,
            startMethod=start_method,
        )
        event = ProcessEvent(body)
        py_db.writer.add_command(
            NetCommand(CMD_PROCESS_EVENT, 0, event, is_json=True))