Hi all, I've recently taken over as maintainer of Flask-Script and just pushed a feature I think some of you will be interested in. It is now possible to add a Manager as a command (aka submanager) to another Manager instance, thus allowing for a hierarchical command structure, for example: $ python manage.py database create $ python manage.py database drop $ python manage.py database populate $ python manage.py test unit $ python manage.py test lettuce ... where "database" is the (sub)manager with the commands "create", "drop", and "populate". If you call the manager directly ($python manage.py database), you will see the available commands available under the "database" with their help (just like the output from "python manage.py"). *Note to extension developers:* This now means that you can create a Manager instance pre-loaded with all your extension's available commands, making it easy for a user to consume all the commands. For example: from flask.ext.database import manager as database_manager manager.add_command(“database”, database_manager) For more info, look here: http://flask-script.readthedocs.org/en/latest/index.html#sub-managers http://flask-script.readthedocs.org/en/latest/index.html#note-to-extension-developers https://github.com/techniq/flask-script/pull/39 I'm especially interested in getting feedback from extension developers on how this is implemented and if it can be improved in any way. -Sean
This sounds absolutely awesome! I can now get rid of my `database_create` and `database_drop` and other such nastiness. Thanks for the awesomeness! Anthony Ford, KF5IBN, Research Assistant, Center for Advanced Radio Astronomy, University of Texas at Brownsville ford.anthonyj@gmail.com On Fri, Sep 21, 2012 at 10:00 PM, Sean Lynch <techniq35@gmail.com> wrote: > Hi all, > > I've recently taken over as maintainer of Flask-Script and just pushed a > feature I think some of you will be interested in. It is now possible to > add a Manager as a command (aka submanager) to another Manager instance, > thus allowing for a hierarchical command structure, for example: > > $ python manage.py database create > $ python manage.py database drop > $ python manage.py database populate > $ python manage.py test unit > $ python manage.py test lettuce > > ... > > > where "database" is the (sub)manager with the commands "create", "drop", > and "populate". If you call the manager directly ($python manage.py > database), you will see the available commands available under the > "database" with their help (just like the output from "python manage.py"). > > *Note to extension developers:* > This now means that you can create a Manager instance pre-loaded with all > your extension's available commands, making it easy for a user to consume > all the commands. For example: > > from flask.ext.database import manager as database_manager > manager.add_command(“database”, database_manager) > > > For more info, look here: > http://flask-script.readthedocs.org/en/latest/index.html#sub-managers > > http://flask-script.readthedocs.org/en/latest/index.html#note-to-extension-developers > https://github.com/techniq/flask-script/pull/39 > > I'm especially interested in getting feedback from extension developers on > how this is implemented and if it can be improved in any way. > > -Sean >
This is great! On Fri, Sep 21, 2012 at 11:06 PM, Anthony Ford <ford.anthonyj@gmail.com>wrote: > This sounds absolutely awesome! I can now get rid of my `database_create` > and `database_drop` and other such nastiness. > > Thanks for the awesomeness! > > Anthony Ford, > KF5IBN, > Research Assistant, > Center for Advanced Radio Astronomy, > University of Texas at Brownsville > ford.anthonyj@gmail.com > > > > On Fri, Sep 21, 2012 at 10:00 PM, Sean Lynch <techniq35@gmail.com> wrote: > >> Hi all, >> >> I've recently taken over as maintainer of Flask-Script and just pushed a >> feature I think some of you will be interested in. It is now possible >> to add a Manager as a command (aka submanager) to another Manager instance, >> thus allowing for a hierarchical command structure, for example: >> >> $ python manage.py database create >> $ python manage.py database drop >> $ python manage.py database populate >> $ python manage.py test unit >> $ python manage.py test lettuce >> >> ... >> >> >> where "database" is the (sub)manager with the commands "create", "drop", >> and "populate". If you call the manager directly ($python manage.py >> database), you will see the available commands available under the >> "database" with their help (just like the output from "python manage.py"). >> >> *Note to extension developers:* >> This now means that you can create a Manager instance pre-loaded with all >> your extension's available commands, making it easy for a user to consume >> all the commands. For example: >> >> from flask.ext.database import manager as database_manager >> manager.add_command(“database”, database_manager) >> >> >> For more info, look here: >> http://flask-script.readthedocs.org/en/latest/index.html#sub-managers >> >> http://flask-script.readthedocs.org/en/latest/index.html#note-to-extension-developers >> https://github.com/techniq/flask-script/pull/39 >> >> I'm especially interested in getting feedback from extension developers >> on how this is implemented and if it can be improved in any way. >> >> -Sean >> > >