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
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

117 lines
3.4KB

  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. return render_template('index.html')
  15. # route for active theme page
  16. @hidden.route('/hidden/active/')
  17. def active():
  18. with open('content/section_3/active.md', 'r') as f:
  19. text = f.read()
  20. text = markdown.markdown(text)
  21. results = solr.get_number_random_records('active', 10)
  22. return render_template('theme.html', text=text, results=results)
  23. # route for self-defending theme page
  24. @hidden.route('/hidden/defending/')
  25. def defending():
  26. with open('content/section_3/defending.md', 'r') as f:
  27. text = f.read()
  28. text = markdown.markdown(text)
  29. results = solr.get_number_random_records('defending', 10)
  30. return render_template('theme.html', text=text, results=results)
  31. # route for expanding theme page
  32. @hidden.route('/hidden/expanding/')
  33. def expanding():
  34. with open('content/section_3/expanding.md', 'r') as f:
  35. text = f.read()
  36. text = markdown.markdown(text)
  37. results = solr.get_number_random_records('expanding', 10)
  38. return render_template('theme.html', text=text, results=results)
  39. # route for invisible theme page
  40. @hidden.route('/hidden/invisible/')
  41. def invisible():
  42. with open('content/section_3/invisible.md', 'r') as f:
  43. text = f.read()
  44. text = markdown.markdown(text)
  45. results = solr.get_number_random_records('invisible', 10)
  46. return render_template('theme.html', text=text, results=results)
  47. # route for multispecies theme page
  48. @hidden.route('/hidden/multispecies/')
  49. def multispecies():
  50. with open('content/section_3/multispecies.md', 'r') as f:
  51. text = f.read()
  52. text = markdown.markdown(text)
  53. results = solr.get_number_random_records('multispecies', 10)
  54. return render_template('theme.html', text=text, results=results)
  55. # route for pissing theme page
  56. @hidden.route('/hidden/pissing/')
  57. def pissing():
  58. with open('content/section_3/pissing.md', 'r') as f:
  59. text = f.read()
  60. text = markdown.markdown(text)
  61. results = solr.get_number_random_records('pissing', 10)
  62. return render_template('theme.html', text=text, results=results)
  63. # route for secret theme page
  64. @hidden.route('/hidden/secret/')
  65. def secret():
  66. with open('content/section_3/secret.md', 'r') as f:
  67. text = f.read()
  68. text = markdown.markdown(text)
  69. results = solr.get_number_random_records('secret', 10)
  70. return render_template('theme.html', text=text, results=results)
  71. # route for surviving theme page
  72. @hidden.route('/hidden/surviving/')
  73. def surviving():
  74. with open('content/section_3/surviving.md', 'r') as f:
  75. text = f.read()
  76. text = markdown.markdown(text)
  77. results = solr.get_number_random_records('surviving', 10)
  78. return render_template('theme.html', text=text, results=results)
  79. # route for working theme page
  80. @hidden.route('/hidden/working/')
  81. def working():
  82. with open('content/section_3/working.md', 'r') as f:
  83. text = f.read()
  84. text = markdown.markdown(text)
  85. results = solr.get_number_random_records('working', 10)
  86. return render_template('theme.html', text=text, results=results)