2 Author: Mitchell Pomery (bobgeorge33)
4 Dispense is an abstract class that allows easy configuration between different systems. Anything that is
5 intended to talk to OpenDispense or similar should comply with this class. Using this class in particular
6 will cause you a lot of problems.
9 class DispenseInterface(object):
12 Create a new dispense object.
14 def __init__(self, username=None, loggedIn=False, disabled=False):
18 Create a new dispense interface as the supplied user.
21 def authUsernamePin(username, pin):
25 Create a new dispense interface as the supplied user.
28 def authMifare(cardId):
32 Check if creating the user worked correctly.
38 Get the users username.
40 def getUsername(self, user):
44 Get the users current balance.
46 def getBalance(self, user):
50 Get the name and price of an item.
51 itemId is the number entered into the vending machine
54 def getItemInfo(itemId):
58 Check if the user is disabled.
64 Dispense an item for the current user.
65 itemId is the number entered into the vending machine
67 def dispenseItem(self, itemId):