A tool that evaluates high-risk Wikipedia templates https://tools.wmflabs.org/earwig-dev/tif
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.
 
 
 
 

24 lines
610 B

  1. #! /data/project/earwig-dev/env/bin/python
  2. # -*- coding: utf-8 -*-
  3. from flask import Flask, request
  4. from flask.ext.mako import MakoTemplates, render_template
  5. from tif.calc import calculate_tif
  6. from tif.util import catch_errors, set_up_hash_caching
  7. app = Flask(__name__)
  8. MakoTemplates(app)
  9. set_up_hash_caching(app)
  10. @app.route("/")
  11. @catch_errors(app)
  12. def index():
  13. title = request.args.get("title")
  14. result = calculate_tif(title) if title else {}
  15. return render_template("index.mako", result=result)
  16. if __name__ == '__main__':
  17. from flup.server.fcgi import WSGIServer
  18. WSGIServer(app).run()