Refactored website

This commit is contained in:
Armin Ronacher 2010-07-15 19:25:23 +02:00
parent ad55cb7e34
commit 857f5a8020
9 changed files with 282 additions and 272 deletions

View file

View file

@ -0,0 +1,151 @@
from urlparse import urlparse
from werkzeug import url_quote
from flask import Markup
class Extension(object):
def __init__(self, name, author, description,
github=None, bitbucket=None, docs=None, website=None):
self.name = name
self.author = author
self.description = Markup(description)
self.github = github
self.bitbucket = bitbucket
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]
extensions = [
Extension('Flask-OAuth', 'Armin Ronacher',
description='''
<p>Adds <a href="http://oauth.net/">OAuth</a> support to Flask.
''',
github='mitsuhiko/flask-oauth',
docs='http://packages.python.org/Flask-OAuth/'
),
Extension('Flask-OpenID', 'Armin Ronacher',
description='''
<p>Adds <a href="http://openid.net/">OpenID</a> support to Flask.
''',
github='mitsuhiko/flask-openid',
docs='http://packages.python.org/Flask-OpenID/'
),
Extension('Flask-Babel', 'Armin Ronacher',
description='''
<p>Adds i18n/l10n support to Flask, based on
<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/'
),
Extension('Flask-SQLAlchemy', 'Armin Ronacher',
description='''
<p>Adds SQLAlchemy support to Flask. Quick and easy.
''',
github='mitsuhiko/flask-sqlalchemy',
docs='http://packages.python.org/Flask-SQLAlchemy/'
),
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/'
),
Extension('Flask-CouchDB', 'Matthew Frazier',
description='''
<p>Adds <a href="http://couchdb.apache.org/">CouchDB</a> support to Flask.
''',
bitbucket='leafstorm/flask-couchdb',
docs='http://packages.python.org/Flask-CouchDB/'
),
Extension('Flask-Uploads', 'Matthew Frazier',
description='''
<p>Flask-Uploads allows your application to flexibly and
efficiently handle file uploading and serving the uploaded files.
You can create different sets of uploads - one for document
attachments, one for photos, etc.
''',
bitbucket='leafstorm/flask-uploads',
docs='http://packages.python.org/Flask-Uploads/'
),
Extension('Flask-Genshi', 'Dag 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/'
),
Extension('flask-mail', 'Dan Jacob',
description='''
<p>Makes sending mails from Flask applications very easy and
has also support for unittesting.
''',
bitbucket='danjac/flask-mail',
docs='http://packages.python.org/flask-mail/'
),
Extension('Flask-WTF', 'Dan Jacob',
description='''
<p>Flask-WTF offers simple integration with WTForms. This
integration includes optional CSRF handling for greater security.
''',
bitbucket='danjac/flask-wtf',
docs='http://packages.python.org/Flask-WTF/'
),
Extension('Flask-Testing', 'Dan Jacob',
description='''
<p>The Flask-Testing extension provides unit testing utilities for Flask.
''',
bitbucket='danjac/flask-testing',
docs='http://packages.python.org/Flask-Testing/'
),
Extension('Flask-Script', 'Dan Jacob',
description='''
<p>The Flask-Script extension provides support for writing external
scripts in Flask. It uses argparse to parse command line arguments.
''',
bitbucket='danjac/flask-script',
docs='http://packages.python.org/Flask-Script/'
),
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'
)
]
extensions.sort(key=lambda x: x.name.lower())

View file

@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
from urlparse import urlparse
from flask import Markup
class Project(object):
def __init__(self, name, url, description, source=None):
self.name = name
self.url = url
self.description = Markup(description)
self.source = source
@property
def host(self):
return urlparse(self.url)[1]
@property
def sourcehost(self):
if self.source is not None:
return urlparse(self.source)[1]
projects = {
'websites': [
Project('Flask Website', 'http://flask.pocoo.org/', '''
<p>
The website of the Flask microframework itself including the
mailinglist interface, snippet archive and extension registry.
'''),
Project('Brightonpy', 'http://brightonpy.org/', '''
<p>
The website of the Brighton Python User Group
''', source='http://github.com/j4mie/brightonpy.org/'),
Project('vlasiku.lojban.org', 'http://vlasisku.lojban.org/', '''
<p>
An intelligent search engine for the Lojban dictionary.
'''),
Project(u's h o r e … software development', 'http://shore.be/', '''
<p>Corporate website of Shore Software Development.
'''),
# this one might change URL soon, check on each update
Project('rdrei.net', 'http://new.rdrei.net/', '''
<p>Personal website of Pascal Hartig.
'''),
],
'apps': [
Project('960 Layout System', 'http://960ls.atomidata.com/', '''
<p>
The generator of the 960 Layout System is powered by Flask. It
generates downloadable 960 stylesheets.
'''),
Project('hg-review', 'http://review.stevelosh.com/', '''
<p>
hg-review is a code review system for Mercurial. It is available
GPL2 license.
''', source='http://bitbucket.org/sjl/hg-review/'),
Project('geocron', 'http://geocron.us/', '''
<p>
By combining your present location with the time of day, geocron
automates your life.
<p>
When you get to your Metro station during the commute home,
geocron can send a text message reading "Pick me up dear" to your
spouse.
'''),
Project('Cockerel', 'http://dcolish.github.com/Cockerel/', '''
<p>An Online Logic Assistent Based on Coq.
''', source='http://github.com/dcolish/Cockerel'),
Project('Ryshcate', 'http://ryshcate.leafstorm.us/', '''
<p>
Ryshcate is a Flask powered pastebin with sourcecode
available.
''', source='http://bitbucket.org/leafstorm/ryshcate/')
]
}
# order projects by name
for _category in projects.itervalues():
_category.sort(key=lambda x: x.name.lower())
del _category