This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
Early application access is broken #89
Comments
Here what I want to be able to write: manager = Manager(create_app)
def register_commands(manager):
manager.add_command('clean', Clean())
manager.add_command('urls', ShowUrls())
for module in manager.app.config['PLUGINS']:
try:
__import__('myapp.plugins.{0}.commands'.format(module))
except:
pass
if __name__ == '__main__':
register_commands(manager)
manager.run() and in a plugin (ex: myapp.plugins.sample.commands): from myapp.commands import manager
@manager.command
def do_something():
'''Do smething'''
pass |
Any news on this issue ? Not being able to register commands late or to access config early is really blocking me right now :/ |
That is still possible, you just need to go about it differently. From my own code:
Handling new "top-level" commands incrementally would be a major redesign of flask-script's interpreter loop. Pull requests gladly accepted. |
Thanks, I will try your approach. If I find the time and a good design, I will submit a pull-request ! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The commit 44c1c1a broke the early app access provided by #34
As a consequence, it's not possible anymore to dynamically add commands depending on an application setting.
The text was updated successfully, but these errors were encountered: