summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-03-18 16:01:43 -0700
committerChris McDonough <chrism@plope.com>2013-03-18 16:01:43 -0700
commit881feb9c25b5c16d05e5ae9f3384eded1231fe59 (patch)
tree812ba136637b4b46655455b2a357d638ef505f10 /docs/tutorials/wiki2
parentc7a06f41d56d076dc979d800388c8befc1b8e5e5 (diff)
parentfc9dfbae2a76732ee8d027825fac28dbfd57e581 (diff)
downloadpyramid-881feb9c25b5c16d05e5ae9f3384eded1231fe59.tar.gz
pyramid-881feb9c25b5c16d05e5ae9f3384eded1231fe59.tar.bz2
pyramid-881feb9c25b5c16d05e5ae9f3384eded1231fe59.zip
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki2')
-rw-r--r--docs/tutorials/wiki2/basiclayout.rst2
-rw-r--r--docs/tutorials/wiki2/definingviews.rst10
-rw-r--r--docs/tutorials/wiki2/distributing.rst4
-rw-r--r--docs/tutorials/wiki2/installation.rst28
-rw-r--r--docs/tutorials/wiki2/src/authorization/README.txt6
-rw-r--r--docs/tutorials/wiki2/src/authorization/setup.py6
-rw-r--r--docs/tutorials/wiki2/src/basiclayout/README.txt6
-rw-r--r--docs/tutorials/wiki2/src/basiclayout/setup.py6
-rw-r--r--docs/tutorials/wiki2/src/models/README.txt6
-rw-r--r--docs/tutorials/wiki2/src/models/setup.py6
-rw-r--r--docs/tutorials/wiki2/src/tests/README.txt6
-rw-r--r--docs/tutorials/wiki2/src/tests/setup.py6
-rw-r--r--docs/tutorials/wiki2/src/views/README.txt6
-rw-r--r--docs/tutorials/wiki2/src/views/setup.py6
-rw-r--r--docs/tutorials/wiki2/tests.rst10
15 files changed, 62 insertions, 52 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst
index 68be4ee7c..86fe97956 100644
--- a/docs/tutorials/wiki2/basiclayout.rst
+++ b/docs/tutorials/wiki2/basiclayout.rst
@@ -226,7 +226,7 @@ To give a simple example of a model class, we define one named ``MyModel``:
:linenos:
:language: py
-Our example model has an ``__init__`` method that takes a two arguments
+Our example model has an ``__init__`` method that takes two arguments
(``name``, and ``value``). It stores these values as ``self.name`` and
``self.value``
within the ``__init__`` function itself. The ``MyModel`` class also has a
diff --git a/docs/tutorials/wiki2/definingviews.rst b/docs/tutorials/wiki2/definingviews.rst
index e83a88198..f2ac2f85f 100644
--- a/docs/tutorials/wiki2/definingviews.rst
+++ b/docs/tutorials/wiki2/definingviews.rst
@@ -33,7 +33,7 @@ Open ``tutorial/setup.py`` and edit it to look like the following:
.. literalinclude:: src/views/setup.py
:linenos:
:language: python
- :emphasize-lines: 17
+ :emphasize-lines: 19
(Only the highlighted line needs to be added.)
@@ -52,14 +52,14 @@ On UNIX:
.. code-block:: text
$ cd tutorial
- $ ../bin/python setup.py develop
+ $ $VENV/bin/python setup.py develop
On Windows:
.. code-block:: text
c:\pyramidtut> cd tutorial
- c:\pyramidtut\tutorial> ..\Scripts\python setup.py develop
+ c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py develop
Success executing this command will end with a line to the console something
like::
@@ -126,7 +126,7 @@ The ``view_page`` view function
-------------------------------
``view_page()`` is used to display a single page of our
-wiki. It renders the :term:`ReStructuredText` body of a page (stored as
+wiki. It renders the :term:`reStructuredText` body of a page (stored as
the ``data`` attribute of a ``Page`` model object) as HTML. Then it substitutes an
HTML anchor for each *WikiWord* reference in the rendered HTML using a
compiled regular expression.
@@ -287,7 +287,7 @@ Our templates name a single static asset named ``pylons.css``. We don't need
to create this file within our package's ``static`` directory because it was
provided at the time we created the project. This file is a little too long
to replicate within the body of this guide, however it is available `online
-<http://github.com/Pylons/pyramid/blob/master/docs/tutorials/wiki2/src/views/tutorial/static/pylons.css>`_.
+<https://github.com/Pylons/pyramid/blob/master/docs/tutorials/wiki2/src/views/tutorial/static/pylons.css>`_.
This CSS file will be accessed via
e.g. ``http://localhost:6543/static/pylons.css`` by virtue of the call to
diff --git a/docs/tutorials/wiki2/distributing.rst b/docs/tutorials/wiki2/distributing.rst
index 96293603c..3b048a141 100644
--- a/docs/tutorials/wiki2/distributing.rst
+++ b/docs/tutorials/wiki2/distributing.rst
@@ -12,13 +12,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/python setup.py sdist
+ $ $VENV/bin/python setup.py sdist
On Windows:
.. code-block:: text
- c:\pyramidtut> ..\Scripts\python setup.py sdist
+ c:\pyramidtut> %VENV%\Scripts\python setup.py sdist
The output of such a command will be something like:
diff --git a/docs/tutorials/wiki2/installation.rst b/docs/tutorials/wiki2/installation.rst
index 9fa01d513..255a60ec2 100644
--- a/docs/tutorials/wiki2/installation.rst
+++ b/docs/tutorials/wiki2/installation.rst
@@ -52,13 +52,13 @@ On UNIX:
.. code-block:: text
- $ bin/pcreate -s alchemy tutorial
+ $ $VENV/bin/pcreate -s alchemy tutorial
On Windows:
.. code-block:: text
- c:\pyramidtut> Scripts\pcreate -s alchemy tutorial
+ c:\pyramidtut> %VENV%\pcreate -s alchemy tutorial
.. note:: If you are using Windows, the ``alchemy``
scaffold may not deal gracefully with installation into a
@@ -83,14 +83,14 @@ On UNIX:
.. code-block:: text
$ cd tutorial
- $ ../bin/python setup.py develop
+ $ $VENV/bin/python setup.py develop
On Windows:
.. code-block:: text
c:\pyramidtut> cd tutorial
- c:\pyramidtut\tutorial> ..\Scripts\python setup.py develop
+ c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py develop
Success executing this command will end with a line to the console something
like::
@@ -109,13 +109,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/python setup.py test -q
+ $ $VENV/bin/python setup.py test -q
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\python setup.py test -q
+ c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py test -q
For a successful test run, you should see output that ends like this::
@@ -141,13 +141,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/easy_install nose coverage
+ $ $VENV/bin/easy_install nose coverage
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\easy_install nose coverage
+ c:\pyramidtut\tutorial> %VENV%\Scripts\easy_install nose coverage
Once ``nose`` and ``coverage`` are installed, we can actually run the
coverage tests.
@@ -156,13 +156,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/nosetests --cover-package=tutorial --cover-erase --with-coverage
+ $ $VENV/bin/nosetests --cover-package=tutorial --cover-erase --with-coverage
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\nosetests --cover-package=tutorial \
+ c:\pyramidtut\tutorial> %VENV%\Scripts\nosetests --cover-package=tutorial \
--cover-erase --with-coverage
If successful, you will see output something like this::
@@ -200,13 +200,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/initialize_tutorial_db development.ini
+ $ $VENV/bin/initialize_tutorial_db development.ini
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\initialize_tutorial_db development.ini
+ c:\pyramidtut\tutorial> %VENV%\Scripts\initialize_tutorial_db development.ini
The output to your console should be something like this::
@@ -248,13 +248,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/pserve development.ini --reload
+ $ $VENV/bin/pserve development.ini --reload
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\pserve development.ini --reload
+ c:\pyramidtut\tutorial> %VENV%\Scripts\pserve development.ini --reload
If successful, you will see something like this on your console::
diff --git a/docs/tutorials/wiki2/src/authorization/README.txt b/docs/tutorials/wiki2/src/authorization/README.txt
index 141851285..68f430110 100644
--- a/docs/tutorials/wiki2/src/authorization/README.txt
+++ b/docs/tutorials/wiki2/src/authorization/README.txt
@@ -6,9 +6,9 @@ Getting Started
- cd <directory containing this file>
-- $venv/bin/python setup.py develop
+- $VENV/bin/python setup.py develop
-- $venv/bin/initialize_tutorial_db development.ini
+- $VENV/bin/initialize_tutorial_db development.ini
-- $venv/bin/pserve development.ini
+- $VENV/bin/pserve development.ini
diff --git a/docs/tutorials/wiki2/src/authorization/setup.py b/docs/tutorials/wiki2/src/authorization/setup.py
index 36668dd33..e8fa8f396 100644
--- a/docs/tutorials/wiki2/src/authorization/setup.py
+++ b/docs/tutorials/wiki2/src/authorization/setup.py
@@ -3,8 +3,10 @@ import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
requires = [
'pyramid',
diff --git a/docs/tutorials/wiki2/src/basiclayout/README.txt b/docs/tutorials/wiki2/src/basiclayout/README.txt
index 141851285..68f430110 100644
--- a/docs/tutorials/wiki2/src/basiclayout/README.txt
+++ b/docs/tutorials/wiki2/src/basiclayout/README.txt
@@ -6,9 +6,9 @@ Getting Started
- cd <directory containing this file>
-- $venv/bin/python setup.py develop
+- $VENV/bin/python setup.py develop
-- $venv/bin/initialize_tutorial_db development.ini
+- $VENV/bin/initialize_tutorial_db development.ini
-- $venv/bin/pserve development.ini
+- $VENV/bin/pserve development.ini
diff --git a/docs/tutorials/wiki2/src/basiclayout/setup.py b/docs/tutorials/wiki2/src/basiclayout/setup.py
index a09bf756a..e7d318128 100644
--- a/docs/tutorials/wiki2/src/basiclayout/setup.py
+++ b/docs/tutorials/wiki2/src/basiclayout/setup.py
@@ -3,8 +3,10 @@ import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
requires = [
'pyramid',
diff --git a/docs/tutorials/wiki2/src/models/README.txt b/docs/tutorials/wiki2/src/models/README.txt
index 141851285..68f430110 100644
--- a/docs/tutorials/wiki2/src/models/README.txt
+++ b/docs/tutorials/wiki2/src/models/README.txt
@@ -6,9 +6,9 @@ Getting Started
- cd <directory containing this file>
-- $venv/bin/python setup.py develop
+- $VENV/bin/python setup.py develop
-- $venv/bin/initialize_tutorial_db development.ini
+- $VENV/bin/initialize_tutorial_db development.ini
-- $venv/bin/pserve development.ini
+- $VENV/bin/pserve development.ini
diff --git a/docs/tutorials/wiki2/src/models/setup.py b/docs/tutorials/wiki2/src/models/setup.py
index a09bf756a..e7d318128 100644
--- a/docs/tutorials/wiki2/src/models/setup.py
+++ b/docs/tutorials/wiki2/src/models/setup.py
@@ -3,8 +3,10 @@ import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
requires = [
'pyramid',
diff --git a/docs/tutorials/wiki2/src/tests/README.txt b/docs/tutorials/wiki2/src/tests/README.txt
index 141851285..68f430110 100644
--- a/docs/tutorials/wiki2/src/tests/README.txt
+++ b/docs/tutorials/wiki2/src/tests/README.txt
@@ -6,9 +6,9 @@ Getting Started
- cd <directory containing this file>
-- $venv/bin/python setup.py develop
+- $VENV/bin/python setup.py develop
-- $venv/bin/initialize_tutorial_db development.ini
+- $VENV/bin/initialize_tutorial_db development.ini
-- $venv/bin/pserve development.ini
+- $VENV/bin/pserve development.ini
diff --git a/docs/tutorials/wiki2/src/tests/setup.py b/docs/tutorials/wiki2/src/tests/setup.py
index 3c2961fcc..c3da36b39 100644
--- a/docs/tutorials/wiki2/src/tests/setup.py
+++ b/docs/tutorials/wiki2/src/tests/setup.py
@@ -3,8 +3,10 @@ import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
requires = [
'pyramid',
diff --git a/docs/tutorials/wiki2/src/views/README.txt b/docs/tutorials/wiki2/src/views/README.txt
index 141851285..68f430110 100644
--- a/docs/tutorials/wiki2/src/views/README.txt
+++ b/docs/tutorials/wiki2/src/views/README.txt
@@ -6,9 +6,9 @@ Getting Started
- cd <directory containing this file>
-- $venv/bin/python setup.py develop
+- $VENV/bin/python setup.py develop
-- $venv/bin/initialize_tutorial_db development.ini
+- $VENV/bin/initialize_tutorial_db development.ini
-- $venv/bin/pserve development.ini
+- $VENV/bin/pserve development.ini
diff --git a/docs/tutorials/wiki2/src/views/setup.py b/docs/tutorials/wiki2/src/views/setup.py
index 36668dd33..e8fa8f396 100644
--- a/docs/tutorials/wiki2/src/views/setup.py
+++ b/docs/tutorials/wiki2/src/views/setup.py
@@ -3,8 +3,10 @@ import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+with open(os.path.join(here, 'README.txt')) as f:
+ README = f.read()
+with open(os.path.join(here, 'CHANGES.txt')) as f:
+ CHANGES = f.read()
requires = [
'pyramid',
diff --git a/docs/tutorials/wiki2/tests.rst b/docs/tutorials/wiki2/tests.rst
index 83df86b27..33b5d35c1 100644
--- a/docs/tutorials/wiki2/tests.rst
+++ b/docs/tutorials/wiki2/tests.rst
@@ -54,7 +54,7 @@ Change the ``requires`` list in ``setup.py`` to include ``WebTest``.
.. literalinclude:: src/tests/setup.py
:linenos:
:language: python
- :lines: 9-20
+ :lines: 11-21
:emphasize-lines: 10
After we've added a dependency on WebTest in ``setup.py``, we need to rerun
@@ -66,13 +66,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/python setup.py develop
+ $ $VENV/bin/python setup.py develop
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\python setup.py develop
+ c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py develop
Once that command has completed successfully, we can run the tests
themselves:
@@ -81,13 +81,13 @@ On UNIX:
.. code-block:: text
- $ ../bin/python setup.py test -q
+ $ $VENV/bin/python setup.py test -q
On Windows:
.. code-block:: text
- c:\pyramidtut\tutorial> ..\Scripts\python setup.py test -q
+ c:\pyramidtut\tutorial> %VENV%\Scripts\python setup.py test -q
The expected result ends something like: