X-Git-Url: https://git.ucc.asn.au/?p=uccvend-vendserver.git;a=blobdiff_plain;f=VendServer%2FDispenseInterface.py;fp=VendServer%2FDispenseInterface.py;h=81a3f06b03d5f92ae5bf9b721da47f8537d555a6;hp=0000000000000000000000000000000000000000;hb=ed50c28e02f4be810b2a492717904ec8cd5a4970;hpb=fc54224064166688cff70891381774884d5c7729;ds=sidebyside diff --git a/VendServer/DispenseInterface.py b/VendServer/DispenseInterface.py new file mode 100644 index 0000000..81a3f06 --- /dev/null +++ b/VendServer/DispenseInterface.py @@ -0,0 +1,70 @@ +""" +Author: Mitchell Pomery (bobgeorge33) + +Dispense is an abstract class that allows easy configuration between different systems. Anything that is +intended to talk to OpenDispense or similar should comply with this class. Using this class in particular +will cause you a lot of problems. +""" + +class DispenseInterface(object): + + """ + Create a new dispense object. + """ + def __init__(self, username=None, loggedIn=False, disabled=False): + pass + + """ + Create a new dispense interface as the supplied user. + """ + @staticmethod + def authUsernamePin(username, pin): + pass + + """ + Create a new dispense interface as the supplied user. + """ + @staticmethod + def authMifare(cardId): + pass + + """ + Check if creating the user worked correctly. + """ + def isLoggedIn(self): + pass + + """ + Get the users username. + """ + def getUsername(self, user): + pass + + """ + Get the users current balance. + """ + def getBalance(self, user): + pass + + """ + Get the name and price of an item. + itemId is the number entered into the vending machine + """ + @staticmethod + def getItemInfo(itemId): + pass + + """ + Check if the user is disabled. + """ + def isDisabled(self): + pass + + """ + Dispense an item for the current user. + itemId is the number entered into the vending machine + """ + def dispenseItem(self, itemId): + pass + +