示例#1
0
文件: bf2cyrax.py 项目: Disassem/pyo3
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
示例#2
0
文件: _lk4d4.py 项目: Disassem/pyo3
 def check(cls, entry):
     res = entry.path.startswith(utils.url2path(self.prefix))
     return res