Permalink
Browse files

versin 1.2.0

  • Loading branch information...
1 parent 2458e7e commit 3673f760bddf34ecb02d8a31f7e0af6612b0f60f @jpscaletti jpscaletti committed Jul 20, 2012
Showing with 1,431 additions and 1,375 deletions.
  1. +1 −1 AUTHORS.md
  2. +27 −0 CHANGES.md
  3. +1 −1 LEGAL.md
  4. +9 −6 README.md
  5. +10 −8 README.rst
  6. +6 −5 requirements.txt
  7. +11 −10 shake/__init__.py
  8. +94 −69 shake/app.py
  9. +0 −483 shake/babel.py
  10. +37 −22 shake/cli/__init__.py
  11. +0 −65 shake/cli/globals.py
  12. +7 −40 shake/cli/helpers.py
  13. +6 −8 shake/config.py
  14. +0 −89 shake/controllers.py
  15. 0 shake/{default_views → default_templates}/error.html
  16. 0 shake/{default_views → default_templates}/error_notallowed.html
  17. 0 shake/{default_views → default_templates}/error_notfound.html
  18. 0 shake/{default_views → default_templates}/shake_default_view.css
  19. +1 −1 shake/helpers.py
  20. +513 −0 shake/i18n.py
  21. +171 −0 shake/render.py
  22. +1 −1 shake/session.py
  23. +11 −11 shake/skeletons/project/README.md
  24. +2 −2 shake/skeletons/project/bundles/common/__init__.py
  25. +0 −26 shake/skeletons/project/bundles/common/controllers.py
  26. +26 −0 shake/skeletons/project/bundles/common/views.py
  27. +9 −13 shake/skeletons/project/bundles/users/__init__.py
  28. +2 −2 shake/skeletons/project/bundles/users/manage.py
  29. 0 shake/skeletons/project/{views/users/.gitinclude → locales/en.yml}
  30. +4 −5 shake/skeletons/project/main.py
  31. +1 −1 shake/skeletons/project/manage.py
  32. +4 −1 shake/skeletons/project/settings/base.py.tmpl
  33. +3 −3 shake/skeletons/project/settings/production.py
  34. +2 −2 shake/skeletons/project/settings/req.txt
  35. +1 −1 shake/skeletons/project/{views → templates}/common/base.html
  36. 0 shake/skeletons/project/{views → templates}/common/base_error.html
  37. 0 shake/skeletons/project/{views → templates}/common/error.html
  38. 0 shake/skeletons/project/{views → templates}/common/error_notallowed.html
  39. 0 shake/skeletons/project/{views → templates}/common/error_notfound.html
  40. +1 −1 shake/skeletons/project/{views → templates}/index.html
  41. 0 shake/skeletons/project/templates/users/.gitinclude
  42. +2 −2 shake/skeletons/resource/bundle/__init__.py.tmpl
  43. +6 −6 shake/skeletons/resource/bundle/{controllers.py.tmpl → views.py.tmpl}
  44. 0 shake/skeletons/resource/{views → templates}/edit.html.tmpl
  45. 0 shake/skeletons/resource/{views → templates}/flash.html
  46. 0 shake/skeletons/resource/{views → templates}/index.html.tmpl
  47. 0 shake/skeletons/resource/{views → templates}/show.html.tmpl
  48. +4 −3 shake/templates.py
  49. +69 −139 shake/views.py
  50. +84 −8 shake/wrappers.py
  51. +0 −1 tests/res/en-US.yml
  52. +0 −1 tests/res/en.yml
  53. +0 −1 tests/res/es.yml
  54. 0 tests/res/{view.html → tmpl.html}
  55. 0 tests/res/{view.txt → tmpl.txt}
  56. +42 −42 tests/test_app.py
  57. +0 −104 tests/test_controllers.py
  58. +13 −12 tests/test_helpers.py
  59. +174 −0 tests/test_render.py
  60. +76 −179 tests/test_views.py
