示例#1
0
文件: web.py 项目: eXcomm/onionshare
def page_not_found(e):
    """
    404 error page.
    """
    add_request(REQUEST_OTHER, request.path)
    return render_template_string(
        open(helpers.get_html_path('404.html')).read())
示例#2
0
文件: web.py 项目: vetesii/onionshare
def index():
    """
    Render the template for the onionshare landing page.
    """
    add_request(REQUEST_LOAD, request.path)
    return render_template_string(
        open(helpers.get_html_path('index.html')).read(),
        slug=slug,
        file_info=file_info,
        filename=os.path.basename(zip_filename).decode("utf-8"),
        filesize=zip_filesize,
        filesize_human=helpers.human_readable_filesize(zip_filesize)
    )
示例#3
0
def index(slug_candidate):
    if not helpers.constant_time_compare(slug.encode('ascii'),
                                         slug_candidate.encode('ascii')):
        abort(404)

    add_request(REQUEST_LOAD, request.path)
    return render_template_string(
        open(helpers.get_html_path('index.html')).read(),
        slug=slug,
        file_info=file_info,
        filename=os.path.basename(zip_filename).decode("utf-8"),
        filesize=zip_filesize,
        filesize_human=helpers.human_readable_filesize(zip_filesize),
        strings=strings.strings)
示例#4
0
文件: web.py 项目: RayJoha/onionshare
def index(slug_candidate):
    if not helpers.constant_time_compare(slug.encode('ascii'), slug_candidate.encode('ascii')):
        abort(404)

    add_request(REQUEST_LOAD, request.path)
    return render_template_string(
        open(helpers.get_html_path('index.html')).read(),
        slug=slug,
        file_info=file_info,
        filename=os.path.basename(zip_filename).decode("utf-8"),
        filesize=zip_filesize,
        filesize_human=helpers.human_readable_filesize(zip_filesize),
        strings=strings.strings
    )
示例#5
0
文件: web.py 项目: RayJoha/onionshare
def page_not_found(e):
    add_request(REQUEST_OTHER, request.path)
    return render_template_string(open(helpers.get_html_path('404.html')).read())