diff options
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/tui/screens.py')
| -rw-r--r-- | packages/meshbay-cli/src/meshbay_cli/tui/screens.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/meshbay-cli/src/meshbay_cli/tui/screens.py b/packages/meshbay-cli/src/meshbay_cli/tui/screens.py index 0306325..39b5df3 100644 --- a/packages/meshbay-cli/src/meshbay_cli/tui/screens.py +++ b/packages/meshbay-cli/src/meshbay_cli/tui/screens.py @@ -14,9 +14,11 @@ the node's operator) or none is, then asked once for the batch. import asyncio import contextlib +import os import threading from pathlib import Path +from meshbay_common.paths import long_path from rich.text import Text from textual.app import ComposeResult from textual.binding import Binding @@ -214,8 +216,8 @@ class MainScreen(Screen): problems.append(str(e)) for p in problems: self.app.notify(p, severity="warning", markup=False) - existing = [t for _, t in plan if t.exists() - and not t.with_name(t.name + PART_SUFFIX).exists()] + existing = [t for _, t in plan if os.path.exists(long_path(t)) + and not os.path.exists(long_path(t.with_name(t.name + PART_SUFFIX)))] overwrite = False if existing: names = ", ".join(safe(t.name) for t in existing[:5]) + ( @@ -229,7 +231,7 @@ class MainScreen(Screen): if not overwrite: plan = [(e, t) for e, t in plan if t not in existing] for d in dirs: - await asyncio.to_thread(d.mkdir, parents=True, exist_ok=True) + await asyncio.to_thread(os.makedirs, long_path(d), exist_ok=True) remote.marks.clear() remote.redraw() session = await self.pool.session(group) @@ -320,7 +322,7 @@ class MainScreen(Screen): self.strip.update_job(job, state="running") lock = threading.Lock() try: - with open(item.local, "rb") as fh: + with open(long_path(item.local), "rb") as fh: def read(offset: int, length: int) -> bytes: with lock: fh.seek(offset) |