(host, port, code, args, setup)
| 184 | |
| 185 | |
| 186 | def _get_python_c_args(host, port, code, args, setup): |
| 187 | setup = _get_setup_updated_with_protocol_and_ppid(setup) |
| 188 | |
| 189 | # i.e.: We want to make the repr sorted so that it works in tests. |
| 190 | setup_repr = setup if setup is None else (sorted_dict_repr(setup)) |
| 191 | |
| 192 | future_imports = "" |
| 193 | if "__future__" in code: |
| 194 | # If the code has a __future__ import, we need to be able to strip the __future__ |
| 195 | # imports from the code and add them to the start of our code snippet. |
| 196 | future_imports, code = _separate_future_imports(code) |
| 197 | |
| 198 | return ( |
| 199 | "%simport sys; sys.path.insert(0, r'%s'); import pydevd; pydevd.config(%r, %r); " |
| 200 | "pydevd.settrace(host=%r, port=%s, suspend=False, trace_only_current_thread=False, patch_multiprocessing=True, access_token=%r, client_access_token=%r, __setup_holder__=%s); " |
| 201 | "%s" |
| 202 | ) % ( |
| 203 | future_imports, |
| 204 | pydev_src_dir, |
| 205 | pydevd_constants.get_protocol(), |
| 206 | PydevdCustomization.DEBUG_MODE, |
| 207 | host, |
| 208 | port, |
| 209 | setup.get("access-token"), |
| 210 | setup.get("client-access-token"), |
| 211 | setup_repr, |
| 212 | code, |
| 213 | ) |
| 214 | |
| 215 | |
| 216 | def _get_host_port(): |
no test coverage detected