Permalink
Browse files

fixed up all the warning dealing ..note and ..warn

added a hide toc for glossary to prevent warnings
  • Loading branch information...
michr
michr committed Sep 24, 2011
1 parent f487b2f commit 012b9762cd0b114b6afbf2d6356554b51706804a
View
@@ -245,7 +245,9 @@ its API is much nicer than the ZCA registry API, work on it was largely
abandoned and it is not used in :app:`Pyramid`. We continued to use a ZCA
registry within :app:`Pyramid` because it ultimately proved a better fit.
-.. note:: We continued using ZCA registry rather than disusing it in
+.. note::
+
+ We continued using ZCA registry rather than disusing it in
favor of using the registry implementation in
:mod:`repoze.component` largely because the ZCA concept of
interfaces provides for use of an interface hierarchy, which is
View
@@ -227,3 +227,12 @@ Index and Glossary
* :ref:`glossary`
* :ref:`genindex`
* :ref:`search`
+
+
+.. add glossary in hidden toc tree so it does not complain its not included
+
+.. toctree::
+ :hidden:
+
+ glossary
+
View
@@ -102,7 +102,9 @@ directory on a filesystem to an application user's browser. Use the
mechanism makes a directory of static files available at a name relative to
the application root URL, e.g. ``/static`` or as an external URL.
-.. note:: :meth:`~pyramid.config.Configurator.add_static_view` cannot serve a
+.. note::
+
+ :meth:`~pyramid.config.Configurator.add_static_view` cannot serve a
single file, nor can it serve a directory of static files directly
relative to the root URL of a :app:`Pyramid` application. For these
features, see :ref:`advanced_static`.
@@ -312,7 +314,9 @@ instance of this class is actually used by the
:meth:`~pyramid.config.Configurator.add_static_view` configuration method, so
its behavior is almost exactly the same once it's configured.
-.. warning:: The following example *will not work* for applications that use
+.. warning::
+
+ The following example *will not work* for applications that use
:term:`traversal`, it will only work if you use :term:`URL dispatch`
exclusively. The root-relative route we'll be registering will always be
matched before traversal takes place, subverting any views registered via
View
@@ -55,7 +55,9 @@ Here's some sample code that implements a minimal NotFound view callable:
def notfound_view(request):
return HTTPNotFound()
-.. note:: When a NotFound view callable is invoked, it is passed a
+.. note::
+
+ When a NotFound view callable is invoked, it is passed a
:term:`request`. The ``exception`` attribute of the request will be an
instance of the :exc:`~pyramid.httpexceptions.HTTPNotFound` exception that
caused the not found view to be called. The value of
@@ -64,7 +66,9 @@ Here's some sample code that implements a minimal NotFound view callable:
``pyramid.debug_notfound`` environment setting is true than it is when it
is false.
-.. warning:: When a NotFound view callable accepts an argument list as
+.. warning::
+
+ When a NotFound view callable accepts an argument list as
described in :ref:`request_and_context_view_definitions`, the ``context``
passed as the first argument to the view callable will be the
:exc:`~pyramid.httpexceptions.HTTPNotFound` exception instance. If
@@ -121,7 +125,9 @@ Here's some sample code that implements a minimal forbidden view:
def forbidden_view(request):
return Response('forbidden')
-.. note:: When a forbidden view callable is invoked, it is passed a
+.. note::
+
+ When a forbidden view callable is invoked, it is passed a
:term:`request`. The ``exception`` attribute of the request will be an
instance of the :exc:`~pyramid.httpexceptions.HTTPForbidden` exception
that caused the forbidden view to be called. The value of
@@ -1100,7 +1106,9 @@ in the ``pyramid.tweens`` list will be used as the producer of the effective
declared directly "below" it, ad infinitum. The "main" Pyramid request
handler is implicit, and always "at the bottom".
-.. note:: Pyramid's own :term:`exception view` handling logic is implemented
+.. note::
+
+ Pyramid's own :term:`exception view` handling logic is implemented
as a tween factory function: :func:`pyramid.tweens.excview_tween_factory`.
If Pyramid exception view handling is desired, and tween factories are
specified via the ``pyramid.tweens`` configuration setting, the
View
@@ -518,7 +518,9 @@ negotiator is registered.
def aview(request):
locale = get_localizer(request)
-.. note:: If you need to create a localizer for a locale use the
+.. note::
+
+ If you need to create a localizer for a locale use the
:func:`pyramid.i18n.make_localizer` function.
.. index::
@@ -555,7 +557,9 @@ represented by the request. The translation returned from its
``domain`` attribute of the provided translation string as well as the
locale of the localizer.
-.. note:: If you're using :term:`Chameleon` templates, you don't need
+.. note::
+
+ If you're using :term:`Chameleon` templates, you don't need
to pre-translate translation strings this way. See
:ref:`chameleon_translation_strings`.
View
@@ -229,7 +229,9 @@ following:
New python executable in env/bin/python
Installing setuptools.............done.
-.. warning:: Using ``--no-site-packages`` when generating your
+.. warning::
+
+ Using ``--no-site-packages`` when generating your
virtualenv is *very important*. This flag provides the necessary
isolation for running the set of packages required by
:app:`Pyramid`. If you do not specify ``--no-site-packages``,
View
@@ -7,7 +7,9 @@ Logging
:mod:`logging` module. This chapter describes how to configure logging and
how to send log messages to loggers that you've configured.
-.. warning:: This chapter assumes you've used a :term:`scaffold` to create a
+.. warning::
+
+ This chapter assumes you've used a :term:`scaffold` to create a
project which contains ``development.ini`` and ``production.ini`` files
which help configure logging. All of the scaffolds which ship along with
:app:`Pyramid` do this. If you're not using a scaffold, or if you've used
@@ -313,6 +313,8 @@ don't require it, great: stick with :term:`URL dispatch`. But if you're
using :app:`Pyramid` and you ever find that you *do* need to support one of
these use cases, you'll be glad you have traversal in your toolkit.
-.. note:: It is even possible to mix and match :term:`traversal` with
+.. note::
+
+ It is even possible to mix and match :term:`traversal` with
:term:`URL dispatch` in the same :app:`Pyramid` application. See the
:ref:`hybrid_chapter` chapter for details.
View
@@ -64,7 +64,9 @@ The included scaffolds are these:
URL mapping via :term:`traversal` and persistence via
:term:`SQLAlchemy`
-.. note:: At this time, each of these scaffolds uses the :term:`Chameleon`
+.. note::
+
+ At this time, each of these scaffolds uses the :term:`Chameleon`
templating system, which is incompatible with Jython. To use scaffolds to
build applications which will run on Jython, you can try the
``pyramid_jinja2_starter`` scaffold which ships as part of the
View
@@ -160,7 +160,9 @@ resource in the resource tree, you will eventually come to the root resource,
just like if you keep executing the ``cd ..`` filesystem command, eventually
you will reach the filesystem root directory.
-.. warning:: If your root resource has a ``__name__`` argument that is not
+.. warning::
+
+ If your root resource has a ``__name__`` argument that is not
``None`` or the empty string, URLs returned by the
:func:`~pyramid.request.Request.resource_url` function and paths generated
by the :func:`~pyramid.traversal.resource_path` and
View
@@ -46,7 +46,9 @@ within the body of a view callable like so:
{'foo':1, 'bar':2},
request=request)
-.. warning:: Earlier iterations of this documentation
+.. warning::
+
+ Earlier iterations of this documentation
(pre-version-1.3) encouraged the application developer to use
ZPT-specific APIs such as
:func:`pyramid.chameleon_zpt.render_template_to_response` and
View
@@ -353,7 +353,9 @@ process. Examples of route predicate arguments are ``pattern``, ``xhr``, and
Other arguments are ``name`` and ``factory``. These arguments represent
neither predicates nor view configuration information.
-.. warning:: Some arguments are view-configuration related arguments, such as
+.. warning::
+
+ Some arguments are view-configuration related arguments, such as
``view_renderer``. These only have an effect when the route configuration
names a ``view`` and these arguments have been deprecated as of
:app:`Pyramid` 1.1.
@@ -646,7 +648,9 @@ other non-``name`` and non-``pattern`` arguments to
exception to this rule is use of the ``pregenerator`` argument, which is not
ignored when ``static`` is ``True``.
-.. note:: the ``static`` argument to
+.. note::
+
+ the ``static`` argument to
:meth:`~pyramid.config.Configurator.add_route` is new as of :app:`Pyramid`
1.1.
@@ -1098,7 +1102,9 @@ permission. Obviously you can do more generic things than inspect the routes
match dict to see if the ``article`` argument matches a particular string;
our sample ``Article`` factory class is not very ambitious.
-.. note:: See :ref:`security_chapter` for more information about
+.. note::
+
+ See :ref:`security_chapter` for more information about
:app:`Pyramid` security and ACLs.
.. index::
@@ -7,7 +7,9 @@ application is typically a simple Python function that accepts two
parameters: :term:`context` and :term:`request`. A view callable is
assumed to return a :term:`response` object.
-.. note:: A :app:`Pyramid` view can also be defined as callable
+.. note::
+
+ A :app:`Pyramid` view can also be defined as callable
which accepts *only* a :term:`request` argument. You'll see
this one-argument pattern used in other :app:`Pyramid` tutorials
and applications. Either calling convention will work in any
@@ -253,7 +255,9 @@ the below:
.. literalinclude:: src/views/tutorial/templates/view.pt
:language: xml
-.. note:: The names available for our use in a template are always those that
+.. note::
+
+ The names available for our use in a template are always those that
are present in the dictionary returned by the view callable. But our
templates make use of a ``request`` object that none of our tutorial views
return in their dictionary. This value appears as if "by magic".
@@ -7,7 +7,9 @@ application is typically a simple Python function that accepts a single
parameter named :term:`request`. A view callable is assumed to return a
:term:`response` object.
-.. note:: A :app:`Pyramid` view can also be defined as callable
+.. note::
+
+ A :app:`Pyramid` view can also be defined as callable
which accepts *two* arguments: a :term:`context` and a
:term:`request`. You'll see this two-argument pattern used in
other :app:`Pyramid` tutorials and applications. Either calling
View
@@ -140,9 +140,10 @@ class Configurator(
same. See :ref:`adding_renderer_globals`. By default, it is ``None``,
which means use no renderer globals factory.
- .. warning:: as of Pyramid 1.1, ``renderer_globals_factory`` is
- deprecated. Instead, use a BeforeRender event subscriber as per
- :ref:`beforerender_event`.
+ .. warning::
+
+ as of Pyramid 1.1, ``renderer_globals_factory`` is deprecated. Instead,
+ use a BeforeRender event subscriber as per :ref:`beforerender_event`.
If ``default_permission`` is passed, it should be a
:term:`permission` string to be used as the default permission for
@@ -288,7 +289,7 @@ def setup_registry(self, settings=None, root_factory=None,
if debug_logger is None:
debug_logger = logging.getLogger(self.package_name)
-
+
registry.registerUtility(debug_logger, IDebugLogger)
for name, renderer in DEFAULT_RENDERERS:
@@ -361,7 +362,7 @@ def setup_registry(self, settings=None, root_factory=None,
tweens = aslist(registry.settings.get('pyramid.tweens', []))
for factory in tweens:
self._add_tween(factory, explicit=True)
-
+
includes = aslist(registry.settings.get('pyramid.includes', []))
for inc in includes:
self.include(inc)
@@ -557,15 +558,15 @@ def main(global_config, **settings):
``route_prefix``. This can be used to help mount a set of routes at a
different location than the included callable's author intended while
still maintaining the same route names. For example:
-
+
.. code-block:: python
:linenos:
from pyramid.config import Configurator
def included(config):
config.add_route('show_users', '/show')
-
+
def main(global_config, **settings):
config = Configurator()
config.include(included, route_prefix='/users')
@@ -613,7 +614,7 @@ def main(global_config, **settings):
configurator.basepath = os.path.dirname(sourcefile)
configurator.includepath = self.includepath + (spec,)
c(configurator)
-
+
def add_directive(self, name, directive, action_wrap=True):
"""
Add a directive method to the configurator.
@@ -636,7 +637,7 @@ def add_directive(self, name, directive, action_wrap=True):
discriminators. ``action_wrap`` will cause the directive to be
wrapped in a decorator which provides more accurate conflict
cause information.
-
+
``add_directive`` does not participate in conflict detection, and
later calls to ``add_directive`` will override earlier calls.
"""
@@ -14,9 +14,11 @@ def set_root_factory(self, factory):
state. If the ``factory`` argument is ``None`` a default root
factory will be registered.
- .. note:: Using the ``root_factory`` argument to the
- :class:`pyramid.config.Configurator` constructor
- can be used to achieve the same purpose.
+ .. note::
+
+ Using the ``root_factory`` argument to the
+ :class:`pyramid.config.Configurator` constructor can be used to
+ achieve the same purpose.
"""
factory = self.maybe_dotted(factory)
if factory is None:
@@ -35,9 +37,11 @@ def set_session_factory(self, session_factory):
method is called, the ``session_factory`` argument must be a session
factory callable or a :term:`dotted Python name` to that factory.
- .. note:: Using the ``session_factory`` argument to the
- :class:`pyramid.config.Configurator` constructor
- can be used to achieve the same purpose.
+ .. note::
+
+ Using the ``session_factory`` argument to the
+ :class:`pyramid.config.Configurator` constructor can be used to
+ achieve the same purpose.
"""
session_factory = self.maybe_dotted(session_factory)
def register():
@@ -54,7 +58,9 @@ def set_request_factory(self, factory):
:class:`pyramid.request.Request` class (particularly
``__call__``, and ``blank``).
- .. note:: Using the ``request_factory`` argument to the
+ .. note::
+
+ Using the ``request_factory`` argument to the
:class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
View
@@ -30,9 +30,11 @@ def set_locale_negotiator(self, negotiator):
application. See :ref:`activating_translation` for more
information.
- .. note:: Using the ``locale_negotiator`` argument to the
- :class:`pyramid.config.Configurator` constructor
- can be used to achieve the same purpose.
+ .. note::
+
+ Using the ``locale_negotiator`` argument to the
+ :class:`pyramid.config.Configurator` constructor can be used to
+ achieve the same purpose.
"""
def register():
self._set_locale_negotiator(negotiator)
@@ -39,7 +39,7 @@ def add_renderer(self, name, factory):
# if name is None or the empty string, we're trying to register
# a default renderer, but registerUtility is too dumb to accept None
# as a name
- if not name:
+ if not name:
name = ''
def register():
self.registry.registerUtility(factory, IRendererFactory, name=name)
@@ -61,9 +61,13 @@ def set_renderer_globals_factory(self, factory, warn=True):
dictionary, and therefore will be made available to the code
which uses the renderer.
- .. warning:: This method is deprecated as of Pyramid 1.1.
+ .. warning::
- .. note:: Using the ``renderer_globals_factory`` argument
+ This method is deprecated as of Pyramid 1.1.
+
+ .. note::
+
+ Using the ``renderer_globals_factory`` argument
to the :class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.
"""
Oops, something went wrong.

0 comments on commit 012b976

Please sign in to comment.