A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
797 B

  1. # -*- coding: utf-8 -*-
  2. from .checker import get_results
  3. from .highlighter import highlight_delta
  4. from .misc import get_bot, Query
  5. from .sites import get_site, get_sites
  6. def main(context, environ):
  7. query = Query(environ)
  8. if query.lang:
  9. query.lang = query.orig_lang = query.lang.lower()
  10. if "::" in query.lang:
  11. query.lang, query.name = query.lang.split("::", 1)
  12. if query.project:
  13. query.project = query.project.lower()
  14. bot = get_bot()
  15. all_langs, all_projects = get_sites(bot)
  16. page = result = None
  17. if query.lang and query.project and query.title:
  18. site = get_site(bot, query, all_projects)
  19. if site:
  20. page, result = get_results(bot, site, query)
  21. return query, bot, all_langs, all_projects, page, result