From 4f9eb3b50a363e86aa38f9c497983adca0264cb9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 9 Feb 2014 22:01:07 -0600 Subject: - correct error when building docs in Sphinx: Warning, treated as error: ~/projects/pyramid/pyramid/docs/api/i18n.rst:6: WARNING: error while formatting arguments for pyramid.i18n.TranslationStringFactory: 'function' object has no attribute '__bases__' --- docs/api/i18n.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/i18n.rst b/docs/api/i18n.rst index 53e8c8a9b..3b9abbc1d 100644 --- a/docs/api/i18n.rst +++ b/docs/api/i18n.rst @@ -7,7 +7,7 @@ .. autoclass:: TranslationString - .. autoclass:: TranslationStringFactory + .. autofunction:: TranslationStringFactory .. autoclass:: Localizer :members: -- cgit v1.2.3 From 2033eeb3602f330930585678aac926749b9c22f7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 10 Feb 2014 03:22:33 -0600 Subject: - Garden PR #1121 --- docs/api/registry.rst | 5 ++++- docs/api/request.rst | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'docs/api') diff --git a/docs/api/registry.rst b/docs/api/registry.rst index 7736cf075..bab3e26ba 100644 --- a/docs/api/registry.rst +++ b/docs/api/registry.rst @@ -21,7 +21,10 @@ When a registry is set up (or created) by a :term:`Configurator`, the registry will be decorated with an instance named ``introspector`` implementing the :class:`pyramid.interfaces.IIntrospector` interface. - See also :attr:`pyramid.config.Configurator.introspector`. + + .. seealso:: + + See also :attr:`pyramid.config.Configurator.introspector`. When a registry is created "by hand", however, this attribute will not exist until set up by a configurator. diff --git a/docs/api/request.rst b/docs/api/request.rst index b7604020e..343d0c022 100644 --- a/docs/api/request.rst +++ b/docs/api/request.rst @@ -250,8 +250,11 @@ ``invoke_subrequest`` isn't *actually* a method of the Request object; it's a callable added when the Pyramid router is invoked, or when a subrequest is invoked. This means that it's not available for use on a - request provided by e.g. the ``pshell`` environment. For more - information, see :ref:`subrequest_chapter`. + request provided by e.g. the ``pshell`` environment. + + .. seealso:: + + See also :ref:`subrequest_chapter`. .. automethod:: has_permission @@ -280,7 +283,11 @@ This property will return the JSON-decoded variant of the request body. If the request body is not well-formed JSON, or there is no body associated with this request, this property will raise an - exception. See also :ref:`request_json_body`. + exception. + + .. seealso:: + + See also :ref:`request_json_body`. .. method:: set_property(callable, name=None, reify=False) -- cgit v1.2.3 From 2af00e59d9c3e19b25e2759832efe6485a617536 Mon Sep 17 00:00:00 2001 From: flibustenet Date: Thu, 17 Apr 2014 21:52:23 +0200 Subject: More explicit example of set_property cleanup callback has a "request" parameter (and not "_") cleanup callback know (since 1.5) if an exception occurred or not (to commit or rollback) (same as #1302 on 1.5) --- docs/api/request.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/request.rst b/docs/api/request.rst index 343d0c022..c52d41400 100644 --- a/docs/api/request.rst +++ b/docs/api/request.rst @@ -319,7 +319,13 @@ def _connect(request): conn = request.registry.dbsession() - def cleanup(_): + def cleanup(request): + # since version 1.5 request.exception is not more + # eagerly cleared + if request.exception is not None: + conn.rollback() + else: + conn.commit() conn.close() request.add_finished_callback(cleanup) return conn -- cgit v1.2.3 From 268eb40ff0e21281497a954120220e41bac4a4db Mon Sep 17 00:00:00 2001 From: thapar Date: Fri, 18 Apr 2014 04:52:01 -0400 Subject: Typo fix "not"-->"no" --- docs/api/request.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api') diff --git a/docs/api/request.rst b/docs/api/request.rst index c52d41400..b28ec5ffc 100644 --- a/docs/api/request.rst +++ b/docs/api/request.rst @@ -320,7 +320,7 @@ def _connect(request): conn = request.registry.dbsession() def cleanup(request): - # since version 1.5 request.exception is not more + # since version 1.5, request.exception is no more # eagerly cleared if request.exception is not None: conn.rollback() -- cgit v1.2.3 From 070d7a6abc67e942abffc6645d1efdcfb3b6dafe Mon Sep 17 00:00:00 2001 From: thapar Date: Fri, 18 Apr 2014 11:42:01 -0400 Subject: Corrected the comment's language --- docs/api/request.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/api') diff --git a/docs/api/request.rst b/docs/api/request.rst index b28ec5ffc..77d80f6d6 100644 --- a/docs/api/request.rst +++ b/docs/api/request.rst @@ -320,8 +320,8 @@ def _connect(request): conn = request.registry.dbsession() def cleanup(request): - # since version 1.5, request.exception is no more - # eagerly cleared + # since version 1.5, request.exception is no + # longer eagerly cleared if request.exception is not None: conn.rollback() else: -- cgit v1.2.3