From a3251ddd6d9a2948fe8e762673ee6f3a6a66ea55 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Fri, 22 Mar 2013 21:50:00 +0200 Subject: remove visual noise In addition, we also get syntax highlighting... for free. --- docs/narr/muchadoabouttraversal.rst | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/narr/muchadoabouttraversal.rst b/docs/narr/muchadoabouttraversal.rst index 40d498391..483b1bb16 100644 --- a/docs/narr/muchadoabouttraversal.rst +++ b/docs/narr/muchadoabouttraversal.rst @@ -168,18 +168,12 @@ hood, when ``adict`` is a dictionary-like object, Python translates ``adict['a']`` to ``adict.__getitem__('a')``. Try doing this in a Python interpreter prompt if you don't believe us: -.. code-block:: text - :linenos: - - Python 2.4.6 (#2, Apr 29 2010, 00:31:48) - [GCC 4.4.3] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - >>> adict = {} - >>> adict['a'] = 1 - >>> adict['a'] - 1 - >>> adict.__getitem__('a') - 1 +>>> adict = {} +>>> adict['a'] = 1 +>>> adict['a'] +1 +>>> adict.__getitem__('a') +1 The dictionary-like root object stores the ids of all of its subresources as -- cgit v1.2.3 From 88cafdd3cf621d0a117f0e2e8c924c07dfbf5ef1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 23 Mar 2013 12:03:45 +0200 Subject: no need to qualify Python interactive sessions Sphinx automatically notices them as Python snippets and gives them syntax highlighting. These snippets are also too short to deserve linenos. --- docs/narr/sessions.rst | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) (limited to 'docs') diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst index fa4affd8a..c4f4b5f07 100644 --- a/docs/narr/sessions.rst +++ b/docs/narr/sessions.rst @@ -252,25 +252,19 @@ that were added to the flash queue, and empties the queue. .. method:: pop_flash(queue='') -.. code-block:: python - :linenos: - - >>> request.session.flash('info message') - >>> request.session.pop_flash() - ['info message'] +>>> request.session.flash('info message') +>>> request.session.pop_flash() +['info message'] Calling ``session.pop_flash()`` again like above without a corresponding call to ``session.flash()`` will return an empty list, because the queue has already been popped. -.. code-block:: python - :linenos: - - >>> request.session.flash('info message') - >>> request.session.pop_flash() - ['info message'] - >>> request.session.pop_flash() - [] +>>> request.session.flash('info message') +>>> request.session.pop_flash() +['info message'] +>>> request.session.pop_flash() +[] .. index:: single: session.peek_flash @@ -285,18 +279,15 @@ popped from flash storage. .. method:: peek_flash(queue='') -.. code-block:: python - :linenos: - - >>> request.session.flash('info message') - >>> request.session.peek_flash() - ['info message'] - >>> request.session.peek_flash() - ['info message'] - >>> request.session.pop_flash() - ['info message'] - >>> request.session.peek_flash() - [] +>>> request.session.flash('info message') +>>> request.session.peek_flash() +['info message'] +>>> request.session.peek_flash() +['info message'] +>>> request.session.pop_flash() +['info message'] +>>> request.session.peek_flash() +[] .. index:: single: preventing cross-site request forgery attacks -- cgit v1.2.3 From 609aeb5daf91d2af3091d2e3cd7078ad47f8867f Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 23 Mar 2013 03:25:47 -0700 Subject: place colon within strong style --- docs/tutorials/wiki2/installation.rst | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 9590e4abe..3543d9b9c 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -29,7 +29,7 @@ virtual environment. New python executable in /home/foo/env/bin/python Installing setuptools.............done. -**On Windows**: +**On Windows:** Set the `VENV` environment variable. @@ -61,7 +61,7 @@ Install Pyramid Into the Virtual Python Environment $ $VENV/bin/easy_install pyramid -**On Windows**: +**On Windows:** .. code-block:: text @@ -88,13 +88,13 @@ Change Directory to Your Virtual Python Environment Change directory to the ``pyramidtut`` directory. -**On UNIX**: +**On UNIX:** .. code-block:: text $ cd pyramidtut -**On Windows**: +**On Windows:** .. code-block:: text @@ -123,13 +123,13 @@ required files. For example, `pcreate` creates the The below instructions assume your current working directory is the "virtualenv" named "pyramidtut". -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/pcreate -s alchemy tutorial -**On Windows**: +**On Windows:** .. code-block:: text @@ -152,14 +152,14 @@ the project as a development egg in your workspace using the directory you created in :ref:`sql_making_a_project`, and run the ``setup.py develop`` command using the virtualenv Python interpreter. -**On UNIX**: +**On UNIX:** .. code-block:: text $ cd tutorial $ $VENV/bin/python setup.py develop -**On Windows**: +**On Windows:** .. code-block:: text @@ -180,13 +180,13 @@ Running the Tests After you've installed the project in development mode, you may run the tests for the project. -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/python setup.py test -q -**On Windows**: +**On Windows:** .. code-block:: text @@ -212,13 +212,13 @@ tests. To get this functionality working, we'll need to install the ``nose`` and ``coverage`` packages into our ``virtualenv``: -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/easy_install nose coverage -**On Windows**: +**On Windows:** .. code-block:: text @@ -227,13 +227,13 @@ To get this functionality working, we'll need to install the ``nose`` and Once ``nose`` and ``coverage`` are installed, we can actually run the coverage tests. -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/nosetests --cover-package=tutorial --cover-erase --with-coverage -**On Windows**: +**On Windows:** .. code-block:: text @@ -271,13 +271,13 @@ script` to initialize our database. Type the following command, make sure you are still in the ``tutorial`` directory (the directory with a ``development.ini`` in it): -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/initialize_tutorial_db development.ini -**On Windows**: +**On Windows:** .. code-block:: text @@ -319,13 +319,13 @@ Starting the Application Start the application. -**On UNIX**: +**On UNIX:** .. code-block:: text $ $VENV/bin/pserve development.ini --reload -**On Windows**: +**On Windows:** .. code-block:: text -- cgit v1.2.3 From 9c69d9a0de8c2a34820be05f36e32f68b29e5276 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 23 Mar 2013 03:30:41 -0700 Subject: remove 'or find' --- docs/narr/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/narr/install.rst b/docs/narr/install.rst index 7f4742ee2..8fc63f3a4 100644 --- a/docs/narr/install.rst +++ b/docs/narr/install.rst @@ -341,7 +341,7 @@ for both versions are included below. Windows Using Python 2 ~~~~~~~~~~~~~~~~~~~~~~ -#. Install, or find the most recent `Python 2.7.x version +#. Install the most recent `Python 2.7.x version `_ for your system. #. Install the `Python for Windows extensions -- cgit v1.2.3 From 1dcb8a49933cb98109c6524220089cabe81e355e Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 24 Mar 2013 08:15:18 +0200 Subject: add webob to intersphinx list With this change, we get hyperlinks for webob cross-references. --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index eff6db488..69d00cdaa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,6 +55,7 @@ extensions = [ # Looks for objects in external projects intersphinx_mapping = { + 'webob': ('http://docs.webob.org/en/latest', None), 'sqla': ('http://docs.sqlalchemy.org/en/latest', None), 'who': ('http://docs.repoze.org/who/latest', None), 'python': ('http://docs.python.org', None), -- cgit v1.2.3 From 2fe90368e99aedded9177ec222020f6fef81ffed Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 24 Mar 2013 12:07:59 +0200 Subject: make example links clickable, for convenience --- docs/tutorials/wiki2/definingviews.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/definingviews.rst b/docs/tutorials/wiki2/definingviews.rst index 53f8e569c..a1e2313f3 100644 --- a/docs/tutorials/wiki2/definingviews.rst +++ b/docs/tutorials/wiki2/definingviews.rst @@ -346,20 +346,20 @@ We can finally examine our application in a browser (See :ref:`wiki2-start-the-application`). Launch a browser and visit each of the following URLs, check that the result is as expected: -- ``http://localhost:6543`` in a browser invokes the +- http://localhost:6543 in a browser invokes the ``view_wiki`` view. This always redirects to the ``view_page`` view of the FrontPage page object. -- ``http://localhost:6543/FrontPage`` in a browser invokes +- http://localhost:6543/FrontPage in a browser invokes the ``view_page`` view of the front page object. -- ``http://localhost:6543/FrontPage/edit_page`` in a browser +- http://localhost:6543/FrontPage/edit_page in a browser invokes the edit view for the front page object. -- ``http://localhost:6543/add_page/SomePageName`` in a +- http://localhost:6543/add_page/SomePageName in a browser invokes the add view for a page. -- To generate an error, visit ``http://localhost:6543/foobars/edit_page`` which +- To generate an error, visit http://localhost:6543/foobars/edit_page which will generate a ``NoResultFound: No row was found for one()`` error. You'll see an interactive traceback facility provided by :term:`pyramid_debugtoolbar`. -- cgit v1.2.3 From 4febbc439b95ff29bcfca3bc33d123d80c304bd7 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 25 Mar 2013 02:03:24 +0200 Subject: make example links clickable, for convenience --- docs/tutorials/wiki2/authorization.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index 5ede26920..01c301e74 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -381,21 +381,21 @@ We can finally examine our application in a browser (See :ref:`wiki2-start-the-application`). Launch a browser and visit each of the following URLs, check that the result is as expected: -- ``http://localhost:6543/`` invokes the +- http://localhost:6543/ invokes the ``view_wiki`` view. This always redirects to the ``view_page`` view of the FrontPage page object. It is executable by any user. -- ``http://localhost:6543/FrontPage`` invokes +- http://localhost:6543/FrontPage invokes the ``view_page`` view of the FrontPage page object. -- ``http://localhost:6543/FrontPage/edit_page`` +- http://localhost:6543/FrontPage/edit_page invokes the edit view for the FrontPage object. It is executable by only the ``editor`` user. If a different user (or the anonymous user) invokes it, a login form will be displayed. Supplying the credentials with the username ``editor``, password ``editor`` will display the edit page form. -- ``http://localhost:6543/add_page/SomePageName`` +- http://localhost:6543/add_page/SomePageName invokes the add view for a page. It is executable by only the ``editor`` user. If a different user (or the anonymous user) invokes it, a login form will be displayed. Supplying the -- cgit v1.2.3 From 70cc73739af9171f4c918253eb73994ec63677fe Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 25 Mar 2013 01:37:41 -0700 Subject: give installation a colectomy; give it headings; --- docs/tutorials/wiki2/installation.rst | 60 +++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 20 deletions(-) (limited to 'docs') diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst index 3543d9b9c..17788cdde 100644 --- a/docs/tutorials/wiki2/installation.rst +++ b/docs/tutorials/wiki2/installation.rst @@ -20,7 +20,8 @@ Next let's create a `virtualenv` workspace for our project. We will use the `VENV` environment variable instead of absolute path of the virtual environment. -**On UNIX:** +On UNIX +^^^^^^^ .. code-block:: text @@ -29,7 +30,8 @@ virtual environment. New python executable in /home/foo/env/bin/python Installing setuptools.............done. -**On Windows:** +On Windows +^^^^^^^^^^ Set the `VENV` environment variable. @@ -55,13 +57,15 @@ Python 3.2: Install Pyramid Into the Virtual Python Environment --------------------------------------------------- -**On UNIX:** +On UNIX +^^^^^^^ .. code-block:: text $ $VENV/bin/easy_install pyramid -**On Windows:** +On Windows +^^^^^^^^^^ .. code-block:: text @@ -88,13 +92,15 @@ Change Directory to Your Virtual Python Environment Change directory to the ``pyramidtut`` directory. -**On UNIX:** +On UNIX +^^^^^^^ .. code-block:: text $ cd pyramidtut -**On Windows:** +On Windows +^^^^^^^^^^ .. code-block:: text @@ -123,13 +129,15 @@ required files. For example, `pcreate` creates the The below instructions assume your current working directory is the "virtualenv" named "pyramidtut". -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/pcreate -s alchemy tutorial -**On Windows:** +On Windows +---------- .. code-block:: text @@ -152,14 +160,16 @@ the project as a development egg in your workspace using the directory you created in :ref:`sql_making_a_project`, and run the ``setup.py develop`` command using the virtualenv Python interpreter. -**On UNIX:** +On UNIX +------- .. code-block:: text $ cd tutorial $ $VENV/bin/python setup.py develop -**On Windows:** +On Windows +---------- .. code-block:: text @@ -180,13 +190,15 @@ Running the Tests After you've installed the project in development mode, you may run the tests for the project. -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/python setup.py test -q -**On Windows:** +On Windows +---------- .. code-block:: text @@ -212,13 +224,15 @@ tests. To get this functionality working, we'll need to install the ``nose`` and ``coverage`` packages into our ``virtualenv``: -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/easy_install nose coverage -**On Windows:** +On Windows +---------- .. code-block:: text @@ -227,13 +241,15 @@ To get this functionality working, we'll need to install the ``nose`` and Once ``nose`` and ``coverage`` are installed, we can actually run the coverage tests. -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/nosetests --cover-package=tutorial --cover-erase --with-coverage -**On Windows:** +On Windows +---------- .. code-block:: text @@ -271,13 +287,15 @@ script` to initialize our database. Type the following command, make sure you are still in the ``tutorial`` directory (the directory with a ``development.ini`` in it): -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/initialize_tutorial_db development.ini -**On Windows:** +On Windows +---------- .. code-block:: text @@ -319,13 +337,15 @@ Starting the Application Start the application. -**On UNIX:** +On UNIX +------- .. code-block:: text $ $VENV/bin/pserve development.ini --reload -**On Windows:** +On Windows +---------- .. code-block:: text -- cgit v1.2.3