Loading poolpay/card/CardReader.py 0 → 100644 +24 −0 Original line number Diff line number Diff line from __future__ import annotations from collections.abc import Callable, Sequence from typing import Protocol class CardReader(Protocol): def read_id(self) -> Sequence[int]: """ Read the UID of the MIFARE Ultralight card that is presented. If the presented card is not a MIFARE Ultralight card, there is more than one card presented at once, or there is no card presented at all, this method's behavior is undefined. """ ... def on_card_presented(self, handle_card: Callable[[CardReader], None]) -> None: """ Register the function handle_card so that it is called whenever a MIFARE Ultralight card is presented. If this is called multiple times, the CardReader may decide whether it only remembers and calls the last registered function, or all of them. """ ... Loading
poolpay/card/CardReader.py 0 → 100644 +24 −0 Original line number Diff line number Diff line from __future__ import annotations from collections.abc import Callable, Sequence from typing import Protocol class CardReader(Protocol): def read_id(self) -> Sequence[int]: """ Read the UID of the MIFARE Ultralight card that is presented. If the presented card is not a MIFARE Ultralight card, there is more than one card presented at once, or there is no card presented at all, this method's behavior is undefined. """ ... def on_card_presented(self, handle_card: Callable[[CardReader], None]) -> None: """ Register the function handle_card so that it is called whenever a MIFARE Ultralight card is presented. If this is called multiple times, the CardReader may decide whether it only remembers and calls the last registered function, or all of them. """ ...