From cd648a12626e4c44405db04d673f522b8e3cc004 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 04:42:15 -0700 Subject: Clean up code-blocks in qt/authentication --- docs/quick_tutorial/authentication.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authentication.rst b/docs/quick_tutorial/authentication.rst index 529f51ddd..eb9b6b395 100644 --- a/docs/quick_tutorial/authentication.rst +++ b/docs/quick_tutorial/authentication.rst @@ -33,7 +33,7 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes authentication; cd authentication + cd ..; cp -r view_classes authentication; cd authentication #. Add ``bcrypt`` as a dependency in ``authentication/setup.py``: @@ -46,7 +46,7 @@ Steps .. code-block:: bash - $ $VENV/bin/pip install -e . + $VENV/bin/pip install -e . #. Put the security hash in the ``authentication/development.ini`` configuration file as ``tutorial.secret`` instead of putting it in the code: @@ -88,7 +88,7 @@ Steps .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in a browser. -- cgit v1.2.3 From 12abe106f13b92e82e4273348f2ab4db97ad48a2 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:08:29 -0700 Subject: Clean up code-blocks in qt/authorization --- docs/quick_tutorial/authorization.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/authorization.rst b/docs/quick_tutorial/authorization.rst index 58c1d2582..e80f88c51 100644 --- a/docs/quick_tutorial/authorization.rst +++ b/docs/quick_tutorial/authorization.rst @@ -41,31 +41,31 @@ Steps .. code-block:: bash - $ cd ..; cp -r authentication authorization; cd authorization - $ $VENV/bin/pip install -e . + cd ..; cp -r authentication authorization; cd authorization + $VENV/bin/pip install -e . #. Start by changing ``authorization/tutorial/__init__.py`` to specify a root factory to the :term:`configurator`: .. literalinclude:: authorization/tutorial/__init__.py - :linenos: + :linenos: #. That means we need to implement ``authorization/tutorial/resources.py``: .. literalinclude:: authorization/tutorial/resources.py - :linenos: + :linenos: #. Change ``authorization/tutorial/views.py`` to require the ``edit`` permission on the ``hello`` view and implement the forbidden view: .. literalinclude:: authorization/tutorial/views.py - :linenos: + :linenos: #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in a browser. -- cgit v1.2.3 From e6e8bf5e2b67d67d5589ffc5f78b6fbb15c752a3 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:09:24 -0700 Subject: Clean up code-blocks in qt/cookiecutters --- docs/quick_tutorial/cookiecutters.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/cookiecutters.rst b/docs/quick_tutorial/cookiecutters.rst index f8568206d..045808884 100644 --- a/docs/quick_tutorial/cookiecutters.rst +++ b/docs/quick_tutorial/cookiecutters.rst @@ -28,7 +28,7 @@ Steps .. code-block:: bash - $ $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master + $VENV/bin/cookiecutter gh:Pylons/pyramid-cookiecutter-starter --checkout master If prompted for the first item, accept the default ``yes`` by hitting return. @@ -49,20 +49,20 @@ Steps .. code-block:: bash # Change directory into your newly created project. - $ cd cc_starter + cd cc_starter # Create a new virtual environment... - $ python3 -m venv env + python3 -m venv env # ...where we upgrade packaging tools... - $ env/bin/pip install --upgrade pip setuptools + env/bin/pip install --upgrade pip setuptools # ...and into which we install our project. - $ env/bin/pip install -e . + env/bin/pip install -e . #. Start up the application by pointing :app:`Pyramid`'s ``pserve`` command at the project's (generated) configuration file: .. code-block:: bash - $ env/bin/pserve development.ini --reload + env/bin/pserve development.ini --reload On start up, ``pserve`` logs some output: -- cgit v1.2.3 From 9be675e895dced0d0c56a27c3144bedfdad45721 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:11:30 -0700 Subject: Clean up code-blocks in qt/databases --- docs/quick_tutorial/databases.rst | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/databases.rst b/docs/quick_tutorial/databases.rst index 87f2703c7..7d10f2470 100644 --- a/docs/quick_tutorial/databases.rst +++ b/docs/quick_tutorial/databases.rst @@ -45,7 +45,7 @@ Steps .. code-block:: bash - $ cd ..; cp -r forms databases; cd databases + cd ..; cp -r forms databases; cd databases #. We need to add some dependencies in ``databases/setup.py`` as well as an "entry point" for the command-line script: @@ -62,85 +62,85 @@ Steps new pieces: .. literalinclude:: databases/development.ini - :language: ini + :language: ini #. This engine configuration now needs to be read into the application through changes in ``databases/tutorial/__init__.py``: .. literalinclude:: databases/tutorial/__init__.py - :linenos: + :linenos: #. Make a command-line script at ``databases/tutorial/initialize_db.py`` to initialize the database: .. literalinclude:: databases/tutorial/initialize_db.py - :linenos: + :linenos: #. Since ``setup.py`` changed, we now run it: .. code-block:: bash - $ $VENV/bin/pip install -e . + $VENV/bin/pip install -e . #. The script references some models in ``databases/tutorial/models.py``: .. literalinclude:: databases/tutorial/models.py - :linenos: + :linenos: #. Let's run this console script, thus producing our database and table: .. code-block:: bash - $ $VENV/bin/initialize_tutorial_db development.ini - - 2016-04-16 13:01:33,055 INFO [sqlalchemy.engine.base.Engine][MainThread] SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1 - 2016-04-16 13:01:33,055 INFO [sqlalchemy.engine.base.Engine][MainThread] () - 2016-04-16 13:01:33,056 INFO [sqlalchemy.engine.base.Engine][MainThread] SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1 - 2016-04-16 13:01:33,056 INFO [sqlalchemy.engine.base.Engine][MainThread] () - 2016-04-16 13:01:33,057 INFO [sqlalchemy.engine.base.Engine][MainThread] PRAGMA table_info("wikipages") - 2016-04-16 13:01:33,057 INFO [sqlalchemy.engine.base.Engine][MainThread] () - 2016-04-16 13:01:33,058 INFO [sqlalchemy.engine.base.Engine][MainThread] - CREATE TABLE wikipages ( - uid INTEGER NOT NULL, - title TEXT, - body TEXT, - PRIMARY KEY (uid), - UNIQUE (title) - ) - - - 2016-04-16 13:01:33,058 INFO [sqlalchemy.engine.base.Engine][MainThread] () - 2016-04-16 13:01:33,059 INFO [sqlalchemy.engine.base.Engine][MainThread] COMMIT - 2016-04-16 13:01:33,062 INFO [sqlalchemy.engine.base.Engine][MainThread] BEGIN (implicit) - 2016-04-16 13:01:33,062 INFO [sqlalchemy.engine.base.Engine][MainThread] INSERT INTO wikipages (title, body) VALUES (?, ?) - 2016-04-16 13:01:33,063 INFO [sqlalchemy.engine.base.Engine][MainThread] ('Root', '

