def _check_out(self): """ Allows the user to check out items. """ logger.debug("Enter") item_lists = [self.common_tools, self.uncommon_tools, self.common_keys, self.uncommon_keys] item_set = Shelf() for item in item_lists: item_set.extend(item.items_out()) # Update latest checked out items. item_set.update_names() item_set_names = self.tools.trim_items(item_set.items_out_by_name()) # Make sure we have some items checked out. if not item_set_names: self._create_dialog_msg(False, "Please either hit 'Cancel' or select some items to check out.") return item_set.remove_clicks() for item in item_set_names: if 'laptop' in item or 'lrduo' in item: self._create_dialog_acknowledge() # Should display only if a fluke or laptop is in the items list break self.tools.checkout_items(self.current_user, item_set_names, self._get_building_number()) self.inventory.update(item_set_names) self._switch_frame('login') logger.debug("Exit")
def _check_out(self): """ Allows the user to check out items. """ logger.debug("Enter") item_lists = [ self.common_tools, self.uncommon_tools, self.common_keys, self.uncommon_keys ] item_set = Shelf() for item in item_lists: item_set.extend( item.items_out()) # Update latest checked out items. item_set.update_names() item_set_names = self.tools.trim_items(item_set.items_out_by_name()) # Make sure we have some items checked out. if not item_set_names: self._create_dialog_msg( False, "Please either hit 'Cancel' or select some items to check out." ) return item_set.remove_clicks() for item in item_set_names: if 'laptop' in item or 'lrduo' in item: self._create_dialog_acknowledge( ) # Should display only if a fluke or laptop is in the items list break self.tools.checkout_items(self.current_user, item_set_names, self._get_building_number()) self.inventory.update(item_set_names) self._switch_frame('login') logger.debug("Exit")