flask-fbapi
flask-fbapi copied to clipboard
Extension does not support multiple apps
The extension currently stores the application on self in all cases, even if initialized with init_app. This is something Flask extensions should not really do if they can avoid it. :)
Not a big deal. Whole FbApi object is a last minute addition to make it extension friendly.
I need from it ctx.token_storage and ctx.token_storage.open(). self.app is not used.
In fact putting ctx.token_storage.open() on before_request and teardown_request (close()) is by the book but seems to be an unnecessary step. I need it only for decorated views and decorator could do it by himself, but... There will be a need to pass app as a decorator argument. Will it be OK?
Second question, since I have you there :) How should the view be defined by an extension? App object is not available.
Ah damn. Missed that ticket somehow.
Second question, since I have you there :) How should the view be defined by an extension? App object is not available.
Register all that needs to be registered when init_app is called. At that point you do have the app. Local functions with closures help :-)