summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPatricio Paez <pp@pp.com.mx>2012-11-29 22:10:38 -0600
committerPatricio Paez <pp@pp.com.mx>2012-11-29 22:10:38 -0600
commitd85569e38ba88029864b7908dbee3f948b103712 (patch)
tree97b6078e03001747528a227897e6ef325febc517 /docs
parent877eebdbd3ca4f9c7ab1b30bf16b76be64ed5dbc (diff)
downloadpyramid-d85569e38ba88029864b7908dbee3f948b103712.tar.gz
pyramid-d85569e38ba88029864b7908dbee3f948b103712.tar.bz2
pyramid-d85569e38ba88029864b7908dbee3f948b103712.zip
Sync MyProject files with the starter scaffold
- Line numbers are mentioned only in the Creating a Pyramid Project chapter; those that are affected were updated.
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/MyProject/myproject/__init__.py1
-rw-r--r--docs/narr/MyProject/myproject/tests.py1
-rw-r--r--docs/narr/MyProject/myproject/views.py3
-rw-r--r--docs/narr/MyProject/setup.py6
-rw-r--r--docs/narr/project.rst14
5 files changed, 14 insertions, 11 deletions
diff --git a/docs/narr/MyProject/myproject/__init__.py b/docs/narr/MyProject/myproject/__init__.py
index 31b02cf02..6c512f52f 100644
--- a/docs/narr/MyProject/myproject/__init__.py
+++ b/docs/narr/MyProject/myproject/__init__.py
@@ -1,5 +1,6 @@
from pyramid.config import Configurator
+
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py
index d8b764041..64dcab1d5 100644
--- a/docs/narr/MyProject/myproject/tests.py
+++ b/docs/narr/MyProject/myproject/tests.py
@@ -2,6 +2,7 @@ import unittest
from pyramid import testing
+
class ViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
diff --git a/docs/narr/MyProject/myproject/views.py b/docs/narr/MyProject/myproject/views.py
index f571a5976..c383c5716 100644
--- a/docs/narr/MyProject/myproject/views.py
+++ b/docs/narr/MyProject/myproject/views.py
@@ -1,5 +1,6 @@
from pyramid.view import view_config
+
@view_config(route_name='home', renderer='templates/mytemplate.pt')
def my_view(request):
- return {'project':'MyProject'}
+ return {'project': 'MyProject'}
diff --git a/docs/narr/MyProject/setup.py b/docs/narr/MyProject/setup.py
index b119a954b..f24b6984e 100644
--- a/docs/narr/MyProject/setup.py
+++ b/docs/narr/MyProject/setup.py
@@ -15,10 +15,10 @@ requires = [
setup(name='MyProject',
version='0.0',
description='MyProject',
- long_description=README + '\n\n' + CHANGES,
+ long_description=README + '\n\n' + CHANGES,
classifiers=[
"Programming Language :: Python",
- "Framework :: Pylons",
+ "Framework :: Pyramid",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
],
@@ -32,7 +32,7 @@ setup(name='MyProject',
install_requires=requires,
tests_require=requires,
test_suite="myproject",
- entry_points = """\
+ entry_points="""\
[paste.app_factory]
main = myproject:main
""",
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index b08948e43..fb62f4bd2 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -829,25 +829,25 @@ also informs Python that the directory which contains it is a *package*.
#. Line 1 imports the :term:`Configurator` class from :mod:`pyramid.config`
that we use later.
-#. Lines 3-10 define a function named ``main`` that returns a :app:`Pyramid`
+#. Lines 4-11 define a function named ``main`` that returns a :app:`Pyramid`
WSGI application. This function is meant to be called by the
:term:`PasteDeploy` framework as a result of running ``pserve``.
Within this function, application configuration is performed.
- Line 6 creates an instance of a :term:`Configurator`.
+ Line 7 creates an instance of a :term:`Configurator`.
- Line 7 registers a static view, which will serve up the files from the
+ Line 8 registers a static view, which will serve up the files from the
``myproject:static`` :term:`asset specification` (the ``static``
directory of the ``myproject`` package).
- Line 8 adds a :term:`route` to the configuration. This route is later
+ Line 9 adds a :term:`route` to the configuration. This route is later
used by a view in the ``views`` module.
- Line 9 calls ``config.scan()``, which picks up view registrations declared
+ Line 10 calls ``config.scan()``, which picks up view registrations declared
elsewhere in the package (in this case, in the ``views.py`` module).
- Line 10 returns a :term:`WSGI` application to the caller of the function
+ Line 11 returns a :term:`WSGI` application to the caller of the function
(Pyramid's pserve).
.. index::
@@ -865,7 +865,7 @@ and which returns a :term:`response`.
:language: python
:linenos:
-Lines 3-5 define and register a :term:`view callable` named ``my_view``. The
+Lines 4-6 define and register a :term:`view callable` named ``my_view``. The
function named ``my_view`` is decorated with a ``view_config`` decorator
(which is processed by the ``config.scan()`` line in our ``__init__.py``).
The view_config decorator asserts that this view be found when a