ext.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:invenio-github 作者: inveniosoftware 项目源码 文件源码
def init_app(self, app):
        """Flask application initialization."""
        self.init_config(app)
        app.extensions['invenio-github'] = self

        @app.before_first_request
        def connect_signals():
            """Connect OAuthClient signals."""
            from invenio_oauthclient.models import RemoteAccount
            from invenio_oauthclient.signals import account_setup_committed

            from .api import GitHubAPI
            from .handlers import account_post_init

            account_setup_committed.connect(
                account_post_init,
                sender=GitHubAPI.remote._get_current_object()
            )

            @event.listens_for(RemoteAccount, 'before_delete')
            def receive_before_delete(mapper, connection, target):
                """Listen for the 'before_delete' event."""
                # TODO remove hooks
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号