chore: drop nonessential docstrings
This commit is contained in:
@@ -1,3 +1 @@
|
|||||||
"""takopi — Telegram Codex bridge package."""
|
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
__version__ = "0.1.0"
|
||||||
|
|||||||
@@ -188,12 +188,6 @@ EventCallback = Callable[[dict[str, Any]], Awaitable[None] | None]
|
|||||||
|
|
||||||
|
|
||||||
class CodexExecRunner:
|
class CodexExecRunner:
|
||||||
"""
|
|
||||||
Runs Codex in non-interactive mode:
|
|
||||||
- new: codex exec --json ... -
|
|
||||||
- resume: codex exec --json ... resume <SESSION_ID> -
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
codex_cmd: str,
|
codex_cmd: str,
|
||||||
@@ -330,9 +324,6 @@ class CodexExecRunner:
|
|||||||
session_id: str | None,
|
session_id: str | None,
|
||||||
on_event: EventCallback | None = None,
|
on_event: EventCallback | None = None,
|
||||||
) -> tuple[str, str, bool]:
|
) -> tuple[str, str, bool]:
|
||||||
"""
|
|
||||||
If resuming, serialize per-session.
|
|
||||||
"""
|
|
||||||
if not session_id:
|
if not session_id:
|
||||||
return await self.run(prompt, session_id=None, on_event=on_event)
|
return await self.run(prompt, session_id=None, on_event=on_event)
|
||||||
lock = await self._lock_for(session_id)
|
lock = await self._lock_for(session_id)
|
||||||
|
|||||||
@@ -91,11 +91,6 @@ def format_event(
|
|||||||
command_width: int | None = None,
|
command_width: int | None = None,
|
||||||
escape_markdown: bool = False,
|
escape_markdown: bool = False,
|
||||||
) -> tuple[int | None, list[str], str | None, str | None]:
|
) -> tuple[int | None, list[str], str | None, str | None]:
|
||||||
"""
|
|
||||||
Returns (new_last_item, cli_lines, progress_line, progress_prefix).
|
|
||||||
progress_prefix is only set when progress_line is set, and is used for
|
|
||||||
replacing a preceding "running" line on completion.
|
|
||||||
"""
|
|
||||||
lines: list[str] = []
|
lines: list[str] = []
|
||||||
|
|
||||||
match event["type"]:
|
match event["type"]:
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
"""First-run setup validation and onboarding."""
|
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import shutil
|
import shutil
|
||||||
@@ -16,8 +14,6 @@ _OCTOPUS = "\N{OCTOPUS}"
|
|||||||
|
|
||||||
@dataclass(slots=True)
|
@dataclass(slots=True)
|
||||||
class SetupResult:
|
class SetupResult:
|
||||||
"""Collected setup issues."""
|
|
||||||
|
|
||||||
missing_codex: bool = False
|
missing_codex: bool = False
|
||||||
missing_or_invalid_config: bool = False
|
missing_or_invalid_config: bool = False
|
||||||
config_path: Path = HOME_CONFIG_PATH
|
config_path: Path = HOME_CONFIG_PATH
|
||||||
@@ -28,7 +24,6 @@ class SetupResult:
|
|||||||
|
|
||||||
|
|
||||||
def check_setup() -> SetupResult:
|
def check_setup() -> SetupResult:
|
||||||
"""Check all prerequisites and return collected issues."""
|
|
||||||
missing_codex = shutil.which("codex") is None
|
missing_codex = shutil.which("codex") is None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -54,7 +49,6 @@ def check_setup() -> SetupResult:
|
|||||||
|
|
||||||
|
|
||||||
def _config_path_display(path: Path) -> str:
|
def _config_path_display(path: Path) -> str:
|
||||||
"""Format path for display, using ~ for home directory."""
|
|
||||||
home = Path.home()
|
home = Path.home()
|
||||||
try:
|
try:
|
||||||
return f"~/{path.relative_to(home)}"
|
return f"~/{path.relative_to(home)}"
|
||||||
@@ -63,7 +57,6 @@ def _config_path_display(path: Path) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def render_setup_guide(result: SetupResult) -> None:
|
def render_setup_guide(result: SetupResult) -> None:
|
||||||
"""Render a friendly setup guide panel to stderr."""
|
|
||||||
if result.ok:
|
if result.ok:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ class TelegramAPIError(RuntimeError):
|
|||||||
|
|
||||||
|
|
||||||
class TelegramClient:
|
class TelegramClient:
|
||||||
"""
|
|
||||||
Minimal Telegram Bot API client.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
token: str,
|
token: str,
|
||||||
|
|||||||
Reference in New Issue
Block a user