def search(self): kb = self.xbmc.Keyboard('', 'Search', False) kb.doModal() if kb.isConfirmed(): text = kb.getText() matches = dreamfilm.scrap_search(dreamfilm.search(text)) for m in matches: self.add_movie_list_item(m[0], m[1]) self.xbmcplugin.endOfDirectory(self.handle)