def set_iter(self, data): if pythonver >= 3: for page in data['query']['pages'].values(): if page['title'] == self.page.name: self._iter = iter(page.get(self.list_name, ())) return else: for page in data['query']['pages'].itervalues(): if page['title'] == self.page.name: self._iter = iter(page.get(self.list_name, ())) return raise StopIteration
def get(self, key): if key and len(key): url = page.get(key) if url: return self.redirect(url, permanent=True) self.response.set_status(404)