librelist archives

« back to archive

ANN: Flask-Script

ANN: Flask-Script

From:
Dan Jacob
Date:
2010-07-05 @ 11:02
I'm working on a Flask-Script extension:

http://bitbucket.org/danjac/flask-script

This is intended to make it easy to use Flask with external scripts.
It works like this:

# manage.py

from flask import Flask
from flaskext.script import Command, Manager

from myapp import app

manager = Manager(app)

class SayHello(Command):

    def run(self, app, name):
        print "hello", name

manager.register("hello", SayHello())

if __name__ == "__main__":
    manager.run()

>>> python manage.py hello world
.... "hello world"

Support for a Flask shell and runserver are included, as well as help
support and option parsing functionality.

This is at a very early stage, so do not assume working or stable
code. However I would like to get some feedback on what people might
want from a scripting extension, so any input welcome. If anyone has a
logo or an idea for a logo that would also be welcome.

Re: [flask] ANN: Flask-Script

From:
Stephane Wirtel
Date:
2010-07-05 @ 12:17
Very useful.

Great !!

Stephane
On 07/05/2010 01:02 PM, Dan Jacob wrote:
> I'm working on a Flask-Script extension:
> 
> http://bitbucket.org/danjac/flask-script
> 
> This is intended to make it easy to use Flask with external scripts.
> It works like this:
> 
> # manage.py
> 
> from flask import Flask
> from flaskext.script import Command, Manager
> 
> from myapp import app
> 
> manager = Manager(app)
> 
> class SayHello(Command):
> 
>     def run(self, app, name):
>         print "hello", name
> 
> manager.register("hello", SayHello())
> 
> if __name__ == "__main__":
>     manager.run()
> 
>>>> python manage.py hello world
> .... "hello world"
> 
> Support for a Flask shell and runserver are included, as well as help
> support and option parsing functionality.
> 
> This is at a very early stage, so do not assume working or stable
> code. However I would like to get some feedback on what people might
> want from a scripting extension, so any input welcome. If anyone has a
> logo or an idea for a logo that would also be welcome.

Re: [flask] ANN: Flask-Script

From:
何威威
Date:
2010-07-05 @ 11:14
Very good work! We can add message queue to Flask and use this to start the
MQ server .

Re: [flask] ANN: Flask-Script

From:
Dan Jacob
Date:
2010-07-05 @ 11:16
I suppose you would rather use Celery for that, as it's no longer
Django-specific.

On 5 July 2010 12:14, 何威威 <heww0205@gmail.com> wrote:
> Very good work! We can add message queue to Flask and use this to start the
> MQ server .
>

Re: [flask] ANN: Flask-Script

From:
Armin Ronacher
Date:
2010-07-05 @ 12:19
Hi,

On 7/5/10 1:16 PM, Dan Jacob wrote:
> I suppose you would rather use Celery for that, as it's no longer
> Django-specific.
Unfortunately Celery makes the same mistake Django does and has a 
process wide configuration.  Does not mean it cannot be used with Flask 
of course, but I find that quite frustrating to see.


Regards,
Armin

Re: [flask] ANN: Flask-Script

From:
何威威
Date:
2010-07-05 @ 12:40
What about beanstalkd? http://kr.github.com/beanstalkd/

2010/7/5 Armin Ronacher <armin.ronacher@active-4.com>

> Hi,
>
> On 7/5/10 1:16 PM, Dan Jacob wrote:
> > I suppose you would rather use Celery for that, as it's no longer
> > Django-specific.
> Unfortunately Celery makes the same mistake Django does and has a
> process wide configuration.  Does not mean it cannot be used with Flask
> of course, but I find that quite frustrating to see.
>
>
> Regards,
> Armin
>

Re: [flask] ANN: Flask-Script

From:
何威威
Date:
2010-07-05 @ 11:31
Oh, thanks your suggestion. Celery looks like wonderful.

2010/7/5 Dan Jacob <danjac354@gmail.com>

> I suppose you would rather use Celery for that, as it's no longer
> Django-specific.
>
> On 5 July 2010 12:14, 何威威 <heww0205@gmail.com> wrote:
> > Very good work! We can add message queue to Flask and use this to start
> the
> > MQ server .
> >
>