Merge branch 'jsonp-syntax' of github.com:wichert/pyramid into wichert-jsonp-syntax
| | |
| | | Bug Fixes |
| | | --------- |
| | | |
| | | - Add a trailing semicolon to the JSONP response. This fixes JavaScript syntax |
| | | errors for old IE versions. |
| | | |
| | | - Fix the ``pcreate`` script so that when the target directory name ends with a |
| | | slash it does not produce a non-working project directory structure. |
| | | Previously saying ``pcreate -s starter /foo/bar/`` produced different output |
| | |
| | | |
| | | Implicit Tween Chain (not used) |
| | | |
| | | Position Name Alias |
| | | -------- ---- ----- |
| | | - - INGRESS |
| | | 0 pyramid_debugtoolbar.toolbar.toolbar_tween_factory pdbt |
| | | 1 pyramid.tweens.excview_tween_factory excview |
| | | - - MAIN |
| | | Position Name |
| | | -------- ---- |
| | | - INGRESS |
| | | 0 pyramid_debugtoolbar.toolbar.toolbar_tween_factory |
| | | 1 pyramid.tweens.excview_tween_factory |
| | | - MAIN |
| | | |
| | | Here's the application configuration section of the ``development.ini`` used |
| | | by the above ``ptweens`` command which reports that the explicit tween chain |
| | |
| | | import cgi |
| | | import re |
| | | from docutils.core import publish_parts |
| | | |
| | |
| | | exists = DBSession.query(Page).filter_by(name=word).all() |
| | | if exists: |
| | | view_url = request.route_url('view_page', pagename=word) |
| | | return '<a href="%s">%s</a>' % (view_url, word) |
| | | return '<a href="%s">%s</a>' % (view_url, cgi.escape(word)) |
| | | else: |
| | | add_url = request.route_url('add_page', pagename=word) |
| | | return '<a href="%s">%s</a>' % (add_url, word) |
| | | return '<a href="%s">%s</a>' % (add_url, cgi.escape(word)) |
| | | |
| | | content = publish_parts(page.data, writer_name='html')['html_body'] |
| | | content = wikiwords.sub(check, content) |
| | |
| | | body = val |
| | | else: |
| | | ct = 'application/javascript' |
| | | body = '%s(%s)' % (callback, val) |
| | | body = '%s(%s);' % (callback, val) |
| | | response = request.response |
| | | if response.content_type == response.default_content_type: |
| | | response.content_type = ct |
| | |
| | | request = testing.DummyRequest() |
| | | request.GET['callback'] = 'callback' |
| | | result = renderer({'a':'1'}, {'request':request}) |
| | | self.assertEqual(result, 'callback({"a": "1"})') |
| | | self.assertEqual(result, 'callback({"a": "1"});') |
| | | self.assertEqual(request.response.content_type, |
| | | 'application/javascript') |
| | | |