(cmakeCommand, comm, extraEnv = {})
| 178 | pipe.flush() |
| 179 | |
| 180 | def 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 | |
| 209 | def exitProc(cmakeCommand): |
| 210 | # Tell the server to exit. |
nothing calls this directly
no test coverage detected