Skip to content

Commit 39b1656

Browse files
authored
Merge pull request #6 from UiPath/fix/add_custom_log_handler
fix: proper folder structure
2 parents bd7ba60 + 3cd5a43 commit 39b1656

File tree

11 files changed

+50
-11
lines changed

11 files changed

+50
-11
lines changed

src/uipath/dev/__init__.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""UiPath Dev Terminal Application."""
1+
"""UiPath Developer Console Application."""
22

33
import asyncio
44
import json
@@ -24,22 +24,21 @@
2424
)
2525
from uipath.runtime.errors import UiPathErrorContract, UiPathRuntimeError
2626

27-
from uipath.dev.components.details import RunDetailsPanel
28-
from uipath.dev.components.history import RunHistoryPanel
29-
from uipath.dev.components.new import NewRunPanel
30-
from uipath.dev.models.execution import ExecutionRun
31-
from uipath.dev.models.messages import LogMessage, TraceMessage
32-
33-
from ._utils._exporter import RunContextExporter
34-
from ._utils._logger import RunContextLogHandler, patch_textual_stderr
27+
from uipath.dev.infrastructure import (
28+
RunContextExporter,
29+
RunContextLogHandler,
30+
patch_textual_stderr,
31+
)
32+
from uipath.dev.models import ExecutionRun, LogMessage, TraceMessage
33+
from uipath.dev.ui.panels import NewRunPanel, RunDetailsPanel, RunHistoryPanel
3534

3635

3736
class UiPathDeveloperConsole(App[Any]):
3837
"""UiPath developer console interface."""
3938

4039
TITLE = "UiPath Developer Console"
4140
SUB_TITLE = "Interactive terminal application for building, testing, and debugging UiPath Python runtimes, agents, and automation scripts."
42-
CSS_PATH = Path(__file__).parent / "_styles" / "terminal.tcss"
41+
CSS_PATH = Path(__file__).parent / "ui" / "styles" / "terminal.tcss"
4342

4443
BINDINGS = [
4544
Binding("q", "quit", "Quit"),
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Infrastructure components for UiPath Developer CLI UI integration."""
2+
3+
from uipath.dev.infrastructure.logging_handlers import (
4+
RunContextLogHandler,
5+
patch_textual_stderr,
6+
)
7+
from uipath.dev.infrastructure.tracing_exporter import RunContextExporter
8+
9+
__all__ = [
10+
"RunContextExporter",
11+
"RunContextLogHandler",
12+
"patch_textual_stderr",
13+
]

src/uipath/dev/_utils/_logger.py renamed to src/uipath/dev/infrastructure/logging_handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Custom logging handlers for CLI UI integration."""
2+
13
from __future__ import annotations
24

35
import logging
@@ -20,6 +22,7 @@ def __init__(
2022
run_id: str,
2123
callback: Callable[[LogMessage], None],
2224
):
25+
"""Initialize RunContextLogHandler with run and callback."""
2326
super().__init__(run_id)
2427
self.run_id = run_id
2528
self.callback = callback

src/uipath/dev/_utils/_exporter.py renamed to src/uipath/dev/infrastructure/tracing_exporter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Custom OpenTelemetry trace exporter for CLI UI integration."""
2+
13
import logging
24
from datetime import datetime
35
from typing import Callable, Sequence
@@ -18,6 +20,7 @@ def __init__(
1820
on_trace: Callable[[TraceMessage], None],
1921
on_log: Callable[[LogMessage], None],
2022
):
23+
"""Initialize RunContextExporter with callbacks for trace and log messages."""
2124
self.on_trace = on_trace
2225
self.on_log = on_log
2326
self.logger = logging.getLogger(__name__)

src/uipath/dev/models/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""UiPath Dev Console models module."""
2+
3+
from uipath.dev.models.execution import ExecutionRun
4+
from uipath.dev.models.messages import LogMessage, TraceMessage
5+
6+
__all__ = [
7+
"ExecutionRun",
8+
"LogMessage",
9+
"TraceMessage",
10+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""UiPath Dev Console panels module initialization."""
2+
3+
from uipath.dev.ui.panels.new_run_panel import NewRunPanel
4+
from uipath.dev.ui.panels.run_details_panel import RunDetailsPanel
5+
from uipath.dev.ui.panels.run_history_panel import RunHistoryPanel
6+
7+
__all__ = [
8+
"NewRunPanel",
9+
"RunDetailsPanel",
10+
"RunHistoryPanel",
11+
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from textual.reactive import reactive
1010
from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea
1111

12-
from uipath.dev.components.json_input import JsonInput
12+
from uipath.dev.ui.widgets.json_input import JsonInput
1313

1414

1515
def mock_json_from_schema(schema: dict[str, Any]) -> dict[str, Any]:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)