Root

') - 2016-04-16 13:01:33,063 INFO [sqlalchemy.engine.base.Engine][MainThread] COMMIT + $VENV/bin/initialize_tutorial_db development.ini + + 2016-04-16 13:01:33,055 INFO [sqlalchemy.engine.base.Engine][MainThread] SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1 + 2016-04-16 13:01:33,055 INFO [sqlalchemy.engine.base.Engine][MainThread] () + 2016-04-16 13:01:33,056 INFO [sqlalchemy.engine.base.Engine][MainThread] SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1 + 2016-04-16 13:01:33,056 INFO [sqlalchemy.engine.base.Engine][MainThread] () + 2016-04-16 13:01:33,057 INFO [sqlalchemy.engine.base.Engine][MainThread] PRAGMA table_info("wikipages") + 2016-04-16 13:01:33,057 INFO [sqlalchemy.engine.base.Engine][MainThread] () + 2016-04-16 13:01:33,058 INFO [sqlalchemy.engine.base.Engine][MainThread] + CREATE TABLE wikipages ( + uid INTEGER NOT NULL, + title TEXT, + body TEXT, + PRIMARY KEY (uid), + UNIQUE (title) + ) + + + 2016-04-16 13:01:33,058 INFO [sqlalchemy.engine.base.Engine][MainThread] () + 2016-04-16 13:01:33,059 INFO [sqlalchemy.engine.base.Engine][MainThread] COMMIT + 2016-04-16 13:01:33,062 INFO [sqlalchemy.engine.base.Engine][MainThread] BEGIN (implicit) + 2016-04-16 13:01:33,062 INFO [sqlalchemy.engine.base.Engine][MainThread] INSERT INTO wikipages (title, body) VALUES (?, ?) + 2016-04-16 13:01:33,063 INFO [sqlalchemy.engine.base.Engine][MainThread] ('Root', '

Root

') + 2016-04-16 13:01:33,063 INFO [sqlalchemy.engine.base.Engine][MainThread] COMMIT #. With our data now driven by SQLAlchemy queries, we need to update our ``databases/tutorial/views.py``: .. literalinclude:: databases/tutorial/views.py - :linenos: + :linenos: #. Our tests in ``databases/tutorial/tests.py`` changed to include SQLAlchemy bootstrapping: .. literalinclude:: databases/tutorial/tests.py - :linenos: + :linenos: #. Run the tests in your package using ``py.test``: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .. - 2 passed in 1.41 seconds + $VENV/bin/py.test tutorial/tests.py -q + .. + 2 passed in 1.41 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in a browser. -- cgit v1.2.3 From 1ee470e3095f45522125a8074ffda7cf54dceaca Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:12:36 -0700 Subject: Clean up code-blocks in qt/debugtoolbar --- docs/quick_tutorial/debugtoolbar.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/debugtoolbar.rst b/docs/quick_tutorial/debugtoolbar.rst index 4402fcdbd..b49dd1f97 100644 --- a/docs/quick_tutorial/debugtoolbar.rst +++ b/docs/quick_tutorial/debugtoolbar.rst @@ -37,22 +37,22 @@ Steps .. code-block:: bash - $ cd ..; cp -r ini debugtoolbar; cd debugtoolbar - $ $VENV/bin/pip install -e . - $ $VENV/bin/pip install pyramid_debugtoolbar + cd ..; cp -r ini debugtoolbar; cd debugtoolbar + $VENV/bin/pip install -e . + $VENV/bin/pip install pyramid_debugtoolbar #. Our ``debugtoolbar/development.ini`` gets a configuration entry for ``pyramid.includes``: .. literalinclude:: debugtoolbar/development.ini - :language: ini - :linenos: + :language: ini + :linenos: #. Run the WSGI application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in your browser. See the handy toolbar on the right. @@ -100,15 +100,15 @@ Extra credit .. code-block:: python - def hello_world(request): - return Response('

