|
5 | 5 | import sys |
6 | 6 | from pathlib import Path |
7 | 7 |
|
8 | | -# TODO(Andrew): move this to its own subpackage comm # noqa: FIX002, TD003 |
| 8 | +# TODO(Andrew): move to own subpackage during channel refactor # noqa: FIX002, TD003 |
9 | 9 | from choreographer._pipe import Pipe, WebSocket |
10 | 10 |
|
11 | 11 | if platform.system() == "Windows": |
12 | 12 | import msvcrt |
13 | 13 |
|
14 | 14 |
|
15 | 15 | class Chromium: |
16 | | - def __init__(self, pipe): |
17 | | - self._comm = pipe |
| 16 | + def __init__(self, channel): |
| 17 | + self._comm = channel |
18 | 18 | # extra information from pipe |
19 | 19 |
|
20 | 20 | # where do we get user data dir |
@@ -56,19 +56,19 @@ def get_cli(self, temp_dir, **kwargs): |
56 | 56 | if not sandbox: |
57 | 57 | cli.append("--no-sandbox") |
58 | 58 |
|
59 | | - if isinstance(self._comm, Pipe): |
| 59 | + if isinstance(self._channel, Pipe): |
60 | 60 | cli.append("--remote-debugging-pipe") |
61 | 61 | if platform.system() == "Windows": |
62 | 62 | _inheritable = True |
63 | | - write_handle = msvcrt.get_osfhandle(self._comm.from_choreo_to_external) |
64 | | - read_handle = msvcrt.get_osfhandle(self._comm.from_external_to_choreo) |
65 | | - os.set_handle_inheritable(write_handle, _inheritable) |
66 | | - os.set_handle_inheritable(read_handle, _inheritable) |
| 63 | + w_handle = msvcrt.get_osfhandle(self._channel.from_choreo_to_external) |
| 64 | + r_handle = msvcrt.get_osfhandle(self._channel.from_external_to_choreo) |
| 65 | + os.set_handle_inheritable(w_handle, _inheritable) |
| 66 | + os.set_handle_inheritable(r_handle, _inheritable) |
67 | 67 | cli += [ |
68 | | - f"--remote-debugging-io-pipes={read_handle!s},{write_handle!s}", |
| 68 | + f"--remote-debugging-io-pipes={r_handle!s},{w_handle!s}", |
69 | 69 | ] |
70 | | - elif isinstance(self._comm, WebSocket): |
71 | | - raise NotImplementedError("Websocket style comms are not implemented yet") |
| 70 | + elif isinstance(self._channel, WebSocket): |
| 71 | + raise NotImplementedError("Websocket style channels not implemented yet") |
72 | 72 |
|
73 | 73 |
|
74 | 74 | def get_env(): |
|
0 commit comments