From 530a72d31bd514b565fb808b0f6e4c1c852945d1 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:30:16 -0700 Subject: Clean up code-blocks in tutorials/wiki/definingmodels --- docs/tutorials/wiki/definingmodels.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/definingmodels.rst b/docs/tutorials/wiki/definingmodels.rst index 419fede62..e973cfdfe 100644 --- a/docs/tutorials/wiki/definingmodels.rst +++ b/docs/tutorials/wiki/definingmodels.rst @@ -43,8 +43,8 @@ Edit ``models.py`` Open ``tutorial/models.py`` file and edit it to look like the following: .. literalinclude:: src/models/tutorial/models.py - :linenos: - :language: python + :linenos: + :language: python The first thing we want to do is remove the ``MyModel`` class from the generated ``models.py`` file. The ``MyModel`` class is only a sample and @@ -91,6 +91,6 @@ up with a Python traceback on your console that ends with this exception: .. code-block:: text - ImportError: cannot import name MyModel + ImportError: cannot import name MyModel This will also happen if you attempt to run the tests. -- cgit v1.2.3 From 1ab8797e38a9ea9e1691224e15b5849de6d2f68d Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:31:34 -0700 Subject: Clean up code-blocks in tutorials/wiki/definingviews --- docs/tutorials/wiki/definingviews.rst | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index f4ca9b8d7..0bdb05a56 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -46,9 +46,9 @@ parameter in the ``setup()`` function. Open ``setup.py`` and edit it to look like the following: .. literalinclude:: src/views/setup.py - :linenos: - :emphasize-lines: 22 - :language: python + :linenos: + :emphasize-lines: 22 + :language: python Only the highlighted line needs to be added. @@ -68,22 +68,22 @@ On UNIX: .. code-block:: bash - $ cd tutorial - $ $VENV/bin/pip install -e . + cd tutorial + $VENV/bin/pip install -e . On Windows: .. code-block:: doscon - c:\> cd tutorial - c:\tutorial> %VENV%\Scripts\pip install -e . + cd tutorial + %VENV%\Scripts\pip install -e . Success executing this command will end with a line to the console something like: .. code-block:: text - Successfully installed docutils-0.13.1 tutorial + Successfully installed docutils-0.13.1 tutorial Adding view functions in ``views.py`` @@ -93,8 +93,8 @@ It's time for a major change. Open ``tutorial/views.py`` and edit it to look like the following: .. literalinclude:: src/views/tutorial/views.py - :linenos: - :language: python + :linenos: + :language: python We added some imports and created a regular expression to find "WikiWords". @@ -126,9 +126,9 @@ The ``view_wiki`` view function Following is the code for the ``view_wiki`` view function and its decorator: .. literalinclude:: src/views/tutorial/views.py - :lines: 12-14 - :lineno-match: - :language: python + :lines: 12-14 + :lineno-match: + :language: python .. note:: In our code, we use an *import* that is *relative* to our package named ``tutorial``, meaning we can omit the name of the package in the @@ -164,9 +164,9 @@ The ``view_page`` view function Here is the code for the ``view_page`` view function and its decorator: .. literalinclude:: src/views/tutorial/views.py - :lines: 16-33 - :lineno-match: - :language: python + :lines: 16-33 + :lineno-match: + :language: python The ``view_page`` function is configured to respond as the default view of a Page resource. We provide it with a ``@view_config`` decorator which @@ -217,9 +217,9 @@ The ``add_page`` view function Here is the code for the ``add_page`` view function and its decorator: .. literalinclude:: src/views/tutorial/views.py - :lines: 35-50 - :lineno-match: - :language: python + :lines: 35-50 + :lineno-match: + :language: python The ``add_page`` function is configured to respond when the context resource is a Wiki and the :term:`view name` is ``add_page``. We provide it with a @@ -271,9 +271,9 @@ The ``edit_page`` view function Here is the code for the ``edit_page`` view function and its decorator: .. literalinclude:: src/views/tutorial/views.py - :lines: 52-60 - :lineno-match: - :language: python + :lines: 52-60 + :lineno-match: + :language: python The ``edit_page`` function is configured to respond when the context is a Page resource and the :term:`view name` is ``edit_page``. We provide it @@ -316,9 +316,9 @@ The ``view.pt`` template Rename ``tutorial/templates/mytemplate.pt`` to ``tutorial/templates/view.pt`` and edit the emphasized lines to look like the following: .. literalinclude:: src/views/tutorial/templates/view.pt - :linenos: - :language: html - :emphasize-lines: 11-12,37-52 + :linenos: + :language: html + :emphasize-lines: 11-12,37-52 This template is used by ``view_page()`` for displaying a single wiki page. It includes: @@ -335,8 +335,8 @@ The ``edit.pt`` template Copy ``tutorial/templates/view.pt`` to ``tutorial/templates/edit.pt`` and edit the emphasized lines to look like the following: .. literalinclude:: src/views/tutorial/templates/edit.pt - :linenos: - :language: html + :linenos: + :language: html This template is used by ``add_page()`` and ``edit_page()`` for adding and editing a wiki page. It displays a page containing a form that includes: -- cgit v1.2.3 From e7e882123059c6740b061b9aa2a8bec97f17e328 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:31:57 -0700 Subject: Clean up code-blocks in tutorials/wiki/distributing --- docs/tutorials/wiki/distributing.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/distributing.rst b/docs/tutorials/wiki/distributing.rst index 011a94f51..3937fcff8 100644 --- a/docs/tutorials/wiki/distributing.rst +++ b/docs/tutorials/wiki/distributing.rst @@ -13,23 +13,23 @@ On UNIX: .. code-block:: bash - $ $VENV/bin/python setup.py sdist + $VENV/bin/python setup.py sdist On Windows: .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\python setup.py sdist + %VENV%\Scripts\python setup.py sdist The output of such a command will be something like: .. code-block:: text - running sdist - # more output - creating dist - Creating tar archive - removing 'tutorial-0.0' (and everything under it) + running sdist + # more output + creating dist + Creating tar archive + removing 'tutorial-0.0' (and everything under it) Note that this command creates a tarball in the "dist" subdirectory named ``tutorial-0.0.tar.gz``. You can send this file to your friends to show them -- cgit v1.2.3 From 919ff698d8d8e76a5f36f72cedaaff47a9e24f78 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:33:54 -0700 Subject: Clean up code-blocks in tutorials/wiki/installation --- docs/tutorials/wiki/installation.rst | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index f87d58b90..0bd3d40a5 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -30,16 +30,16 @@ On UNIX .. code-block:: bash - $ cd ~ - $ cookiecutter gh:Pylons/pyramid-cookiecutter-zodb --checkout master + cd ~ + cookiecutter gh:Pylons/pyramid-cookiecutter-zodb --checkout master On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\> cd \ - c:\> cookiecutter gh:Pylons/pyramid-cookiecutter-zodb --checkout master + cd \ + cookiecutter gh:Pylons/pyramid-cookiecutter-zodb --checkout master On all operating systems ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -60,14 +60,14 @@ On UNIX .. code-block:: bash - $ cd tutorial + cd tutorial On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\> cd tutorial + cd tutorial Set and use a ``VENV`` environment variable @@ -80,14 +80,14 @@ On UNIX .. code-block:: bash - $ export VENV=~/tutorial + export VENV=~/tutorial On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> set VENV=c:\tutorial + set VENV=c:\tutorial Create a virtual environment @@ -98,7 +98,7 @@ On UNIX .. code-block:: bash - $ python3 -m venv $VENV + python3 -m venv $VENV On Windows ^^^^^^^^^^ @@ -109,13 +109,13 @@ Python 2.7: .. code-block:: doscon - c:\tutorial> c:\Python27\Scripts\virtualenv %VENV% + c:\Python27\Scripts\virtualenv %VENV% Python 3.6: .. code-block:: doscon - c:\tutorial> python -m venv %VENV% + python -m venv %VENV% Upgrade packaging tools in the virtual environment @@ -126,14 +126,14 @@ On UNIX .. code-block:: bash - $ $VENV/bin/pip install --upgrade pip setuptools + $VENV/bin/pip install --upgrade pip setuptools On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\pip install --upgrade pip setuptools + %VENV%\Scripts\pip install --upgrade pip setuptools .. _installing_project_in_dev_mode_zodb: @@ -148,14 +148,14 @@ On UNIX .. code-block:: bash - $ $VENV/bin/pip install -e ".[testing]" + $VENV/bin/pip install -e ".[testing]" On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\pip install -e ".[testing]" + %VENV%\Scripts\pip install -e ".[testing]" On all operating systems ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -203,21 +203,21 @@ On UNIX .. code-block:: bash - $ $VENV/bin/py.test -q + $VENV/bin/py.test -q On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\py.test -q + %VENV%\Scripts\py.test -q For a successful test run, you should see output that ends like this: .. code-block:: bash - . - 1 passed in 0.24 seconds + . + 1 passed in 0.24 seconds Expose test coverage information @@ -236,14 +236,14 @@ On UNIX .. code-block:: bash - $ $VENV/bin/py.test --cov --cov-report=term-missing + $VENV/bin/py.test --cov --cov-report=term-missing On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\py.test --cov --cov-report=term-missing + %VENV%\Scripts\py.test --cov --cov-report=term-missing If successful, you will see output something like this: @@ -285,14 +285,14 @@ On UNIX .. code-block:: bash - $ $VENV/bin/py.test --cov=tutorial tutorial/tests.py -q + $VENV/bin/py.test --cov=tutorial tutorial/tests.py -q On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\py.test --cov=tutorial tutorial\tests.py -q + %VENV%\Scripts\py.test --cov=tutorial tutorial\tests.py -q py.test follows :ref:`conventions for Python test discovery `, and the configuration defaults from the cookiecutter @@ -316,14 +316,14 @@ On UNIX .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload On Windows ^^^^^^^^^^ .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\pserve development.ini --reload + %VENV%\Scripts\pserve development.ini --reload .. note:: -- cgit v1.2.3 From da34656b31f88835588f3549861abf06d6ae3c66 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:34:17 -0700 Subject: Clean up code-blocks in tutorials/wiki/tests --- docs/tutorials/wiki/tests.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index cd82c0118..798ef4447 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -45,8 +45,8 @@ Open the ``tutorial/tests.py`` module, and edit it such that it appears as follows: .. literalinclude:: src/tests/tutorial/tests.py - :linenos: - :language: python + :linenos: + :language: python Running the tests ================= @@ -60,13 +60,13 @@ On UNIX: .. code-block:: bash - $ $VENV/bin/py.test -q + $VENV/bin/py.test -q On Windows: .. code-block:: doscon - c:\tutorial> %VENV%\Scripts\py.test -q + %VENV%\Scripts\py.test -q The expected result should look like the following: -- cgit v1.2.3 From 5af30057aa5528eaa277603ee717b7111c147a51 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 19 Aug 2018 00:36:46 -0700 Subject: Standardize Unix capitalization --- docs/tutorials/wiki/background.rst | 2 +- docs/tutorials/wiki/definingviews.rst | 2 +- docs/tutorials/wiki/distributing.rst | 2 +- docs/tutorials/wiki/installation.rst | 22 +++++++++++----------- docs/tutorials/wiki/tests.rst | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/background.rst b/docs/tutorials/wiki/background.rst index c583b375c..61383c2d6 100644 --- a/docs/tutorials/wiki/background.rst +++ b/docs/tutorials/wiki/background.rst @@ -11,7 +11,7 @@ familiar to someone with :term:`Zope` experience. It uses URLs to code. It can also be followed by people without any prior Python web framework experience. -To code along with this tutorial, the developer will need a UNIX +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, and so on) *or* a Windows system of any kind. diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 0bdb05a56..e4183b8f2 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -64,7 +64,7 @@ the newly added dependency distribution. Make sure your current working directory is the root of the project (the directory in which ``setup.py`` lives) and execute the following command. -On UNIX: +On Unix: .. code-block:: bash diff --git a/docs/tutorials/wiki/distributing.rst b/docs/tutorials/wiki/distributing.rst index 3937fcff8..36d00adb4 100644 --- a/docs/tutorials/wiki/distributing.rst +++ b/docs/tutorials/wiki/distributing.rst @@ -9,7 +9,7 @@ using the ``setup.py sdist`` command. The following commands assume your current working directory contains the ``tutorial`` package and the ``setup.py`` file. -On UNIX: +On Unix: .. code-block:: bash diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index 0bd3d40a5..71fd0a957 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -23,9 +23,9 @@ We will use a :term:`cookiecutter` to create a Python package project from a Pyt Generate a Pyramid project from a cookiecutter ---------------------------------------------- -We will create a Pyramid project in your home directory for UNIX or at the root for Windows. It is assumed you know the path to where you installed ``cookiecutter``. Issue the following commands and override the defaults in the prompts as follows. +We will create a Pyramid project in your home directory for Unix or at the root for Windows. It is assumed you know the path to where you installed ``cookiecutter``. Issue the following commands and override the defaults in the prompts as follows. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -55,7 +55,7 @@ If prompted for the first item, accept the default ``yes`` by hitting return. Change directory into your newly created project ------------------------------------------------ -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -75,7 +75,7 @@ Set and use a ``VENV`` environment variable We will set the ``VENV`` environment variable to the absolute path of the virtual environment, and use it going forward. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -93,7 +93,7 @@ On Windows Create a virtual environment ---------------------------- -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -121,7 +121,7 @@ Python 3.6: Upgrade packaging tools in the virtual environment -------------------------------------------------- -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -143,7 +143,7 @@ Installing the project in development mode In order to do development on the project easily, you must "register" the project as a development egg in your workspace. We will install testing requirements at the same time. We do so with the following command. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -198,7 +198,7 @@ requirements, you may run the tests for the project. The following commands provide options to py.test that specify the module for which its tests shall be run, and to run py.test in quiet mode. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -231,7 +231,7 @@ tests. We've already installed the ``pytest-cov`` package into our virtual environment, so we can run the tests with coverage. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -280,7 +280,7 @@ These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. Without these defaults, we would need to specify the path to the module on which we want to run tests and coverage. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash @@ -311,7 +311,7 @@ Start the application Start the application. See :ref:`what_is_this_pserve_thing` for more information on ``pserve``. -On UNIX +On Unix ^^^^^^^ .. code-block:: bash diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index 798ef4447..c3a1ca79a 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -56,7 +56,7 @@ We can run these tests by using ``py.test`` similarly to how we did in already been satisfied and ``py.test`` and coverage have already been configured, so we can jump right to running tests. -On UNIX: +On Unix: .. code-block:: bash -- cgit v1.2.3 From 254710cb716dccfe536b20d077e3cb79be19c6b3 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 19 Aug 2018 00:40:12 -0700 Subject: Standardize macOS capitalization --- docs/tutorials/wiki/background.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/background.rst b/docs/tutorials/wiki/background.rst index 61383c2d6..c10ab9e55 100644 --- a/docs/tutorials/wiki/background.rst +++ b/docs/tutorials/wiki/background.rst @@ -12,7 +12,7 @@ URLs to code. It can also be followed by people without any prior Python web framework experience. 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 +machine with development tools (macOS with XCode, any Linux or BSD variant, and so on) *or* a Windows system of any kind. .. warning:: -- cgit v1.2.3