Hello World!

') + def hello_world(request): + return Response('

Hello World!

') to: .. code-block:: python - def hello_world(request): - return xResponse('

Hello World!

') + def hello_world(request): + return xResponse('

Hello World!

') Save, and visit http://localhost:6543/ again. Notice the nice traceback display. On the lowest line, click the "screen" icon to the right, and try -- cgit v1.2.3 From ed5665e5d500ecf6cc70ece96a2b9f43af2545c8 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:13:40 -0700 Subject: Clean up code-blocks in qt/forms --- docs/quick_tutorial/forms.rst | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/forms.rst b/docs/quick_tutorial/forms.rst index 45eb05a8f..be745764b 100644 --- a/docs/quick_tutorial/forms.rst +++ b/docs/quick_tutorial/forms.rst @@ -35,71 +35,71 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes forms; cd forms + cd ..; cp -r view_classes forms; cd forms #. Let's edit ``forms/setup.py`` to declare a dependency on Deform (which then pulls in Colander as a dependency: .. literalinclude:: forms/setup.py - :emphasize-lines: 4 - :linenos: + :emphasize-lines: 4 + :linenos: #. We can now install our project in development mode: .. code-block:: bash - $ $VENV/bin/pip install -e . + $VENV/bin/pip install -e . #. Register a static view in ``forms/tutorial/__init__.py`` for Deform's CSS, JavaScript, etc., as well as our demo wiki page's views: .. literalinclude:: forms/tutorial/__init__.py - :linenos: + :linenos: #. Implement the new views, as well as the form schemas and some dummy data, in ``forms/tutorial/views.py``: .. literalinclude:: forms/tutorial/views.py - :linenos: + :linenos: #. A template for the top of the "wiki" in ``forms/tutorial/wiki_view.pt``: .. literalinclude:: forms/tutorial/wiki_view.pt - :language: html - :linenos: + :language: html + :linenos: #. Another template for adding/editing in ``forms/tutorial/wikipage_addedit.pt``: .. literalinclude:: forms/tutorial/wikipage_addedit.pt - :language: html - :linenos: + :language: html + :linenos: #. Add a template at ``forms/tutorial/wikipage_view.pt`` for viewing a wiki page: .. literalinclude:: forms/tutorial/wikipage_view.pt - :language: html - :linenos: + :language: html + :linenos: #. Our tests in ``forms/tutorial/tests.py`` don't run, so let's modify them: .. literalinclude:: forms/tutorial/tests.py - :linenos: + :linenos: #. Run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .. - 2 passed in 0.45 seconds + $VENV/bin/py.test tutorial/tests.py -q + .. + 2 passed in 0.45 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in a browser. -- cgit v1.2.3 From 473796179fbc3a67732829e9ac22357520ce4607 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:14:14 -0700 Subject: Clean up code-blocks in qt/functional_testing --- docs/quick_tutorial/functional_testing.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/functional_testing.rst b/docs/quick_tutorial/functional_testing.rst index 518e3d67d..fa56b4589 100644 --- a/docs/quick_tutorial/functional_testing.rst +++ b/docs/quick_tutorial/functional_testing.rst @@ -36,15 +36,15 @@ Steps .. code-block:: bash - $ cd ..; cp -r unit_testing functional_testing; cd functional_testing - $ $VENV/bin/pip install -e . - $ $VENV/bin/pip install webtest + cd ..; cp -r unit_testing functional_testing; cd functional_testing + $VENV/bin/pip install -e . + $VENV/bin/pip install webtest #. Let's extend ``functional_testing/tutorial/tests.py`` to include a functional test: .. literalinclude:: functional_testing/tutorial/tests.py - :linenos: + :linenos: Be sure this file is not executable, or ``pytest`` may not include your tests. @@ -53,9 +53,9 @@ Steps .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .. - 2 passed in 0.25 seconds + $VENV/bin/py.test tutorial/tests.py -q + .. + 2 passed in 0.25 seconds Analysis -- cgit v1.2.3 From 48608b6056fef3922157d5d0b67e8145305fa6be Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:14:45 -0700 Subject: Clean up code-blocks in qt/functional_testing --- docs/quick_tutorial/hello_world.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/hello_world.rst b/docs/quick_tutorial/hello_world.rst index 94242f1f4..161f07ac8 100644 --- a/docs/quick_tutorial/hello_world.rst +++ b/docs/quick_tutorial/hello_world.rst @@ -49,18 +49,18 @@ Steps .. code-block:: bash - $ cd ~/projects/quick_tutorial; mkdir hello_world; cd hello_world + cd ~/projects/quick_tutorial; mkdir hello_world; cd hello_world #. Copy the following into ``hello_world/app.py``: .. literalinclude:: hello_world/app.py - :linenos: + :linenos: #. Run the application: .. code-block:: bash - $ $VENV/bin/python app.py + $VENV/bin/python app.py #. Open http://localhost:6543/ in your browser. @@ -95,13 +95,13 @@ Extra credit .. code-block:: python - print('Incoming request') + print('Incoming request') ...instead of: .. code-block:: python - print 'Incoming request' + print 'Incoming request' #. What happens if you return a string of HTML? A sequence of integers? -- cgit v1.2.3 From fca57a1daaa553a5a56de2c785e3655c2f82bcfd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:16:45 -0700 Subject: Clean up code-blocks in qt/ini --- docs/quick_tutorial/ini.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/ini.rst b/docs/quick_tutorial/ini.rst index e4f30405f..ce92914fe 100644 --- a/docs/quick_tutorial/ini.rst +++ b/docs/quick_tutorial/ini.rst @@ -39,44 +39,44 @@ Steps .. code-block:: bash - $ cd ..; cp -r package ini; cd ini + cd ..; cp -r package ini; cd ini #. Our ``ini/setup.py`` needs a setuptools "entry point" in the ``setup()`` function: .. literalinclude:: ini/setup.py - :linenos: + :linenos: #. We can now install our project, thus generating (or re-generating) an "egg" at ``ini/tutorial.egg-info``: .. code-block:: bash - $ $VENV/bin/pip install -e . + $VENV/bin/pip install -e . #. Let's make a file ``ini/development.ini`` for our configuration: .. literalinclude:: ini/development.ini - :language: ini - :linenos: + :language: ini + :linenos: #. We can refactor our startup code from the previous step's ``app.py`` into ``ini/tutorial/__init__.py``: .. literalinclude:: ini/tutorial/__init__.py - :linenos: + :linenos: #. Now that ``ini/tutorial/app.py`` isn't used, let's remove it: .. code-block:: bash - $ rm tutorial/app.py + rm tutorial/app.py #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/. -- cgit v1.2.3 From a0019b2276432abed88090adcdb80e728b799366 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:17:59 -0700 Subject: Clean up code-blocks in qt/jinja3 --- docs/quick_tutorial/jinja2.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/jinja2.rst b/docs/quick_tutorial/jinja2.rst index 4faa81fc4..87122a374 100644 --- a/docs/quick_tutorial/jinja2.rst +++ b/docs/quick_tutorial/jinja2.rst @@ -27,38 +27,38 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes jinja2; cd jinja2 - $ $VENV/bin/pip install -e . - $ $VENV/bin/pip install pyramid_jinja2 + cd ..; cp -r view_classes jinja2; cd jinja2 + $VENV/bin/pip install -e . + $VENV/bin/pip install pyramid_jinja2 #. We need to include ``pyramid_jinja2`` in ``jinja2/tutorial/__init__.py``: .. literalinclude:: jinja2/tutorial/__init__.py - :linenos: + :linenos: #. Our ``jinja2/tutorial/views.py`` simply changes its ``renderer``: .. literalinclude:: jinja2/tutorial/views.py - :linenos: + :linenos: #. Add ``jinja2/tutorial/home.jinja2`` as a template: .. literalinclude:: jinja2/tutorial/home.jinja2 - :language: html + :language: html #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.40 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.40 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in your browser. -- cgit v1.2.3 From 020a8ab6ca7aa04a16de973abf39840c86fdd697 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:18:57 -0700 Subject: Clean up code-blocks in qt/json --- docs/quick_tutorial/json.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/json.rst b/docs/quick_tutorial/json.rst index ff153d2b5..98283424c 100644 --- a/docs/quick_tutorial/json.rst +++ b/docs/quick_tutorial/json.rst @@ -31,32 +31,32 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes json; cd json - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes json; cd json + $VENV/bin/pip install -e . #. We add a new route for ``hello_json`` in ``json/tutorial/__init__.py``: .. literalinclude:: json/tutorial/__init__.py - :linenos: + :linenos: #. Rather than implement a new view, we will "stack" another decorator on the ``hello`` view in ``views.py``: .. literalinclude:: json/tutorial/views.py - :linenos: + :linenos: #. We need a new functional test at the end of ``json/tutorial/tests.py``: .. literalinclude:: json/tutorial/tests.py - :linenos: + :linenos: #. Run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - ..... - 5 passed in 0.47 seconds + $VENV/bin/py.test tutorial/tests.py -q + ..... + 5 passed in 0.47 seconds #. Run your Pyramid application with: -- cgit v1.2.3 From cc67279154e110edd2b1625066236921b8494ba4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:19:38 -0700 Subject: Clean up code-blocks in qt/logging --- docs/quick_tutorial/logging.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/logging.rst b/docs/quick_tutorial/logging.rst index 0a530e91f..ccbb7970f 100644 --- a/docs/quick_tutorial/logging.rst +++ b/docs/quick_tutorial/logging.rst @@ -36,13 +36,13 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes logging; cd logging - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes logging; cd logging + $VENV/bin/pip install -e . #. Extend ``logging/tutorial/views.py`` to log a message: .. literalinclude:: logging/tutorial/views.py - :linenos: + :linenos: #. Finally let's edit ``development.ini`` configuration file to enable logging for our Pyramid application: @@ -54,15 +54,15 @@ Steps .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.41 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.41 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ and http://localhost:6543/howdy in your browser. Note, both in the console and in the debug toolbar, the message that you -- cgit v1.2.3 From 74bb4c4171b09cf53467a6e2c576ea401aae1515 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:20:51 -0700 Subject: Clean up code-blocks in qt/more_view_classes --- docs/quick_tutorial/more_view_classes.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/more_view_classes.rst b/docs/quick_tutorial/more_view_classes.rst index 30234ea2e..9caf0f36f 100644 --- a/docs/quick_tutorial/more_view_classes.rst +++ b/docs/quick_tutorial/more_view_classes.rst @@ -57,63 +57,63 @@ Steps .. code-block:: bash - $ cd ..; cp -r templating more_view_classes; cd more_view_classes - $ $VENV/bin/pip install -e . + cd ..; cp -r templating more_view_classes; cd more_view_classes + $VENV/bin/pip install -e . #. Our route in ``more_view_classes/tutorial/__init__.py`` needs some replacement patterns: .. literalinclude:: more_view_classes/tutorial/__init__.py - :linenos: + :linenos: #. Our ``more_view_classes/tutorial/views.py`` now has a view class with several views: .. literalinclude:: more_view_classes/tutorial/views.py - :linenos: + :linenos: #. Our primary view needs a template at ``more_view_classes/tutorial/home.pt``: .. literalinclude:: more_view_classes/tutorial/home.pt - :language: html + :language: html #. Ditto for our other view from the previous section at ``more_view_classes/tutorial/hello.pt``: .. literalinclude:: more_view_classes/tutorial/hello.pt - :language: html + :language: html #. We have an edit view that also needs a template at ``more_view_classes/tutorial/edit.pt``: .. literalinclude:: more_view_classes/tutorial/edit.pt - :language: html + :language: html #. And finally the delete view's template at ``more_view_classes/tutorial/delete.pt``: .. literalinclude:: more_view_classes/tutorial/delete.pt - :language: html + :language: html #. Our tests in ``more_view_classes/tutorial/tests.py`` fail, so let's modify them: .. literalinclude:: more_view_classes/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .. - 2 passed in 0.40 seconds + $VENV/bin/py.test tutorial/tests.py -q + .. + 2 passed in 0.40 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/howdy/jane/doe in your browser. Click the ``Save`` and ``Delete`` buttons, and watch the output in the console window. @@ -161,13 +161,13 @@ previously hardcoded the URLs, such as: .. code-block:: html - Howdy + Howdy In ``home.pt`` we switched to: .. code-block:: xml - form Pyramid has rich facilities to help generate URLs in a flexible, non-error -- cgit v1.2.3 From 7574fb1d91a3bd5567fc74beb5cb7ec5f617d08f Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:21:18 -0700 Subject: Clean up code-blocks in qt/package --- docs/quick_tutorial/package.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/package.rst b/docs/quick_tutorial/package.rst index 66bafcdb9..74bd61083 100644 --- a/docs/quick_tutorial/package.rst +++ b/docs/quick_tutorial/package.rst @@ -53,7 +53,7 @@ Steps .. code-block:: bash - $ cd ..; mkdir package; cd package + cd ..; mkdir package; cd package #. In ``package/setup.py``, enter the following: @@ -64,8 +64,8 @@ Steps .. code-block:: bash - $ $VENV/bin/pip install -e . - $ mkdir tutorial + $VENV/bin/pip install -e . + mkdir tutorial #. Enter the following into ``package/tutorial/__init__.py``: @@ -79,7 +79,7 @@ Steps .. code-block:: bash - $ $VENV/bin/python tutorial/app.py + $VENV/bin/python tutorial/app.py #. Open http://localhost:6543/ in your browser. -- cgit v1.2.3 From 47524e35e1ebd86a1c5ca4b92a822472a6446109 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:22:02 -0700 Subject: Clean up code-blocks in qt/request_response --- docs/quick_tutorial/request_response.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/request_response.rst b/docs/quick_tutorial/request_response.rst index ece8cdd6f..098753820 100644 --- a/docs/quick_tutorial/request_response.rst +++ b/docs/quick_tutorial/request_response.rst @@ -39,37 +39,37 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes request_response; cd request_response - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes request_response; cd request_response + $VENV/bin/pip install -e . #. Simplify the routes in ``request_response/tutorial/__init__.py``: .. literalinclude:: request_response/tutorial/__init__.py - :linenos: + :linenos: #. We only need one view in ``request_response/tutorial/views.py``: .. literalinclude:: request_response/tutorial/views.py - :linenos: + :linenos: #. Update the tests in ``request_response/tutorial/tests.py``: .. literalinclude:: request_response/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - ..... - 5 passed in 0.30 seconds + $VENV/bin/py.test tutorial/tests.py -q + ..... + 5 passed in 0.30 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in your browser. You will be redirected to http://localhost:6543/plain. @@ -91,7 +91,7 @@ the body of the response: .. code-block:: text - URL http://localhost:6543/plain?name=alice with name: alice + URL http://localhost:6543/plain?name=alice with name: alice Finally, we set the response's content type and body, then return the response. -- cgit v1.2.3 From 2cf5784d44d493902f6457c864197dfd33141823 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:23:03 -0700 Subject: Clean up code-blocks in qt/requirements --- docs/quick_tutorial/requirements.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index 29f263176..0da56ca0b 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -94,18 +94,18 @@ For Linux, the commands to do so are as follows: .. code-block:: bash # Mac and Linux - $ cd ~ - $ mkdir -p projects/quick_tutorial - $ cd projects/quick_tutorial + cd ~ + mkdir -p projects/quick_tutorial + cd projects/quick_tutorial For Windows: .. code-block:: doscon # Windows - c:\> cd \ - c:\> mkdir projects\quick_tutorial - c:\> cd projects\quick_tutorial + cd \ + mkdir projects\quick_tutorial + cd projects\quick_tutorial In the above figure, your user home directory is represented by ``~``. In your home directory, all of your projects are in the ``projects`` directory. This is @@ -130,12 +130,12 @@ environment`. We set an environment variable to save typing later. .. code-block:: bash # Mac and Linux - $ export VENV=~/projects/quick_tutorial/env + export VENV=~/projects/quick_tutorial/env .. code-block:: doscon # Windows - c:\> set VENV=c:\projects\quick_tutorial\env + set VENV=c:\projects\quick_tutorial\env .. _create-a-virtual-environment: @@ -151,12 +151,12 @@ environment variable. .. code-block:: bash # Mac and Linux - $ python3 -m venv $VENV + python3 -m venv $VENV .. code-block:: doscon # Windows - c:\> python -m venv %VENV% + python -m venv %VENV% .. seealso:: See also Python 3's :mod:`venv module ` and Python 2's `virtualenv `_ package. @@ -172,12 +172,12 @@ time of its release. .. code-block:: bash # Mac and Linux - $ $VENV/bin/pip install --upgrade pip setuptools + $VENV/bin/pip install --upgrade pip setuptools .. code-block:: doscon # Windows - c:\> %VENV%\Scripts\pip install --upgrade pip setuptools + %VENV%\Scripts\pip install --upgrade pip setuptools .. seealso:: See also :ref:`Why use $VENV/bin/pip instead of source bin/activate, then pip `. @@ -194,10 +194,10 @@ part is pretty easy. We'll also install a WSGI server, Waitress. .. parsed-literal:: # Mac and Linux - $ $VENV/bin/pip install "pyramid==\ |release|\ " waitress + $VENV/bin/pip install "pyramid==\ |release|\ " waitress # Windows - c:\\> %VENV%\\Scripts\\pip install "pyramid==\ |release|\ " waitress + %VENV%\\Scripts\\pip install "pyramid==\ |release|\ " waitress Our Python virtual environment now has the Pyramid software available as well as the ``waitress`` package. -- cgit v1.2.3 From 8c0fa31950e4b69142aecef5fdb8644431c79cb7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:23:51 -0700 Subject: Clean up code-blocks in qt/routing --- docs/quick_tutorial/routing.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/routing.rst b/docs/quick_tutorial/routing.rst index adbe76a62..0384892b2 100644 --- a/docs/quick_tutorial/routing.rst +++ b/docs/quick_tutorial/routing.rst @@ -50,44 +50,44 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes routing; cd routing - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes routing; cd routing + $VENV/bin/pip install -e . #. Our ``routing/tutorial/__init__.py`` needs a route with a replacement pattern: .. literalinclude:: routing/tutorial/__init__.py - :linenos: + :linenos: #. We just need one view in ``routing/tutorial/views.py``: .. literalinclude:: routing/tutorial/views.py - :linenos: + :linenos: #. We just need one view in ``routing/tutorial/home.pt``: .. literalinclude:: routing/tutorial/home.pt - :language: html - :linenos: + :language: html + :linenos: #. Update ``routing/tutorial/tests.py``: .. literalinclude:: routing/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .. - 2 passed in 0.39 seconds + $VENV/bin/py.test tutorial/tests.py -q + .. + 2 passed in 0.39 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/howdy/amy/smith in your browser. -- cgit v1.2.3 From 1d0533bcb8c7a7bbc7c2fdd28fa0d6b04d35a01a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:24:33 -0700 Subject: Clean up code-blocks in qt/sessions --- docs/quick_tutorial/sessions.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/sessions.rst b/docs/quick_tutorial/sessions.rst index df4887a4b..d67a5063a 100644 --- a/docs/quick_tutorial/sessions.rst +++ b/docs/quick_tutorial/sessions.rst @@ -36,39 +36,39 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes sessions; cd sessions - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes sessions; cd sessions + $VENV/bin/pip install -e . #. Our ``sessions/tutorial/__init__.py`` needs a choice of session factory to get registered with the :term:`configurator`: .. literalinclude:: sessions/tutorial/__init__.py - :linenos: + :linenos: #. Our views in ``sessions/tutorial/views.py`` can now use ``request.session``: .. literalinclude:: sessions/tutorial/views.py - :linenos: + :linenos: #. The template at ``sessions/tutorial/home.pt`` can display the value: .. literalinclude:: sessions/tutorial/home.pt - :language: html - :linenos: + :language: html + :linenos: #. Make sure the tests still pass: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.42 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.42 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ and http://localhost:6543/howdy in your browser. As you reload and switch between those URLs, note that the counter increases -- cgit v1.2.3 From 482cc914f0593c5747d3b14999436f4ae3368fc6 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:25:16 -0700 Subject: Clean up code-blocks in qt/static_assets --- docs/quick_tutorial/static_assets.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/static_assets.rst b/docs/quick_tutorial/static_assets.rst index 81a01061a..7a6b5dac3 100644 --- a/docs/quick_tutorial/static_assets.rst +++ b/docs/quick_tutorial/static_assets.rst @@ -23,46 +23,46 @@ Steps .. code-block:: bash - $ cd ..; cp -r view_classes static_assets; cd static_assets - $ $VENV/bin/pip install -e . + cd ..; cp -r view_classes static_assets; cd static_assets + $VENV/bin/pip install -e . #. We add a call ``config.add_static_view`` in ``static_assets/tutorial/__init__.py``: .. literalinclude:: static_assets/tutorial/__init__.py - :linenos: + :linenos: #. We can add a CSS link in the ```` of our template at ``static_assets/tutorial/home.pt``: .. literalinclude:: static_assets/tutorial/home.pt - :language: html + :language: html #. Add a CSS file at ``static_assets/tutorial/static/app.css``: .. literalinclude:: static_assets/tutorial/static/app.css - :language: css + :language: css #. We add a functional test that asserts that the newly added static file is delivered: .. literalinclude:: static_assets/tutorial/tests.py - :language: python - :pyobject: TutorialFunctionalTests.test_css - :lineno-match: + :language: python + :pyobject: TutorialFunctionalTests.test_css + :lineno-match: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 5 passed in 0.50 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 5 passed in 0.50 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ in your browser and note the new font. @@ -82,7 +82,7 @@ disk? Pyramid gives a helper that provides flexibility on URL generation: .. code-block:: html - ${request.static_url('tutorial:static/app.css')} + ${request.static_url('tutorial:static/app.css')} This matches the ``path='tutorial:static'`` in our ``config.add_static_view`` registration. By using ``request.static_url`` to generate the full URL to the -- cgit v1.2.3 From 78c485f0a81bdd7aebe75b167e638fd863287396 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:26:07 -0700 Subject: Clean up code-blocks in qt/templating --- docs/quick_tutorial/templating.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/templating.rst b/docs/quick_tutorial/templating.rst index ec6de98f8..3fbef699c 100644 --- a/docs/quick_tutorial/templating.rst +++ b/docs/quick_tutorial/templating.rst @@ -47,60 +47,60 @@ Steps .. code-block:: bash - $ cd ..; cp -r views templating; cd templating + cd ..; cp -r views templating; cd templating #. This step depends on ``pyramid_chameleon``, so add it as a dependency in ``templating/setup.py``: .. literalinclude:: templating/setup.py - :linenos: + :linenos: #. Now we can activate the development-mode distribution: .. code-block:: bash - $ $VENV/bin/pip install -e . + $VENV/bin/pip install -e . #. We need to connect ``pyramid_chameleon`` as a renderer by making a call in the setup of ``templating/tutorial/__init__.py``: .. literalinclude:: templating/tutorial/__init__.py - :linenos: + :linenos: #. Our ``templating/tutorial/views.py`` no longer has HTML in it: .. literalinclude:: templating/tutorial/views.py - :linenos: + :linenos: #. Instead we have ``templating/tutorial/home.pt`` as a template: .. literalinclude:: templating/tutorial/home.pt - :language: html + :language: html #. For convenience, change ``templating/development.ini`` to reload templates automatically with ``pyramid.reload_templates``: .. literalinclude:: templating/development.ini - :language: ini + :language: ini #. Our unit tests in ``templating/tutorial/tests.py`` can focus on data: .. literalinclude:: templating/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.46 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.46 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ and http://localhost:6543/howdy in your browser. -- cgit v1.2.3 From 5593c0282d1ceab1c7b03e2c62fadc71be9bebe4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:26:31 -0700 Subject: Clean up code-blocks in qt/tutorial_approach --- docs/quick_tutorial/tutorial_approach.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/tutorial_approach.rst b/docs/quick_tutorial/tutorial_approach.rst index 83b229746..7ef28bdb8 100644 --- a/docs/quick_tutorial/tutorial_approach.rst +++ b/docs/quick_tutorial/tutorial_approach.rst @@ -40,7 +40,7 @@ For most steps you will copy the previous step's directory to a new directory, a .. code-block:: bash - $ cd ..; cp -r package ini; cd ini - $ $VENV/bin/pip install -e . + cd ..; cp -r package ini; cd ini + $VENV/bin/pip install -e . For a few steps, you won't copy the previous step's directory, but you will still need to install your project with ``$VENV/bin/pip install -e .``. -- cgit v1.2.3 From 1dc04afa73e6171052b42087f769f4d336184a65 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:27:02 -0700 Subject: Clean up code-blocks in qt/unit_testing --- docs/quick_tutorial/unit_testing.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/unit_testing.rst b/docs/quick_tutorial/unit_testing.rst index 002c62fde..a6a41981d 100644 --- a/docs/quick_tutorial/unit_testing.rst +++ b/docs/quick_tutorial/unit_testing.rst @@ -48,23 +48,23 @@ Steps .. code-block:: bash - $ cd ..; cp -r debugtoolbar unit_testing; cd unit_testing - $ $VENV/bin/pip install -e . - $ $VENV/bin/pip install pytest + cd ..; cp -r debugtoolbar unit_testing; cd unit_testing + $VENV/bin/pip install -e . + $VENV/bin/pip install pytest #. Now we write a simple unit test in ``unit_testing/tutorial/tests.py``: .. literalinclude:: unit_testing/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - . - 1 passed in 0.14 seconds + $VENV/bin/py.test tutorial/tests.py -q + . + 1 passed in 0.14 seconds Analysis -- cgit v1.2.3 From 3656b402272e980895756ed115417027cbe30fcd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:27:37 -0700 Subject: Clean up code-blocks in qt/view_classes --- docs/quick_tutorial/view_classes.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/view_classes.rst b/docs/quick_tutorial/view_classes.rst index 49cdcddcc..fc7ba5125 100644 --- a/docs/quick_tutorial/view_classes.rst +++ b/docs/quick_tutorial/view_classes.rst @@ -41,36 +41,35 @@ Steps .. code-block:: bash - $ cd ..; cp -r templating view_classes; cd view_classes - $ $VENV/bin/pip install -e . + cd ..; cp -r templating view_classes; cd view_classes + $VENV/bin/pip install -e . #. Our ``view_classes/tutorial/views.py`` now has a view class with our two views: .. literalinclude:: view_classes/tutorial/views.py - :linenos: + :linenos: #. Our unit tests in ``view_classes/tutorial/tests.py`` don't run, so let's modify them to import the view class, and make an instance before getting a response: .. literalinclude:: view_classes/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.34 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.34 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ and http://localhost:6543/howdy in your browser. -- cgit v1.2.3 From 5caadd304237a66961bddc7d7c641b1407fea6bf Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 18 Aug 2018 12:28:07 -0700 Subject: Clean up code-blocks in qt/views --- docs/quick_tutorial/views.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/views.rst b/docs/quick_tutorial/views.rst index edbe4b2ff..f7fa64719 100644 --- a/docs/quick_tutorial/views.rst +++ b/docs/quick_tutorial/views.rst @@ -44,39 +44,39 @@ Steps .. code-block:: bash - $ cd ..; cp -r functional_testing views; cd views - $ $VENV/bin/pip install -e . + cd ..; cp -r functional_testing views; cd views + $VENV/bin/pip install -e . #. Our ``views/tutorial/__init__.py`` gets a lot shorter: .. literalinclude:: views/tutorial/__init__.py - :linenos: + :linenos: #. Let's add a module ``views/tutorial/views.py`` that is focused on handling requests and responses: .. literalinclude:: views/tutorial/views.py - :linenos: + :linenos: #. Update the tests to cover the two new views: .. literalinclude:: views/tutorial/tests.py - :linenos: + :linenos: #. Now run the tests: .. code-block:: bash - $ $VENV/bin/py.test tutorial/tests.py -q - .... - 4 passed in 0.28 seconds + $VENV/bin/py.test tutorial/tests.py -q + .... + 4 passed in 0.28 seconds #. Run your Pyramid application with: .. code-block:: bash - $ $VENV/bin/pserve development.ini --reload + $VENV/bin/pserve development.ini --reload #. Open http://localhost:6543/ and http://localhost:6543/howdy in your browser. -- 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/quick_tutorial/requirements.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index 0da56ca0b..746af8207 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -33,7 +33,7 @@ This *Quick Tutorial* is based on: projects* (a directory with packaging information and *Python packages* of working code.) -* **Unix commands**. Commands in this tutorial use UNIX syntax and paths. +* **Unix commands**. Commands in this tutorial use Unix syntax and paths. Windows users should adjust commands accordingly. .. note:: @@ -89,11 +89,11 @@ will reside as we proceed through the tutorial: │ └── app.py └── setup.py -For Linux, the commands to do so are as follows: +For macOS and Linux, the commands to do so are as follows: .. code-block:: bash - # Mac and Linux + # macOS and Linux cd ~ mkdir -p projects/quick_tutorial cd projects/quick_tutorial @@ -129,7 +129,7 @@ environment`. We set an environment variable to save typing later. .. code-block:: bash - # Mac and Linux + # macOS and Linux export VENV=~/projects/quick_tutorial/env .. code-block:: doscon @@ -150,7 +150,7 @@ environment variable. .. code-block:: bash - # Mac and Linux + # macOS and Linux python3 -m venv $VENV .. code-block:: doscon @@ -171,7 +171,7 @@ time of its release. .. code-block:: bash - # Mac and Linux + # macOS and Linux $VENV/bin/pip install --upgrade pip setuptools .. code-block:: doscon @@ -193,7 +193,7 @@ part is pretty easy. We'll also install a WSGI server, Waitress. .. parsed-literal:: - # Mac and Linux + # macOS and Linux $VENV/bin/pip install "pyramid==\ |release|\ " waitress # Windows -- 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/quick_tutorial/requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/quick_tutorial') diff --git a/docs/quick_tutorial/requirements.rst b/docs/quick_tutorial/requirements.rst index 746af8207..08ea93cb2 100644 --- a/docs/quick_tutorial/requirements.rst +++ b/docs/quick_tutorial/requirements.rst @@ -62,7 +62,7 @@ Install Python 3 See the detailed recommendation for your operating system described under :ref:`installing_chapter`. -- :ref:`for-mac-os-x-users` +- :ref:`for-macos-users` - :ref:`if-you-don-t-yet-have-a-python-interpreter-unix` - :ref:`if-you-don-t-yet-have-a-python-interpreter-windows` -- cgit v1.2.3