(session, target, console=None, cwd=None)
| 116 | |
| 117 | @_runner |
| 118 | def launch(session, target, console=None, cwd=None): |
| 119 | assert console in ( |
| 120 | None, |
| 121 | "internalConsole", |
| 122 | "integratedTerminal", |
| 123 | "externalTerminal", |
| 124 | ) |
| 125 | |
| 126 | log.info("Launching {0} in {1} using {2}.", target, session, json.repr(console)) |
| 127 | |
| 128 | target.configure(session) |
| 129 | config = session.config |
| 130 | config.setdefaults( |
| 131 | {"console": "externalTerminal", "internalConsoleOptions": "neverOpen"} |
| 132 | ) |
| 133 | if console is not None: |
| 134 | config["console"] = console |
| 135 | if cwd is not None: |
| 136 | config["cwd"] = cwd |
| 137 | if "python" not in config and "pythonPath" not in config: |
| 138 | config["python"] = sys.executable |
| 139 | |
| 140 | env = ( |
| 141 | session.spawn_adapter.env |
| 142 | if config["console"] == "internalConsole" |
| 143 | else config.env |
| 144 | ) |
| 145 | target.cli(env) |
| 146 | |
| 147 | session.spawn_adapter() |
| 148 | return session.request_launch() |
| 149 | |
| 150 | |
| 151 | def _attach_common_config(session, target, cwd): |
nothing calls this directly
no test coverage detected
searching dependent graphs…