View
@@ -1,6 +1,6 @@
# Authors
-Shake is written and maintained by the Lúcuma labs team:
+Shake is written and maintained by the Lúcuma team:
Project Leader / Developer:
View
@@ -0,0 +1,27 @@
+# Changes
+
+
+## Version 1.2.0
+
+- New Rails-like internationalization framework. Available at `app.i18n` or as {{ t('key_name', **kwargs) }} in the templates.
+
+- Auto-created `Render` instance at `app.render`. Uses the `'<app-path>/templates/'` folder by default.
+
+- A static folder is added by default at `'/static/ -> <app-path>/static/'` if `DEBUG=True` and no other static paths are defined.
+
+- `Shake` must be now instantiated with ``__file__'` as the first argument. Example:
+
+ app = Shake(__file__, settings)
+
+ this is used to calculate the templates, locales and static folders.
+
+- The environment setting is now loaded from the `.SHAKE_ENV` file instead from the `manage.py` script (it was unreliable for multiple `manage.py` scripts). If the files is not found, `Shake.get_env` return `'development'` by default. `Shake.set_env` create that file if it doesn't exists or overwrites it.
+
+- The `manage.py` in the default project now includes `Solution`'s fixtures related functions.
+
+- The word `'templates'` is now used instead of `'views'`, and `'views'` is now used instead of `'controllers'`.
+
+- Added a new template global function: `link_to` makes easier to create HTML anchor element for navigation, that are marked as "active" when visiting a particular URL.
+
+- General refactoring of the code.
+
View
@@ -1,6 +1,6 @@
# Legal
-© 2010 by Lúcuma labs (http://lucumalabs.com).
+© 2010 by Lúcuma (http://lucumalabs.com).
MIT License. (http://www.opensource.org/licenses/mit-license.php)
View
@@ -1,24 +1,27 @@
# Shake
-A web framework mixed from the best ingredients (Werkzeug, Jinja and maybe SQLAlchemy, babel, etc.)
+A web framework mixed from the best ingredients (Werkzeug, Jinja2 and maybe SQLAlchemy, Babel, etc.)
+
+It can be minimal like this::
```python
from shake import Shake
-app = Shake()
+app = Shake(__file__)
+app.route('/', hello)
def hello(request):
- return 'Hello World!'
-
-app.add_url('/', hello)
+ return 'Hello World!'
if __name__ == "__main__":
app.run()
```
+Or a full featured (yet configurable if needed) framework.
+
---------------------------------------
-© 2010 by [Lúcuma labs] (http://lucumalabs.com).
+© 2010 by [Lúcuma] (http://lucumalabs.com).
See `AUTHORS.md` for more details.
License: [MIT License] (http://www.opensource.org/licenses/mit-license.php).
View
@@ -1,18 +1,20 @@
-========
+================
Shake
-========
+================
-A web framework mixed from the best ingredients (Werkzeug, Jinja and maybe SQLAlchemy, babel, etc.)
+A web framework mixed from the best ingredients (Werkzeug, Jinja2 and maybe SQLAlchemy, Babel, etc.)
+
+It can be minimal like this::
-::
from shake import Shake
- app = Shake()
+ app = Shake(__file__)
+ app.route('/', hello)
def hello(request):
- return 'Hello World!'
-
- app.add_url('/', hello)
+ return 'Hello World!'
if __name__ == "__main__":
app.run()
+
+Or a full featured (yet configurable if needed) framework.
View
@@ -4,9 +4,10 @@
#
# pip install -r requirements.txt
-Babel
-Jinja2>=2.4
-pyCEO>=1.0.3
+babel
+inflector
+jinja2>=2.4
+pyceo>=1.0.3
pytz
-Voodoo>=0.7
-Werkzeug>=0.7
+voodoo>=0.7
+werkzeug>=0.7
View
@@ -1,44 +1,46 @@
# -*- coding: utf-8 -*-
"""
+ --------------------------
Shake
--------------------------
- A web framework mixed from the best ingredients:
+ A web framework mixed from the best ingredients.
+ It can be minimal like this:
from shake import Shake
- app = Shake()
+ app = Shake(__file__)
+ app.route('/', hello)
def hello(request):
- return 'Hello World!'
-
- app.add_url('/', hello)
+ return 'Hello World!'
if __name__ == "__main__":
app.run()
+ Or a full featured (yet configurable if you need it) framework.
---------------------------------------
- © 2010 by [Lúcuma labs] (http://lucumalabs.com).
+ © 2010 by [Lúcuma] (http://lucumalabs.com).
See `AUTHORS.md` for more details.
License: [MIT License] (http://www.opensource.org/licenses/mit-license.php).
Portions of code and/or inspiration taken from:
- * Flask <flask.pocoo.org> Copyright 2010, Armin Ronacher.
* Werkzeug <werkzeug.pocoo.org> Copyright 2010, the Werkzeug Team.
+ * Flask <flask.pocoo.org> Copyright 2010, Armin Ronacher.
Used under the modified BSD license. See LEGAL.md for more details
"""
-# Utilities we import from Jinja and Werkzeug that are unused
+# Utilities we import from Werkzeug that are unused
# in the module but are exported as public interface.
from jinja2.exceptions import TemplateNotFound
from werkzeug.exceptions import *
from werkzeug.urls import url_quote, url_unquote
from werkzeug.utils import cached_property, import_string, redirect
from .app import *
-from .controllers import *
from .helpers import *
+from .render import *
from .routes import *
from .serializers import json
from .session import *
@@ -49,7 +51,6 @@ def hello(request):
## Aliases
NotAllowed = Forbidden
-ViewNotFound = TemplateNotFound
redirect_to = redirect
__version__ = '1.2.0'
Oops, something went wrong.

0 comments on commit 3673f76

Please sign in to comment.