def completedefault(self, text, line, start, end): if re.match(r'([a-z-]+ +){2,}', line): return [] lists = set(utils.read_log().keys()).union( set(utils.read_cache(complete=True))) match = filter(lambda t: t.startswith(text), lists) return utils.completion_list(match)
def complete_url(self, text, line, *ignored): lists = set(utils.read_log().keys()).union( set(utils.read_cache(complete=True))) urls = map( lambda name: commands.anime_source_module.get_episode_url( name, ''), lists) match = filter(lambda t: t.startswith(text), urls) return utils.completion_list(match)
def complete_listlocal(self, text, line, *ignored): animes = utils.get_local_episodes() match = filter(lambda t: t.startswith(text), animes.keys()) return utils.completion_list(match)
def complete_unsave(self, text, line, *ignored): return utils.completion_list( filter(lambda x: re.match(text, x), utils.read_log(logfile=config.watchlaterfile).keys()))
def complete_untrack(self, text, line, start, end): if re.match(r'([a-z-]+ +){2,}', line): return [] lists = utils.read_log(logfile=config.ongoingfile).keys() match = filter(lambda t: t.startswith(text), lists) return utils.completion_list(match)
def complete_fullscreen(self, text, *ignored): possibilities = ['yes', 'no', 'on', 'off'] match = filter(lambda t: t.startswith(text), possibilities) return utils.completion_list(match)
def complete_geometry(self, *ignored): return utils.completion_list([config.geometry])