mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-22 13:11:56 +00:00
* global: migrate setup.py to setup.cfg * global: clean up copyright notices and tests * migrate to use black as opinionated auto formater * add .git-blame-ignore-revs
31 lines
896 B
Python
31 lines
896 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
# Copyright (C) 2020-2022 Graz University of Technology.
|
|
#
|
|
# invenio-config-tugraz is free software; you can redistribute it and/or
|
|
# modify it under the terms of the MIT License; see LICENSE file for more
|
|
# details.
|
|
|
|
"""invenio module that adds tugraz configs."""
|
|
from . import config
|
|
|
|
|
|
class InvenioConfigTugraz(object):
|
|
"""invenio-config-tugraz extension."""
|
|
|
|
def __init__(self, app=None):
|
|
"""Extension initialization."""
|
|
if app:
|
|
self.init_app(app)
|
|
|
|
def init_app(self, app):
|
|
"""Flask application initialization."""
|
|
self.init_config(app)
|
|
app.extensions["invenio-config-tugraz"] = self
|
|
|
|
def init_config(self, app):
|
|
"""Initialize configuration."""
|
|
for k in dir(config):
|
|
if k.startswith("INVENIO_CONFIG_TUGRAZ_"):
|
|
app.config.setdefault(k, getattr(config, k))
|