Welcome to Removinator’s documentation!¶
Classes¶
-
class
removinator.Removinator(port=None)¶ Connection to a Smart Card Removinator controller
Opens a connection to a Removinator controller on the specified serial port.
If a port is not specified, an attempt will be made to auto-discover the Removinator controller.
Parameters: port (str) – port that the Removinator is connected to
Raises: Variables: - last_result – The result output from the last executed command
- last_response – The response output from the last executed command
- port – The port that the Removinator is connected to
-
get_status()¶ Get the status of the Removinator controller
The status indicates the currently inserted card as well as a list of slots that have a card present.
Returns: status containing the current and present cards Return type: dict containing current and present keys Raises: CommandError
-
insert_card(slot)¶ Insert a specified card
This sends a command to the Removinator conroller telling it to insert a specified card to the card reader. If the specified slot does not have a card present, this will raise a SlotError.
Parameters: slot (int) – the slot of the card to insert (1-8) Raises: SlotError,CommandError,ValueError
-
remove_card()¶ Remove the currently inserted card
Raises: CommandError
-
send_command(command)¶ Send a command to the Removinator controller
Sends the specified command to the Removinator controller. The command result (OK or ERR_*) will be available in the last_result attribute of your Removinator object. Similarly, the full command response will be available in the last_response attribute.
If an error result is encountered, a CommandError will be raised.
Parameters: command (str) – the command to send Raises: CommandError
-
set_debug(debug)¶ Enable or disable Removinator controller debug output
When enabled, the Removinator controller will return verbose responses via serial when commands are executed. The debug output from the previously run command will be available along with the standard command output in the last_response attribute of your Removinator object.
Parameters: debug (bool) – enable/disable debugging Raises: CommandError
Exceptions¶
-
exception
removinator.Error(msg)¶ Base class for exceptions in this module.
Parameters: msg (str) – Error message associated with the exception Variables: msg – Error message associated with the exception
-
exception
removinator.CommandError(msg)¶ Exception raised sending a command to the Removinator.
-
exception
removinator.ConnectError(msg)¶ Exception raised connecting to the Removinator controller.
-
exception
removinator.SlotError(msg)¶ Exception raised selecting an empty card slot.