host.localHost¶
-
class otto.host.localHost.LocalFileTransfer(name, max_filename_len=
255)¶ Bases:
BaseFileTransferFile transfer for
LocalHost— a local copy viashutil.copy2().Concrete
BaseFileTransferso the ABC’s progress contract holds uniformly across every backend in the host fleet (Unix’sFileTransfer, embedded’sEmbeddedFileTransfer, and this one). Per-file completion is the granularity —shutil.copy2is a single blocking C call with no progress hook, the analogue of an embeddedfs read.
- class otto.host.localHost.LocalHost(log=True, resources=<factory>)¶
Bases:
BaseHost- name : --is-rst--:py:class:`str`¶
- id : --is-rst--:py:class:`str`¶
Stable identifier for the local host — always
"local".
- log : --is-rst--:py:class:`bool`¶
Determines whether this host should log its output to stdout and log files.
- resources : --is-rst--:py:class:`set`\ \[:py:class:`str`]¶
Resources required to reserve this host — always empty for LocalHost.
-
async oneshot(cmd, timeout=
None, log=True)¶ Run a command in a fresh subprocess (stateless, concurrent-safe).
Each call spawns an independent process — no state persists between calls, and multiple oneshot() calls can run concurrently via asyncio.gather().
- Return type:¶
-
async expect(pattern, timeout=
10.0)¶ Wait for a pattern in the host’s session output stream.
- Return type:¶
str
-
async get(src_files, dest_dir, show_progress=
True)¶ Copy files to dest_dir on the local filesystem.
Delegates to
LocalFileTransferso progress reporting flows through the sameBaseFileTransfermachinery as Unix and embedded backends.
-
async put(src_files, dest_dir, show_progress=
True)¶ Copy files to dest_dir on the local filesystem.
Delegates to
LocalFileTransfer; seeget().