def callback_inline(call): if call.data == "plus": menu.update_menu_item_amount(call, 1) elif call.data == "minus": menu.update_menu_item_amount(call, -1) elif call.data == "basket": basket.show(call.message, call.from_user.id) elif call.data == "clear": basket.clear(call) basket.show(call.message, call.from_user.id) elif call.data == "menu": menu.show(call.message, call.from_user.id) elif call.data == "confirm": order.confirm(call) elif call.data in (OrderStatus.IN_PROGRESS, OrderStatus.READY, OrderStatus.TAKEN): admin_notification.update(call) elif call.data.split('|')[0] == "pay": payments.pay(call.message.chat.id, call.from_user.id, call.data.split('|')[1])
import data import menu import helpers while True: employees = data.load_data('employee_db.txt').readlines() option = int(menu.show_menu()) if option == menu.SHOW_ALL_EMPLOYEES: menu.show_all(employees) elif option == menu.SHOW_EMPLOYEE: menu.show(employees) elif option == menu.CHANGE_SALARY: employees = menu.change_salary(employees) data.save_data('employee_db.txt', employees) elif option == menu.ADD_EMPLOYEE: employeeId, fName, lName, email, salary = menu.add_employee(employees) employees = data.add_employee(employees, employeeId, fName, lName, email, salary) data.save_data('employee_db.txt', employees) elif option == menu.DELETE_EMPLOYEE: employee_position, employee = menu.remove_employee(employees) employees = data.remove_employee(employees, employee_position, employee) data.save_data('employee_db.txt', employees) elif option == menu.GIVE_BONUS: bonus = menu.save_bonus_info(employees) bonus_db = data.save_bonus_info(employees, bonus) data.save_data('bonus_db.txt', bonus_db) elif option == menu.REPORT:
# Color picker and stamps if rects.color_picker_rect.collidepoint( mpos) and mb[0] == 1 and not show_dialog and not drawing: current_color = main.get_at(mpos) color_pos = mpos for s in range(len(stamp_list)): main.blit(stamp_list[s], stamp_location[s]) draw.circle(main, background_color, (color_pos), 3) draw.circle(main, (0, 0, 0), (color_pos), 3, 1) # Menu if show_menu and not show_dialog: item_click = menu.show(main, mpos) if mb[0] == 1: if item_click == "lock": lockscreen = True show_menu = False lock_count = 1 main_count = 1 elif item_click == "reset": reset() elif item_click == "help": show_dialog = True current_dialog = 1 show_menu = False elif item_click == "about": show_dialog = True current_dialog = 0
def show_menu(message): menu.show(message, message.from_user.id)
def show_menu(menu): menu.show()
main.blit(size_text, (940, 584)) # Color picker and stamps if rects.color_picker_rect.collidepoint(mpos) and mb[0] == 1 and not show_dialog and not drawing: current_color = main.get_at(mpos) color_pos = mpos for s in range(len(stamp_list)): main.blit(stamp_list[s], stamp_location[s]) draw.circle(main, background_color, (color_pos), 3) draw.circle(main, (0,0,0), (color_pos), 3, 1) # Menu if show_menu and not show_dialog: item_click = menu.show(main, mpos) if mb[0] == 1: if item_click == "lock": lockscreen = True show_menu = False lock_count = 1 main_count = 1 elif item_click == "reset": reset() elif item_click == "help": show_dialog = True current_dialog = 1 show_menu = False elif item_click == "about": show_dialog = True current_dialog = 0