Permalink
Browse files

* Import Flask framework into source tree, make modifications to enab…

…le serving of minified files and use CDN.

* Reoptimise images.
* Move Google font CSS into main style file.
  • Loading branch information...
1 parent f1cdfd1 commit 132ef7874884751388ca77fdbd03d9164af7622c @dannyakakong committed Jan 11, 2014
Showing with 5,401 additions and 3 deletions.
  1. +50 −0 ext/flask/__init__.py
  2. +73 −0 ext/flask/_compat.py
  3. +1,842 −0 ext/flask/app.py
  4. +401 −0 ext/flask/blueprints.py
  5. +168 −0 ext/flask/config.py
  6. +394 −0 ext/flask/ctx.py
  7. +87 −0 ext/flask/debughelpers.py
  8. +29 −0 ext/flask/ext/__init__.py
  9. +120 −0 ext/flask/exthook.py
  10. +44 −0 ext/flask/globals.py
  11. +866 −0 ext/flask/helpers.py
  12. +228 −0 ext/flask/json.py
  13. +45 −0 ext/flask/logging.py
  14. +42 −0 ext/flask/module.py
  15. +327 −0 ext/flask/sessions.py
  16. +55 −0 ext/flask/signals.py
  17. +143 −0 ext/flask/templating.py
  18. +124 −0 ext/flask/testing.py
  19. +149 −0 ext/flask/views.py
  20. +184 −0 ext/flask/wrappers.py
  21. +7 −1 init.py
  22. +22 −0 static/css/style.css
  23. +1 −1 static/css/style.min.css
  24. BIN static/img/logo.png
  25. BIN static/img/powered-long.png
  26. BIN static/img/powered.png
  27. BIN static/img/screenshots/1.30/classify.png
  28. BIN static/img/screenshots/1.30/developers.png
  29. BIN static/img/screenshots/1.30/digests.png
  30. BIN static/img/screenshots/1.30/features.png
  31. BIN static/img/screenshots/1.30/home.png
  32. BIN static/img/screenshots/1.30/login.png
  33. BIN static/img/screenshots/1.30/media.png
  34. BIN static/img/screenshots/1.30/review.png
  35. BIN static/img/screenshots/1.30/settings.png
  36. BIN static/img/screenshots/1.30/setup.png
  37. BIN static/img/screenshots/1.30/thumbnails/classify.png
  38. BIN static/img/screenshots/1.30/thumbnails/developers.png
  39. BIN static/img/screenshots/1.30/thumbnails/digests.png
  40. BIN static/img/screenshots/1.30/thumbnails/features.png
  41. BIN static/img/screenshots/1.30/thumbnails/home.png
  42. BIN static/img/screenshots/1.30/thumbnails/login.png
  43. BIN static/img/screenshots/1.30/thumbnails/media.png
  44. BIN static/img/screenshots/1.30/thumbnails/review.png
  45. BIN static/img/screenshots/1.30/thumbnails/settings.png
  46. BIN static/img/screenshots/1.30/thumbnails/setup.png
  47. BIN static/img/screenshots/1.30/thumbnails/users.png
  48. BIN static/img/screenshots/1.30/users.png
  49. +0 −1 templates/base/structure.html
View
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+"""
+ flask
+ ~~~~~
+
+ A microframework based on Werkzeug. It's extensively documented
+ and follows best practice patterns.
+
+ :copyright: (c) 2011 by Armin Ronacher.
+ :license: BSD, see LICENSE for more details.
+"""
+
+__version__ = '0.10'
+
+# utilities we import from Werkzeug and Jinja2 that are unused
+# in the module but are exported as public interface.
+from werkzeug.exceptions import abort
+from werkzeug.utils import redirect
+from jinja2 import Markup, escape
+
+from .app import Flask, Request, Response
+from .config import Config
+from .helpers import url_for, flash, send_file, send_from_directory, \
+ get_flashed_messages, get_template_attribute, make_response, safe_join, \
+ stream_with_context
+from .globals import current_app, g, request, session, _request_ctx_stack, \
+ _app_ctx_stack
+from .ctx import has_request_context, has_app_context, \
+ after_this_request, copy_current_request_context
+from .module import Module
+from .blueprints import Blueprint
+from .templating import render_template, render_template_string
+
+# the signals
+from .signals import signals_available, template_rendered, request_started, \
+ request_finished, got_request_exception, request_tearing_down, \
+ appcontext_tearing_down, appcontext_pushed, \
+ appcontext_popped, message_flashed
+
+# We're not exposing the actual json module but a convenient wrapper around
+# it.
+from . import json
+
+# This was the only thing that flask used to export at one point and it had
+# a more generic name.
+jsonify = json.jsonify
+
+# backwards compat, goes away in 1.0
+from .sessions import SecureCookieSession as Session
+json_available = True
View
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+"""
+ flask._compat
+ ~~~~~~~~~~~~~
+
+ Some py2/py3 compatibility support based on a stripped down
+ version of six so we don't have to depend on a specific version
+ of it.
+
+ :copyright: (c) 2013 by Armin Ronacher.
+ :license: BSD, see LICENSE for more details.
+"""
+import sys
+
+PY2 = sys.version_info[0] == 2
+_identity = lambda x: x
+
+
+if not PY2:
+ text_type = str
+ string_types = (str,)
+ integer_types = (int, )
+
+ iterkeys = lambda d: iter(d.keys())
+ itervalues = lambda d: iter(d.values())
+ iteritems = lambda d: iter(d.items())
+
+ from io import StringIO
+
+ def reraise(tp, value, tb=None):
+ if value.__traceback__ is not tb:
+ raise value.with_traceback(tb)
+ raise value
+
+ implements_to_string = _identity
+
+else:
+ text_type = unicode
+ string_types = (str, unicode)
+ integer_types = (int, long)
+
+ iterkeys = lambda d: d.iterkeys()
+ itervalues = lambda d: d.itervalues()
+ iteritems = lambda d: d.iteritems()
+
+ from cStringIO import StringIO
+
+ exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
+
+ def implements_to_string(cls):
+ cls.__unicode__ = cls.__str__
+ cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
+ return cls
+
+
+def with_metaclass(meta, *bases):
+ # This requires a bit of explanation: the basic idea is to make a
+ # dummy metaclass for one level of class instantiation that replaces
+ # itself with the actual metaclass. Because of internal type checks
+ # we also need to make sure that we downgrade the custom metaclass
+ # for one level to something closer to type (that's why __call__ and
+ # __init__ comes back from type etc.).
+ #
+ # This has the advantage over six.with_metaclass in that it does not
+ # introduce dummy classes into the final MRO.
+ class metaclass(meta):
+ __call__ = type.__call__
+ __init__ = type.__init__
+ def __new__(cls, name, this_bases, d):
+ if this_bases is None:
+ return type.__new__(cls, name, (), d)
+ return meta(name, bases, d)
+ return metaclass('temporary_class', None, {})
Oops, something went wrong.

0 comments on commit 132ef78

Please sign in to comment.