juicebox module¶
This program consisted of the functions which are used in main.py program to check the authority of the operator and the staff members
-
class
juicebox.Juicebox¶ Bases:
objectThis class represents as the parent class for the JuiceBox
- rid_1: str
- RFID number of the operator
- rid_2: str
- RFID number of the staff member
- temp_rid: str
- temporary variable for storing the RFID number
- role_1: int
- assigned the default value of role_1 as 0
- role_2: int
- assigned the default value of role_2 as 0
- trans_id: str
- transaction id used for ending the transaction
- go: bool
- assigned the default value as False
This function checks whether the id type, id number and device id is correct
- id_type: str
- gets the id type for verification
- id_number: int
- validates the id number for the operator
- id_number_2: int
- validates the id number for the staff
- device_id: int
- validates the device id of the device
str: json file data is returned- ValueError
- If the function failed to request authorization of different ID’s from server
-
check_status_operator(type, id)¶ This function is used for checking the status of operator with its type and student/operator id number
- type: str
- gets the type of rfid status of the operator
- id: int
- gets the student id number of the operator
- ConnectionError
- If the device is not connected to the internet
-
check_status_staff(type, id)¶ This function is used for checking the status of staff member with its type and student/staff id number
- type: str
- gets the type of rfid status of the staff member
- id: int
- gets the student id number of the staff member
- ConnectionError
- If the device is not connected to the internet