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
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.

__init__.py 1.9KB

2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # @name: __init__.py
  2. # @creation_date: 2022-09-07
  3. # @license: The MIT License <https://opensource.org/licenses/MIT>
  4. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  5. # @purpose: Initialises the app, SQLAlchemy, and configuration variables
  6. # @acknowledgements:
  7. # https://www.digitalocean.com/community/tutorials/how-to-add-authentication-to-your-app-with-flask-login
  8. # Config stuff adapted from https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms
  9. from flask import Flask, session
  10. from flask_moment import Moment
  11. import os
  12. # initiate Moment for datetime functions
  13. moment = Moment()
  14. def create_app():
  15. app = Flask(__name__)
  16. # get the secret key so sessions work
  17. secret = os.getenv('SECRET_KEY')
  18. app.secret_key = secret
  19. moment.init_app(app)
  20. # blueprint for main parts of app (contents and frontmatter)
  21. from .main import main as main_blueprint
  22. app.register_blueprint(main_blueprint)
  23. # blueprint for search parts of app
  24. from .search import search as search_blueprint
  25. app.register_blueprint(search_blueprint)
  26. # blueprint for interferences parts of app (Section 1: Search interferences)
  27. from .interferences import interferences as interferences_blueprint
  28. app.register_blueprint(interferences_blueprint)
  29. # blueprint for hidden parts of app
  30. from .hidden import hidden as hidden_blueprint
  31. app.register_blueprint(hidden_blueprint)
  32. # blueprint for conversations parts of app (Section 2: Archive conversations)
  33. from .conversations import conversations as conversations_blueprint
  34. app.register_blueprint(conversations_blueprint)
  35. # blueprint for making parts of app (Section 3: Making of)
  36. from .making import making as making_blueprint
  37. app.register_blueprint(making_blueprint)
  38. # blueprint for data parts of app
  39. from .data import data as data_blueprint
  40. app.register_blueprint(data_blueprint)
  41. return app