def get_page_context(page, target): context = dict( (k, getattr(page, k)) for k in ('title', 'content') ) url = page.url if url.startswith('/'): url = url[1:] context['url'] = url path = utils.url2path(context['url']) if path.endswith(os.path.sep): path += 'index.html' else: path += '.html' context['path'] = os.path.join(target, path) return context
def check(cls, entry): res = entry.path.startswith(utils.url2path(self.prefix)) return res