|
1 | 1 | r""" |
2 | | - This module provides utilities to get the absolute filenames so that we can be sure that: |
3 | | - - The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit). |
4 | | - - Providing means for the user to make path conversions when doing a remote debugging session in |
5 | | - one machine and debugging in another. |
| 2 | +This module provides utilities to get the absolute filenames so that we can be sure that: |
| 3 | + - The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit). |
| 4 | + - Providing means for the user to make path conversions when doing a remote debugging session in |
| 5 | + one machine and debugging in another. |
6 | 6 |
|
7 | | - To do that, the PATHS_FROM_ECLIPSE_TO_PYTHON constant must be filled with the appropriate paths. |
| 7 | +To do that, the PATHS_FROM_ECLIPSE_TO_PYTHON constant must be filled with the appropriate paths. |
8 | 8 |
|
9 | | - @note: |
10 | | - in this context, the server is where your python process is running |
11 | | - and the client is where eclipse is running. |
| 9 | +@note: |
| 10 | + in this context, the server is where your python process is running |
| 11 | + and the client is where eclipse is running. |
12 | 12 |
|
13 | | - E.g.: |
14 | | - If the server (your python process) has the structure |
15 | | - /user/projects/my_project/src/package/module1.py |
| 13 | +E.g.: |
| 14 | + If the server (your python process) has the structure |
| 15 | + /user/projects/my_project/src/package/module1.py |
16 | 16 |
|
17 | | - and the client has: |
18 | | - c:\my_project\src\package\module1.py |
| 17 | + and the client has: |
| 18 | + c:\my_project\src\package\module1.py |
19 | 19 |
|
20 | | - the PATHS_FROM_ECLIPSE_TO_PYTHON would have to be: |
21 | | - PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'c:\my_project\src', r'/user/projects/my_project/src')] |
| 20 | + the PATHS_FROM_ECLIPSE_TO_PYTHON would have to be: |
| 21 | + PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'c:\my_project\src', r'/user/projects/my_project/src')] |
22 | 22 |
|
23 | | - alternatively, this can be set with an environment variable from the command line: |
24 | | - set PATHS_FROM_ECLIPSE_TO_PYTHON=[['c:\my_project\src','/user/projects/my_project/src']] |
| 23 | + alternatively, this can be set with an environment variable from the command line: |
| 24 | + set PATHS_FROM_ECLIPSE_TO_PYTHON=[['c:\my_project\src','/user/projects/my_project/src']] |
25 | 25 |
|
26 | | - @note: DEBUG_CLIENT_SERVER_TRANSLATION can be set to True to debug the result of those translations |
| 26 | +@note: DEBUG_CLIENT_SERVER_TRANSLATION can be set to True to debug the result of those translations |
27 | 27 |
|
28 | | - @note: the case of the paths is important! Note that this can be tricky to get right when one machine |
29 | | - uses a case-independent filesystem and the other uses a case-dependent filesystem (if the system being |
30 | | - debugged is case-independent, 'normcase()' should be used on the paths defined in PATHS_FROM_ECLIPSE_TO_PYTHON). |
| 28 | +@note: the case of the paths is important! Note that this can be tricky to get right when one machine |
| 29 | +uses a case-independent filesystem and the other uses a case-dependent filesystem (if the system being |
| 30 | +debugged is case-independent, 'normcase()' should be used on the paths defined in PATHS_FROM_ECLIPSE_TO_PYTHON). |
31 | 31 |
|
32 | | - @note: all the paths with breakpoints must be translated (otherwise they won't be found in the server) |
| 32 | +@note: all the paths with breakpoints must be translated (otherwise they won't be found in the server) |
33 | 33 |
|
34 | | - @note: to enable remote debugging in the target machine (pydev extensions in the eclipse installation) |
35 | | - import pydevd;pydevd.settrace(host, stdoutToServer, stderrToServer, port, suspend) |
| 34 | +@note: to enable remote debugging in the target machine (pydev extensions in the eclipse installation) |
| 35 | + import pydevd;pydevd.settrace(host, stdoutToServer, stderrToServer, port, suspend) |
36 | 36 |
|
37 | | - see parameter docs on pydevd.py |
| 37 | + see parameter docs on pydevd.py |
38 | 38 |
|
39 | | - @note: for doing a remote debugging session, all the pydevd_ files must be on the server accessible |
40 | | - through the PYTHONPATH (and the PATHS_FROM_ECLIPSE_TO_PYTHON only needs to be set on the target |
41 | | - machine for the paths that'll actually have breakpoints). |
| 39 | +@note: for doing a remote debugging session, all the pydevd_ files must be on the server accessible |
| 40 | + through the PYTHONPATH (and the PATHS_FROM_ECLIPSE_TO_PYTHON only needs to be set on the target |
| 41 | + machine for the paths that'll actually have breakpoints). |
42 | 42 | """ |
43 | 43 |
|
44 | 44 | from _pydev_bundle import pydev_log |
@@ -963,16 +963,3 @@ def get_package_dir(mod_name): |
963 | 963 | if os.path.isdir(mod_path): |
964 | 964 | return mod_path |
965 | 965 | return None |
966 | | - |
967 | | - |
968 | | -PYDEVD_ROOT_PATH = get_abs_path_real_path_and_base_from_file(os.path.dirname(__file__))[1] |
969 | | - |
970 | | - |
971 | | -def is_pydevd_path(path, _cache={}) -> bool: |
972 | | - try: |
973 | | - return _cache[path] |
974 | | - except KeyError: |
975 | | - # Return true if this file is rooted in the pydevd directory. |
976 | | - f: str = get_abs_path_real_path_and_base_from_file(path)[1] |
977 | | - b = _cache[path] = f.startswith(PYDEVD_ROOT_PATH) |
978 | | - return b |
0 commit comments