From f65e191ed7da0ff97638879cf854c0b1cb505aaa Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 2 Jan 2013 23:09:40 +0200 Subject: typos --- docs/glossary.rst | 2 +- docs/narr/introduction.rst | 2 +- docs/tutorials/wiki2/basiclayout.rst | 2 +- docs/tutorials/wiki2/installation.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/glossary.rst b/docs/glossary.rst index 6620552f1..5b165db0a 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -921,7 +921,7 @@ Glossary PyPy PyPy is an "alternative implementation of the Python - language":http://pypy.org/ + language": http://pypy.org/ tween A bit of code that sits between the Pyramid router's main request diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index b35c61720..956d7a177 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -101,7 +101,7 @@ frameworks for small and large applications is just false; a well-designed framework should be able to be good at both. Pyramid strives to be that kind of framework. -To this end, Pyramid provides a set of features, that, combined, are unique +To this end, Pyramid provides a set of features that, combined, are unique amongst Python web frameworks. Lots of other frameworks contain some combination of these features; Pyramid of course actually stole many of them from those other frameworks. But Pyramid is the only one that has all of diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst index 763deaa32..e8874784c 100644 --- a/docs/tutorials/wiki2/basiclayout.rst +++ b/docs/tutorials/wiki2/basiclayout.rst @@ -97,7 +97,7 @@ with the prefix ``/static`` (by virtue of the first argument to ``add_static_view``). This will serve up static resources for us from within the ``static`` directory of our ``tutorial`` package, in this case, via ``http://localhost:6543/static/`` and below (by virtue of the second argument -to add_static_view). With this declaration, we're saying that any URL that +to ``add_static_view``). With this declaration, we're saying that any URL that starts with ``/static`` should go to the static view; any remainder of its path (e.g. the ``/foo`` in ``/static/foo``) will be used to compose a path to a static file resource, such as a CSS file. diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 572bffcab..1e47e18c3 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -159,7 +159,7 @@ On Windows: .. code-block:: text - c:\pyramidtut\tutorial> ..\Scripts\nosetests --cover-package=tutorial ^ + c:\pyramidtut\tutorial> ..\Scripts\nosetests --cover-package=tutorial \ --cover-erase --with-coverage If successful, you will see output something like this:: -- cgit v1.2.3 From d695783b9adfe7c57c639e120c55c233c2979bc0 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 01:02:38 +0200 Subject: typo --- docs/tutorials/wiki2/definingmodels.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 2148582f1..d42ed0814 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -31,7 +31,7 @@ following: (The highlighted lines are the ones that need to be changed.) -The first thing we've done is to do is remove the stock ``MyModel`` class +The first thing we've done is remove the stock ``MyModel`` class from the generated ``models.py`` file. The ``MyModel`` class is only a sample and we're not going to use it. -- cgit v1.2.3 From af1a96331c8de1e4ccc7eebba6f21974d21ebed6 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 01:40:32 +0200 Subject: Reduce duplicated content in wiki2 tutorial --- docs/tutorials/wiki2/definingmodels.rst | 22 ++++++---------------- docs/tutorials/wiki2/installation.rst | 6 ++++++ 2 files changed, 12 insertions(+), 16 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/definingmodels.rst b/docs/tutorials/wiki2/definingmodels.rst index 2148582f1..cfa80aa42 100644 --- a/docs/tutorials/wiki2/definingmodels.rst +++ b/docs/tutorials/wiki2/definingmodels.rst @@ -77,25 +77,15 @@ following: (Only the highlighted lines need to be changed.) -Reinitializing the Database ---------------------------- +Installing the Project and re-initializing the Database +------------------------------------------------------- + +Redo the steps in :ref:`installing_project_in_dev_mode`. Because our model has changed, in order to reinitialize the database, we need to rerun the ``initialize_tutorial_db`` command to pick up the changes you've made -to both the models.py file and to the initializedb.py file. From the root of the -``tutorial`` project, directory execute the following commands. - -On UNIX: - -.. code-block:: text - - $ ../bin/initialize_tutorial_db development.ini - -On Windows: - -.. code-block:: text - - c:\pyramidtut\tutorial> ..\Scripts\initialize_tutorial_db development.ini +to both the models.py file and to the initializedb.py file. +See :ref:`initialize_db_wiki2` for instructions. Success will look something like this:: diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 572bffcab..d4d5c0cce 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -66,6 +66,9 @@ On Windows: startup problems, try putting both the virtualenv and the project into directories that do not contain spaces in their paths. + +.. _installing_project_in_dev_mode: + Installing the Project in "Development Mode" ============================================ @@ -181,6 +184,9 @@ If successful, you will see output something like this:: Looks like our package doesn't quite have 100% test coverage. + +.. _initialize_db_wiki2: + Initializing the Database ========================= -- cgit v1.2.3 From fe197640038f0aa18a8d453e820df9e1b2d1bee7 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 15:18:36 +0200 Subject: typo --- docs/tutorials/wiki2/authorization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index d98fb87e4..cfbc8ca75 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -14,7 +14,7 @@ anyone with access to the server to view pages. We will also add a login page and a logout link on all the pages. The login page will be shown when a user is denied -access to any of the views that require a permission, instead of +access to any of the views that require permission, instead of a default "403 Forbidden" page. We will implement the access control with the following steps: -- cgit v1.2.3 From 064080f2496ef09eb79a0c370eb0db9dfd5c459c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 19:28:09 +0200 Subject: sentence too long; also fix grammar, and add markup --- docs/tutorials/wiki2/authorization.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index d98fb87e4..933c37f94 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -62,7 +62,7 @@ returns one of these values: - If the userid *does not* exist in the system, it will return ``None``. -For example, ``groupfinder('editor', request )`` returns ['group:editor'], +For example, ``groupfinder('editor', request )`` returns ``['group:editor']``, ``groupfinder('viewer', request)`` returns [], and ``groupfinder('admin', request)`` returns ``None``. We will use ``groupfinder()`` as an :term:`authentication policy` "callback" that will provide the :term:`principal` or principals @@ -151,10 +151,10 @@ Now add those policies to the configuration: (Only the highlighted lines need to be added.) -We are enabling an ``AuthTktAuthenticationPolicy``, it is based in an -auth ticket that may be included in the request, and an -``ACLAuthorizationPolicy`` that uses an ACL to determine the allow or deny -outcome for a view. +We are enabling an ``AuthTktAuthenticationPolicy``, which is based in an +auth ticket that may be included in the request. +We are also enabling an ``ACLAuthorizationPolicy``, which uses an ACL to +determine the *allow* or *deny* outcome for a view. Note that the :class:`pyramid.authentication.AuthTktAuthenticationPolicy` constructor accepts two arguments: ``secret`` and ``callback``. ``secret`` is -- cgit v1.2.3 From 97895f871d1e2bd168e4bfb29d61472a44d3b0e9 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 20:14:25 +0200 Subject: no need to display the entire path --- docs/tutorials/wiki2/authorization.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index d98fb87e4..ff269ef6b 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -156,7 +156,7 @@ auth ticket that may be included in the request, and an ``ACLAuthorizationPolicy`` that uses an ACL to determine the allow or deny outcome for a view. -Note that the :class:`pyramid.authentication.AuthTktAuthenticationPolicy` +Note that the :class:`~pyramid.authentication.AuthTktAuthenticationPolicy` constructor accepts two arguments: ``secret`` and ``callback``. ``secret`` is a string representing an encryption key used by the "authentication ticket" machinery represented by this policy: it is required. The ``callback`` is the -- cgit v1.2.3 From 998b3970c98baa0c591507f94e6ec32b65969045 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 5 Jan 2013 20:38:25 +0200 Subject: remove info that should be obvious to the reader --- docs/tutorials/wiki2/authorization.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index d98fb87e4..03a06e304 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -303,9 +303,8 @@ like this: (Only the highlighted line needs to be added.) -:meth:`~pyramid.security.authenticated_userid()` will return None -if the user is not authenticated, or some user id it the user -is authenticated. +The :meth:`~pyramid.security.authenticated_userid` method will return None +if the user is not authenticated. Add a "Logout" link when logged in ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 73ea91b1e3859e412252a8d3263389147a05223e Mon Sep 17 00:00:00 2001 From: Reed O'Brien Date: Sun, 6 Jan 2013 13:24:50 -0500 Subject: fix import typo in docs --- docs/narr/viewconfig.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index 799de768f..f00dae451 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -834,7 +834,7 @@ decorator on the RESTView class: .. code-block:: python :linenos: - from pyramid.view import view_config + from pyramid.view import view_defaults from pyramid.response import Response from pyramid.config import Configurator -- cgit v1.2.3 From 168e94f0693600b122619222dd5cf2053b1d96ae Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 6 Jan 2013 20:25:07 +0200 Subject: I have tested this on Python 3, and it works without modification --- docs/tutorials/wiki2/background.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/background.rst b/docs/tutorials/wiki2/background.rst index 9933adc27..1f9582903 100644 --- a/docs/tutorials/wiki2/background.rst +++ b/docs/tutorials/wiki2/background.rst @@ -11,9 +11,8 @@ To code along with this tutorial, the developer will need a UNIX machine with development tools (Mac OS X with XCode, any Linux or BSD variant, etc) *or* a Windows system of any kind. -.. warning:: +.. note:: - This tutorial has been written for Python 2. It is unlikely to work - without modification under Python 3. + This tutorial runs on both Python 2 and 3 without modification. Have fun! -- cgit v1.2.3 From 1c65db8c7176ce2b2bf2c85de3721164deb27b6c Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Sun, 6 Jan 2013 15:25:35 -0800 Subject: Clarify "TL". Fixes #777 --- docs/designdefense.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 96e1001e6..dec33bd1a 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1536,7 +1536,7 @@ comments take into account what we've discussed in the .. code-block:: python :linenos: - from pyramid.response import Response # explicit response, no TL + from pyramid.response import Response # explicit response, no thread local from wsgiref.simple_server import make_server # explicitly WSGI def hello_world(request): # accepts a request; no request thread local reqd -- cgit v1.2.3 From de5d2a88ef64a3f59222be1bd369ce226bbc0171 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 7 Jan 2013 01:37:30 +0200 Subject: redundant statement: the links preceeding the statement target the info referred to --- docs/api/path.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/api/path.rst b/docs/api/path.rst index d46c35d8e..814fc47d5 100644 --- a/docs/api/path.rst +++ b/docs/api/path.rst @@ -9,8 +9,7 @@ A constant used by the constructor of :class:`pyramid.path.DottedNameResolver` and - :class:`pyramid.path.AssetResolver` (see their docstrings for more - info). + :class:`pyramid.path.AssetResolver`. .. autoclass:: DottedNameResolver :members: -- cgit v1.2.3 From a03b29ccc094537fa0d80b2545a9d16fc94566cb Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 8 Jan 2013 00:50:24 +0200 Subject: typos --- docs/narr/introduction.rst | 2 +- docs/narr/upgrading.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index b35c61720..187b81702 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -475,7 +475,7 @@ per route. For example, you can create a route with the pattern ``/items`` and when the route is matched, you can shuffle off the request to one view if the request method is GET, another view if the request method is POST, etc. A system known as "view predicates" allows for this. Request method matching -is the very most basic thing you can do with a view predicate. You can also +is the most basic thing you can do with a view predicate. You can also associate views with other request parameters such as the elements in the query string, the Accept header, whether the request is an XHR request or not, and lots of other things. This feature allows you to keep your diff --git a/docs/narr/upgrading.rst b/docs/narr/upgrading.rst index 839f59c35..20487b448 100644 --- a/docs/narr/upgrading.rst +++ b/docs/narr/upgrading.rst @@ -206,7 +206,7 @@ information. Upgrading to the Very Latest Pyramid Release -------------------------------------------- -When you upgrade your application to the very most recent Pyramid release, +When you upgrade your application to the most recent Pyramid release, it's advisable to upgrade step-wise through each most recent minor release, beginning with the one that you know your application currently runs under, and ending on the most recent release. For example, if your application is -- cgit v1.2.3 From 812f65b895269f0c6b015af0276eef86b0b9b518 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 8 Jan 2013 23:14:20 +0200 Subject: the sample apps do not run on Py3k --- docs/index.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/index.rst b/docs/index.rst index 406cc9b03..0d6113c15 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -138,6 +138,11 @@ Design Documents Sample Applications =================== +.. note:: + + These applications run only on Python 2.x, and so do some of their + dependencies. + `cluegun `_ is a simple pastebin application based on Rocky Burt's `ClueBin `_. It demonstrates form -- cgit v1.2.3 From 22ed77d69b0f2348983be0c4e8758a44cf160671 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 9 Jan 2013 02:30:47 +0200 Subject: take advantage of the -c option of Python --- docs/narr/install.rst | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'docs') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index ff89553ae..a78c1b2bd 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -150,32 +150,21 @@ To set up a virtualenv in which to install :app:`Pyramid`, first ensure that ``import setuptools`` within the Python interpreter you'd like to run :app:`Pyramid` under. -Here's the output you'll expect if setuptools or distribute is already -installed: +The following command will not display anything if setuptools or distribute is +already installed: .. code-block:: text - [chrism@thinko docs]$ python2.7 - Python 2.7.3 (default, Aug 1 2012, 05:14:39) - [GCC 4.6.3] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - >>> import setuptools - >>> + $ python2.7 -c 'import setuptools' -Here's the output you can expect if setuptools or distribute is not already -installed: +Running the same command will yield the following output if setuptools or +distribute is not yet installed: .. code-block:: text - [chrism@thinko docs]$ python2.7 - Python 2.7.3 (default, Aug 1 2012, 05:14:39) - [GCC 4.6.3] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - >>> import setuptools Traceback (most recent call last): File "", line 1, in ImportError: No module named setuptools - >>> If ``import setuptools`` raises an :exc:`ImportError` as it does above, you will need to install setuptools or distribute manually. Note that above -- cgit v1.2.3 From 2e54b81ff69fc39d42783fffe98a4bb81d28ac97 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 11 Jan 2013 19:02:30 +0200 Subject: add missing commas --- docs/designdefense.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 96e1001e6..6ff686a95 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -38,7 +38,7 @@ forking is also a Zope derivative. Implementations of these features were *required* to allow the :app:`Pyramid` authors to build the bread-and-butter CMS-type systems for customers in the -way they were accustomed to building them. No other system save Zope itself +way they were accustomed to building them. No other system, save for Zope itself, had such features. And Zope itself was beginning to show signs of its age. We were becoming hampered by consequences of its early design mistakes. Zope's lack of documentation was also difficult to work around: it was hard @@ -55,7 +55,7 @@ existing frameworks had good, and sometimes very compelling ideas. In particular, :term:`URL dispatch` is a more direct mechanism to map URLs to code. -So although we couldn't find a framework save for Zope that fit our needs, +So, although we couldn't find a framework, save for Zope, that fit our needs, and while we incorporated a lot of Zope ideas into BFG, we also emulated the features we found compelling in other frameworks (such as :term:`url dispatch`). After the initial public release of BFG, as time went on, -- cgit v1.2.3