MCPcopy Create free account
hub / github.com/AshampooSystems/boden / initServerProc

Function initServerProc

bauer/cmakelib.py:180–207  ·  view source on GitHub ↗
(cmakeCommand, comm, extraEnv = {})

Source from the content-addressed store, hash-verified

178 pipe.flush()
179
180def initServerProc(cmakeCommand, comm, extraEnv = {}):
181
182 environment = os.environ
183 environment.update(extraEnv)
184
185 if comm == PIPE:
186 pipeName = getPipeName()
187 cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--pipe=" + pipeName], env=environment)
188 attachPipe(cmakeCommand, pipeName)
189 else:
190 cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--debug"],
191 stdin=subprocess.PIPE,
192 stdout=subprocess.PIPE,
193 env=environment)
194 cmakeCommand.outPipe = cmakeCommand.stdout
195 cmakeCommand.inPipe = cmakeCommand.stdin
196 cmakeCommand.write = lambda val: writeAndFlush(cmakeCommand.inPipe, val)
197
198 #packet = waitForRawMessage(cmakeCommand)
199 #if packet == None:
200 # print("Not in server mode")
201 # sys.exit(2)
202
203 #if packet['type'] != 'hello':
204 # print("No hello message")
205 # sys.exit(3)
206
207 return cmakeCommand
208
209def exitProc(cmakeCommand):
210 # Tell the server to exit.

Callers

nothing calls this directly

Calls 4

getPipeNameFunction · 0.85
attachPipeFunction · 0.85
writeAndFlushFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected