wish.backends

Which live backends exist, and how to find one that is there.

Discovery used to be one hard-coded TCP probe of 127.0.0.1:6502, which is VICE and nothing else. A Backend is that knowledge made into data: how to tell whether one is present, how to attach, what to say when it is not, and how often it is reasonable to poll it – the last because a network device on the end of a cable cannot be asked sixty times a second the way a loopback socket can.

A backend that cannot be probed is not offered. probe() is called on a timer with no emulator running, most of the time, so it must be cheap and it must never raise: a broken or absent backend disappears from the list rather than taking the window down with it.

Functions

available()

The ones answering right now.

backends()

Every backend, in the order they are tried.

find([preferred])

The backend to attach to, or None if nothing answers.

setup_hints()

What to tell someone with nothing running.

Classes

Backend

One way to read a running machine.

class wish.backends.Backend[source]

Bases: object

One way to read a running machine.

__init__(name, probe, connect, setup_hint, default_interval_ms=200, disturbs=True, verified=True)
Parameters:
Return type:

None

connect: Callable[[], automap.target.Target]
default_interval_ms: int = 200
disturbs: bool = True
name: str
present()[source]

probe(), with anything it throws treated as “not there”.

Return type:

bool

probe: Callable[[], bool]
setup_hint: str
verified: bool = True
wish.backends.available()[source]

The ones answering right now. Empty is the ordinary case.

Return type:

list[wish.backends.Backend]

wish.backends.backends()[source]

Every backend, in the order they are tried.

Return type:

list[wish.backends.Backend]

wish.backends.find(preferred=None)[source]

The backend to attach to, or None if nothing answers.

preferred settles a tie for somebody who has both a running emulator and a device on the desk; it is a name, matched case-insensitively, and it is ignored if that backend is not answering.

Parameters:

preferred (str | None)

Return type:

wish.backends.Backend | None

wish.backends.setup_hints()[source]

What to tell someone with nothing running.

Return type:

str