MCPcopy Index your code
hub / github.com/bugy/script-server / stop

Method stop

src/execution/process_base.py:72–91  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 self.output_stream.push(text)
71
72 def stop(self):
73 if not self.is_finished():
74 if not os_utils.is_win():
75 group_id = os.getpgid(self.get_process_id())
76 os.killpg(group_id, signal.SIGTERM)
77
78 class KillChildren(object):
79 def finished(self):
80 try:
81 os.killpg(group_id, signal.SIGKILL)
82 except ProcessLookupError:
83 # probably there are no children left
84 pass
85
86 self.add_finish_listener(KillChildren())
87
88 else:
89 self.process.terminate()
90
91 self._write_script_output('\n>> STOPPED BY USER\n')
92
93 def kill(self):
94 if not self.is_finished():

Callers

nothing calls this directly

Calls 5

is_finishedMethod · 0.95
get_process_idMethod · 0.95
add_finish_listenerMethod · 0.95
_write_script_outputMethod · 0.95
KillChildrenClass · 0.85

Tested by

no test coverage detected