|
2 | 2 |
|
3 | 3 | from asyncio import tools |
4 | 4 |
|
5 | | -from collections import namedtuple |
| 5 | +import _remote_debugging |
6 | 6 |
|
7 | | -LocationInfo = namedtuple('LocationInfo', ['lineno', 'end_lineno', 'col_offset', 'end_col_offset'], defaults=[None]*4) |
8 | | -FrameInfo = namedtuple('FrameInfo', ['funcname', 'filename', 'location']) |
9 | | -CoroInfo = namedtuple('CoroInfo', ['call_stack', 'task_name']) |
10 | | -TaskInfo = namedtuple('TaskInfo', ['task_id', 'task_name', 'coroutine_stack', 'awaited_by']) |
11 | | -AwaitedInfo = namedtuple('AwaitedInfo', ['thread_id', 'awaited_by']) |
| 7 | + |
| 8 | +def LocationInfo(lineno, end_lineno=None, col_offset=None, end_col_offset=None): |
| 9 | + return _remote_debugging.LocationInfo((lineno, end_lineno, col_offset, end_col_offset)) |
| 10 | + |
| 11 | + |
| 12 | +def FrameInfo(funcname, filename, location, opcode=None): |
| 13 | + return _remote_debugging.FrameInfo((filename, location, funcname, opcode)) |
| 14 | + |
| 15 | + |
| 16 | +def CoroInfo(call_stack, task_name): |
| 17 | + return _remote_debugging.CoroInfo((call_stack, task_name)) |
| 18 | + |
| 19 | + |
| 20 | +def TaskInfo(task_id, task_name, coroutine_stack, awaited_by): |
| 21 | + return _remote_debugging.TaskInfo((task_id, task_name, coroutine_stack, awaited_by)) |
| 22 | + |
| 23 | + |
| 24 | +def AwaitedInfo(thread_id, awaited_by): |
| 25 | + return _remote_debugging.AwaitedInfo((thread_id, awaited_by)) |
12 | 26 |
|
13 | 27 |
|
14 | 28 | # mock output of get_all_awaited_by function. |
|
0 commit comments