A search interface for the Performing Patents Otherwise publication as part of the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office OPS API. https://patents.copim.ac.uk
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

93 lines
2.7KB

  1. # @name: hidden.py
  2. # @creation_date: 2022-10-27
  3. # @license: The MIT License <https://opensource.org/licenses/MIT>
  4. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  5. # @purpose: hidden route for Section 3: Hidden in plain sight
  6. # @acknowledgements:
  7. from flask import Blueprint, render_template
  8. from . import solr
  9. import markdown
  10. hidden = Blueprint('hidden', __name__)
  11. # route for hidden page
  12. @hidden.route('/hidden/')
  13. def index():
  14. with open('content/section_3/intro-hidden.md', 'r') as f:
  15. text = f.read()
  16. text = markdown.markdown(text)
  17. return render_template('hidden.html', text=text)
  18. # route for expanding theme page
  19. @hidden.route('/hidden/expanding/')
  20. def expanding():
  21. core = 'expanding'
  22. with open('content/section_3/expanding.md', 'r') as f:
  23. text = f.read()
  24. text = markdown.markdown(text)
  25. results = solr.get_number_random_records(core, 10)
  26. return render_template('theme.html', text=text, results=results, core=core)
  27. # route for active theme page
  28. @hidden.route('/hidden/active/')
  29. def active():
  30. core = 'active'
  31. with open('content/section_3/active.md', 'r') as f:
  32. text = f.read()
  33. text = markdown.markdown(text)
  34. results = solr.get_number_random_records(core, 10)
  35. return render_template('theme.html', text=text, results=results, core=core)
  36. # route for secret theme page
  37. @hidden.route('/hidden/secret/')
  38. def secret():
  39. core = 'secret'
  40. with open('content/section_3/secret.md', 'r') as f:
  41. text = f.read()
  42. text = markdown.markdown(text)
  43. results = solr.get_number_random_records(core, 10)
  44. return render_template('theme.html', text=text, results=results, core=core)
  45. # route for leaking theme page
  46. @hidden.route('/hidden/leaking/')
  47. def leaking():
  48. core = 'leaking'
  49. with open('content/section_3/leaking.md', 'r') as f:
  50. text = f.read()
  51. text = markdown.markdown(text)
  52. results = solr.get_number_random_records(core, 10)
  53. return render_template('theme.html', text=text, results=results, core=core)
  54. # route for working theme page
  55. @hidden.route('/hidden/working/')
  56. def working():
  57. core = 'working'
  58. with open('content/section_3/working.md', 'r') as f:
  59. text = f.read()
  60. text = markdown.markdown(text)
  61. results = solr.get_number_random_records(core, 10)
  62. return render_template('theme.html', text=text, results=results, core=core)
  63. # route for resourceful theme page
  64. @hidden.route('/hidden/resourceful/')
  65. def resourceful():
  66. core = 'resourceful'
  67. with open('content/section_3/resourceful.md', 'r') as f:
  68. text = f.read()
  69. text = markdown.markdown(text)
  70. results = solr.get_number_random_records(core, 10)
  71. return render_template('theme.html', text=text, results=results, core=core)