2010-05-09 14:08:02 +02:00
|
|
|
from urlparse import urlparse
|
|
|
|
|
from flask import Module, render_template, Markup
|
|
|
|
|
from werkzeug import url_quote
|
|
|
|
|
|
|
|
|
|
extensions = Module(__name__, url_prefix='/extensions')
|
|
|
|
|
|
|
|
|
|
class Extension(object):
|
|
|
|
|
|
|
|
|
|
def __init__(self, name, author, description,
|
2010-05-11 23:38:57 +02:00
|
|
|
github=None, bitbucket=None, docs=None, website=None):
|
2010-05-09 14:08:02 +02:00
|
|
|
self.name = name
|
|
|
|
|
self.author = author
|
|
|
|
|
self.description = Markup(description)
|
|
|
|
|
self.github = github
|
2010-05-11 23:38:57 +02:00
|
|
|
self.bitbucket = bitbucket
|
2010-05-09 14:08:02 +02:00
|
|
|
self.docs = docs
|
|
|
|
|
self.website = website
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def pypi(self):
|
|
|
|
|
return 'http://pypi.python.org/pypi/%s' % url_quote(self.name)
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def docserver(self):
|
|
|
|
|
if self.docs:
|
|
|
|
|
return urlparse(self.docs)[1]
|
|
|
|
|
|
|
|
|
|
database = [
|
|
|
|
|
Extension('Flask-OAuth', 'Armin Ronacher',
|
|
|
|
|
description='''
|
|
|
|
|
<p>Adds <a href="http://oauth.net/">OAuth</a> support to Flask.
|
|
|
|
|
''',
|
|
|
|
|
github='mitsuhiko/flask-oauth',
|
2010-05-11 23:38:57 +02:00
|
|
|
docs='http://packages.python.org/Flask-OAuth/'
|
2010-05-09 14:08:02 +02:00
|
|
|
),
|
|
|
|
|
Extension('Flask-OpenID', 'Armin Ronacher',
|
|
|
|
|
description='''
|
|
|
|
|
<p>Adds <a href="http://openid.net/">OpenID</a> support to Flask.
|
|
|
|
|
''',
|
|
|
|
|
github='mitsuhiko/flask-openid',
|
2010-05-11 23:38:57 +02:00
|
|
|
docs='http://packages.python.org/Flask-OpenID/'
|
|
|
|
|
),
|
2010-05-30 00:16:52 +02:00
|
|
|
Extension('Flask-Babel', 'Armin Ronacher',
|
|
|
|
|
description='''
|
2010-05-30 00:19:04 +02:00
|
|
|
<p>Adds i18n/l10n support to Flask, based on
|
2010-05-30 00:16:52 +02:00
|
|
|
<a href=http://babel.edgewall.org/>babel</a> and
|
|
|
|
|
<a href=http://pytz.sourceforge.net/>pytz</a>.
|
|
|
|
|
''',
|
|
|
|
|
github='mitsuhiko/flask-babel',
|
|
|
|
|
docs='http://packages.python.org/Flask-Babel/'
|
|
|
|
|
),
|
2010-05-11 23:38:57 +02:00
|
|
|
Extension('Flask-XML-RPC', 'Matthew Frazier',
|
|
|
|
|
description='''
|
|
|
|
|
<p>Adds <a href="http://www.xmlrpc.com/">XML-RPC</a> support to Flask.
|
|
|
|
|
''',
|
|
|
|
|
bitbucket='leafstorm/flask-xml-rpc',
|
|
|
|
|
docs='http://packages.python.org/Flask-XML-RPC/'
|
2010-05-15 23:19:13 +02:00
|
|
|
),
|
2010-05-30 21:42:20 +02:00
|
|
|
Extension('Flask-Genshi', 'Dog Odenhall',
|
|
|
|
|
description='''
|
|
|
|
|
<p>Adds support for the <a href="http://genshi.edgewall.org/">Genshi</a>
|
|
|
|
|
templating language to Flask applications.
|
|
|
|
|
''',
|
|
|
|
|
bitbucket='dag/flask-genshi',
|
|
|
|
|
docs='http://packages.python.org/Flask-Genshi/'
|
|
|
|
|
),
|
2010-05-15 23:19:13 +02:00
|
|
|
Extension('flask-csrf', 'Steve Losh',
|
|
|
|
|
description='''
|
|
|
|
|
<p>A small Flask extension for adding
|
|
|
|
|
<a href=http://en.wikipedia.org/wiki/CSRF>CSRF</a> protection.
|
|
|
|
|
''',
|
|
|
|
|
docs='http://sjl.bitbucket.org/flask-csrf/',
|
|
|
|
|
bitbucket='sjl/flask-csrf'
|
|
|
|
|
),
|
|
|
|
|
Extension('flask-lesscss', 'Steve Losh',
|
|
|
|
|
description='''
|
|
|
|
|
<p>
|
|
|
|
|
A small Flask extension that makes it easy to use
|
|
|
|
|
<a href=http://lesscss.org/>LessCSS</a> with your
|
|
|
|
|
Flask application.
|
|
|
|
|
''',
|
|
|
|
|
docs='http://sjl.bitbucket.org/flask-lesscss/',
|
|
|
|
|
bitbucket='sjl/flask-lesscss'
|
|
|
|
|
),
|
|
|
|
|
Extension('flask-urls', 'Steve Losh',
|
|
|
|
|
description='''
|
|
|
|
|
<p>
|
|
|
|
|
A collection of URL-related functions for Flask applications.
|
|
|
|
|
''',
|
|
|
|
|
docs='http://sjl.bitbucket.org/flask-urls/',
|
|
|
|
|
bitbucket='sjl/flask-urls'
|
2010-05-09 14:08:02 +02:00
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
database.sort(key=lambda x: x.name.lower())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@extensions.route('/')
|
|
|
|
|
def index():
|
|
|
|
|
return render_template('extensions/index.html', extensions=database)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@extensions.route('/creating/')
|
|
|
|
|
def creating():
|
|
|
|
|
return render_template('extensions/creating.html')
|