diff --git a/build.py b/build.py index 6c1d96f..a3b293f 100755 --- a/build.py +++ b/build.py @@ -17,13 +17,17 @@ sys.path.insert(0, ".") from mako.template import Template from mako.lookup import TemplateLookup +from toolserver.cookies import parse_cookies + def main(environ, start_response): lookup = TemplateLookup(directories=["{{pages_dir}}"], input_encoding="utf8") template = Template(filename="{{src}}", module_directory="{{temp_dir}}", lookup=lookup, format_exceptions=True) headers = [("Content-Type", "text/html")] - page = template.render(environ=environ, headers=headers).encode("utf8") + cookies = parse_cookies(environ) + page = template.render(environ=environ, headers=headers, + cookies=cookies).encode("utf8") start_response("200 OK", headers) return [page] diff --git a/pages/copyvios.mako b/pages/copyvios.mako index 3c2a058..deba046 100644 --- a/pages/copyvios.mako +++ b/pages/copyvios.mako @@ -1,9 +1,7 @@ -<%include file="/support/header.mako" args="environ=environ, title='Copyvio Detector', add_css=('copyvios.css',), add_js=('copyvios.js',)"/>\ +<%include file="/support/header.mako" args="environ=environ, cookies=cookies, title='Copyvio Detector', add_css=('copyvios.css',), add_js=('copyvios.js',)"/>\ <%namespace module="toolserver.copyvios" import="main, highlight_delta"/>\ -<%namespace module="toolserver.cookies" import="parse_cookies"/>\ <%namespace module="toolserver.misc" import="urlstrip"/>\ <% query, bot, all_langs, all_projects, page, result = main(environ) %> -<% cookies = parse_cookies(environ) %>
This tool attempts to detect copyright violations in articles. Simply give the title of the page you want to check and hit Submit. The tool will then search for its content elsewhere on the web and display a report if a similar webpage is found. If you also provide a URL, it will not query any search engines and instead display a report comparing the article to that particular webpage, like the Duplication Detector. Check out the FAQ for more information and technical details.