def __load(self): """ Loads the object state from the cache or regenerate it if necessary @rtype: None @returns: Nothing """ data = None try: data = self.__cache.load() # cache must be created except ReloadException: # get all desktop files found desktop = DesktopParser() self.__desktop_files = desktop.getDesktopFiles() # get the menu list menu = MenuParser(MENU_FILE) menu_items = menu.getMenu() # retrieve only the siblings of the root node child self.__categories = menu.getSiblings(menu_items.getSubItem()) self.__mapItems() self.__save() return # load categories from cache data self.__categories = set(data[MENU_BASE_DIR].values()[0]) # load desktop files based on cache try : desktop = DesktopParser(data[DESKTOP_DIR].values()[0]) self.__desktop_files = desktop.getDesktopFiles() # data from cache is not ok, panic except RuntimeError, e: return