librelist archives

« back to archive

Flask-AutoIndex

Flask-AutoIndex

From:
Lee Heung-sub
Date:
2010-09-01 @ 08:35
Hi, all!

I've released Flask-AutoIndex(http://pypi.python.org/pypi/Flask-AutoIndex/).
Please review this extension.

Documentation: http://docs.sublee.kr/flask-autoindex/
Demo: http://labs.sublee.kr/

:) pika.

-- 
*Lee Heung-sub
Mobile: +82-10-3215-2380
Site: http://sublee.kr/
GitHub: http://github.com/heungsub
*

Re: [flask] Flask-AutoIndex

From:
Dag Odenhall
Date:
2010-09-02 @ 12:20
On Wed, 2010-09-01 at 17:35 +0900, Lee Heung-sub wrote:
> Hi, all!

> I've released
> Flask-AutoIndex(http://pypi.python.org/pypi/Flask-AutoIndex/).
> Please review this extension.

Maybe a way to not mount at / would be useful. Maybe better than
instantiating the extension for an app would be to provide either
Response subclasses or functions that return Responses (or
current_app.response_class) so you can route yourself:

@app.route('/images/<path:path>')
def images(path):
    return render_image_gallery(path, [root=]'images',
                                [thumbs=]lambda fn: 'thumb_' + fn)
    # param root: Relative to app/static/
    # param thumbs: callable returning thumbnail for an image

Then you have render_file_index etc, for whatever presentations are
useful.

Would be nice if text files would be rendered with Pygments; including a
link to the raw file. Similarly images could be rendered in a HTML
document with prev/next buttons. Technically this could be guided by the
Accept HTTP header and the presence of keys in the query:

Serve file: /images/lolcat.jpg
View file: /images/lolcat.jpg?view (or ?html or ?preview or whatever)

On my 1920 pixel wide screen the full-width layout is a little too wide.
Maybe an optional fixed-width layout could be neat. I think it is
already possible to override the templates; if so, it would be good if
that possibility is kept; if not, it would be good to add.

Maybe directory descriptions, such as showing the README, supplying a
description string with render calls (so you can render_template)…

Re: [flask] Flask-AutoIndex

From:
LeafStorm
Date:
2010-09-01 @ 11:21
On 09/01/2010 04:35 AM, Lee Heung-sub wrote:
> Hi, all!
>
> I've released Flask-AutoIndex(http://pypi.python.org/pypi/Flask-AutoIndex/).
> Please review this extension.
>
> Documentation: http://docs.sublee.kr/flask-autoindex/
> Demo: http://labs.sublee.kr/

The code itself looks pretty solid. The docs could use some improvement, 
but so could everyone's docs. It would be interesting if you could add a 
function that controls how certain files are rendered - for example, you 
could set one for .md and .markdown files that renders them as HTML 
instead of just sending you the content.

This isn't directly related to your app itself, but if lots of people 
start wanting to use the Silk icon theme in their own extensions, then 
that could add up to a lot of wasted space. It might be good to have a 
Flask-Silk extension that just ships the icons and a few utilities.
-- 
Regards, Matthew "LeafStorm" Frazier
http://leafstorm.us/

Re: [flask] Flask-AutoIndex

From:
Lee Heung-sub
Date:
2010-09-02 @ 11:40
I accepted the your idea. So I tried to divide silk icons from
flask-autoindex by flask-silk(http://packages.python.org/flask-silk).

Thanks for good idea.

:D pika

2010/9/1 LeafStorm <leafstormrush@gmail.com>

> On 09/01/2010 04:35 AM, Lee Heung-sub wrote:
> > Hi, all!
> >
> > I've released Flask-AutoIndex(
> http://pypi.python.org/pypi/Flask-AutoIndex/).
> > Please review this extension.
> >
> > Documentation: http://docs.sublee.kr/flask-autoindex/
> > Demo: http://labs.sublee.kr/
>
> The code itself looks pretty solid. The docs could use some improvement,
> but so could everyone's docs. It would be interesting if you could add a
> function that controls how certain files are rendered - for example, you
> could set one for .md and .markdown files that renders them as HTML
> instead of just sending you the content.
>
> This isn't directly related to your app itself, but if lots of people
> start wanting to use the Silk icon theme in their own extensions, then
> that could add up to a lot of wasted space. It might be good to have a
> Flask-Silk extension that just ships the icons and a few utilities.
> --
> Regards, Matthew "LeafStorm" Frazier
> http://leafstorm.us/
>



-- 
*Lee Heung-sub
Mobile: +82-10-3215-2380
Site: http://sublee.kr/
GitHub: http://github.com/sublee
*

Re: [flask] Flask-AutoIndex

From:
Armin Ronacher
Date:
2010-09-02 @ 11:56
Hi,

On 2010-09-02 1:40 PM, Lee Heung-sub wrote:
> I accepted the your idea. So I tried to divide silk icons from
> flask-autoindex by flask-silk(http://packages.python.org/flask-silk).
Can you rename this to Flask-Silk for consistency?  We are currently 
phasing out lowercase Flask extensions :)

That sentence also needs correction: "Silk is very awesome. It will good 
for your Flask extensions".  I suppose you mean "it will be good"

Regards,
Armin

Re: [flask] Flask-AutoIndex

From:
Lee Heung-sub
Date:
2010-09-03 @ 07:45
I did.


http://github.com/sublee/flask-silk/commit/25fa88de42cc262c1d1882931c6f3a73a16e76ef

http://github.com/sublee/flask-silk/commit/b4be0f7ab84380541f87c7ecea2466d59871dd4e


<http://github.com/sublee/flask-silk/commit/b4be0f7ab84380541f87c7ecea2466d59871dd4e>Thanks
for your good advice!

2010/9/2 Armin Ronacher <armin.ronacher@active-4.com>

> Hi,
>
> On 2010-09-02 1:40 PM, Lee Heung-sub wrote:
> > I accepted the your idea. So I tried to divide silk icons from
> > flask-autoindex by flask-silk(http://packages.python.org/flask-silk).
> Can you rename this to Flask-Silk for consistency?  We are currently
> phasing out lowercase Flask extensions :)
>
> That sentence also needs correction: "Silk is very awesome. It will good
> for your Flask extensions".  I suppose you mean "it will be good"
>
> Regards,
> Armin
>



-- 
*Lee Heung-sub
Mobile: +82-10-3215-2380
Site: http://sublee.kr/
GitHub: http://github.com/sublee
*

Re: [flask] Flask-AutoIndex

From:
Ali Afshar
Date:
2010-09-01 @ 11:07
On 1 September 2010 09:35, Lee Heung-sub <heung@sublee.kr> wrote:
> Hi, all!
> I've released Flask-AutoIndex(http://pypi.python.org/pypi/Flask-AutoIndex/).
> Please review this extension.
> Documentation: http://docs.sublee.kr/flask-autoindex/
> Demo: http://labs.sublee.kr/

Looks very nice, thank-you.