Skip to content

Commit 4b04c7a

Browse files
committed
feat: debugger is now started from bundled/tool/debugger if available
1 parent f09880b commit 4b04c7a

File tree

7 files changed

+492
-421
lines changed

7 files changed

+492
-421
lines changed

bundled/tool/debugger/__main__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
import pathlib
3+
import site
4+
import sys
5+
6+
7+
def update_sys_path(path_to_add: str, strategy: str) -> None:
8+
if path_to_add not in sys.path and pathlib.Path(path_to_add).is_dir():
9+
if any(p for p in pathlib.Path(path_to_add).iterdir() if p.suffix == ".pth"):
10+
site.addsitedir(path_to_add)
11+
return
12+
13+
if strategy == "useBundled":
14+
sys.path.insert(0, path_to_add)
15+
elif strategy == "fromEnvironment":
16+
sys.path.append(path_to_add)
17+
18+
19+
if __name__ == "__main__":
20+
update_sys_path(
21+
os.fspath(pathlib.Path(__file__).parent.parent.parent / "libs"),
22+
os.getenv("LS_IMPORT_STRATEGY", "useBundled"),
23+
)
24+
25+
from robotcode.debugger.cli import main
26+
27+
main()

bundled/tool/debugger/launcher/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ def update_sys_path(path_to_add: str, strategy: str) -> None:
2424

2525
from robotcode.debugger.launcher.cli import main
2626

27-
main()
27+
main(str(pathlib.Path(__file__).parent.parent))

packages/core/robotcode/core/utils/net.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
from contextlib import closing
44
from typing import Optional, cast
55

6-
from ..logging import LoggingDescriptor
7-
8-
_logger = LoggingDescriptor(name=__name__)
9-
106

117
def find_free_port(start: Optional[int] = None, end: Optional[int] = None) -> int:
128
port = start

0 commit comments

Comments
 (0)