diff options
| -rw-r--r-- | CHANGES.txt | 3 | ||||
| -rw-r--r-- | HISTORY.txt | 2 | ||||
| -rw-r--r-- | TODO.txt | 2 | ||||
| -rw-r--r-- | docs/glossary.rst | 4 | ||||
| -rw-r--r-- | docs/narr/firstapp.rst | 11 | ||||
| -rw-r--r-- | docs/narr/helloworld.py | 2 | ||||
| -rw-r--r-- | docs/narr/introduction.rst | 4 | ||||
| -rw-r--r-- | docs/narr/logging.rst | 2 | ||||
| -rw-r--r-- | docs/whatsnew-1.2.rst | 2 | ||||
| -rw-r--r-- | pyramid/scaffolds/__init__.py | 4 | ||||
| -rw-r--r-- | pyramid/tests/test_scaffolds/test_init.py | 5 | ||||
| -rw-r--r-- | setup.py | 2 |
12 files changed, 29 insertions, 14 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 44f948180..41c608af5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -61,6 +61,9 @@ Bug Fixes argument which contains characters that are unsuitable for URLs. See https://github.com/Pylons/pyramid/issues/349 for more info. +- Prevent a scaffold rendering from being named ``site`` (conflicts with + Python internal site.py). + Backwards Incompatibilities --------------------------- diff --git a/HISTORY.txt b/HISTORY.txt index 956f07362..f6cf8fa87 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -456,7 +456,7 @@ Scaffolds package at all; configuration in the ``production.ini`` file which used to require its ``error_catcher`` middleware has been removed. Configuring error catching / email sending is now the domain of the ``pyramid_exclog`` - package (see https://docs.pylonsproject.org/projects/pyramid_exclog/dev/). + package (see http://docs.pylonsproject.org/projects/pyramid_exclog/dev/). Bug Fixes --------- @@ -4,6 +4,8 @@ Pyramid TODOs Must-Have --------- +- Change starter scaffold to use URL dispatch? + - Introspection: * Review narrative docs. diff --git a/docs/glossary.rst b/docs/glossary.rst index 95ca1f20a..399b78cdf 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -920,7 +920,7 @@ Glossary database information. :mod:`pyramid_debugtoolbar` is configured into the ``development.ini`` of all applications which use a Pyramid :term:`scaffold`. For more information, see - https://docs.pylonsproject.org/projects/pyramid_debugtoolbar/dev/ . + http://docs.pylonsproject.org/projects/pyramid_debugtoolbar/dev/ . scaffold A project template that helps users get started writing a Pyramid @@ -933,7 +933,7 @@ Glossary used in production applications, because the logger can be configured to log to a file, to UNIX syslog, to the Windows Event Log, or even to email. See its `documentation - <https://docs.pylonsproject.org/projects/pyramid_exclog/dev/>`_. + <http://docs.pylonsproject.org/projects/pyramid_exclog/dev/>`_. console script A script written to the ``bin`` (on UNIX, or ``Scripts`` on Windows) diff --git a/docs/narr/firstapp.rst b/docs/narr/firstapp.rst index ccc2b8b18..c082f616b 100644 --- a/docs/narr/firstapp.rst +++ b/docs/narr/firstapp.rst @@ -71,11 +71,10 @@ named ``hello_world``. :linenos: :pyobject: hello_world -This function doesn't do anything very difficult. The functions accepts a -single argument (``request``). The ``hello_world`` function returns an -instance of the :class:`pyramid.response.Response`. The single argument to -the class' constructor is value computed from arguments matched from the url -route. This value becomes the body of the response. +The function accepts a single argument (``request``) and it returns an +instance of the :class:`pyramid.response.Response` class. The single +argument to the class' constructor is a string computed from parameters +matched from the URL. This value becomes the body of the response. This function is known as a :term:`view callable`. A view callable accepts a single argument, ``request``. It is expected to return a @@ -157,7 +156,7 @@ Adding Configuration :lines: 10-11 First line above calls the :meth:`pyramid.config.Configurator.add_route` -method, which registers a :term:`route` to match any url path that begins +method, which registers a :term:`route` to match any URL path that begins with ``/hello/`` followed by a string. The second line, ``config.add_view(hello_world, route_name='hello')``, diff --git a/docs/narr/helloworld.py b/docs/narr/helloworld.py index 93a403a13..7c26c8cdc 100644 --- a/docs/narr/helloworld.py +++ b/docs/narr/helloworld.py @@ -10,6 +10,6 @@ if __name__ == '__main__': config.add_route('hello', '/hello/{name}') config.add_view(hello_world, route_name='hello') app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8080) + server = make_server('0.0.0.0', 8080, app) server.serve_forever() diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index 2387db6a7..7c6ad00f3 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -219,7 +219,7 @@ that the Pyramid core doesn't. Add-on packages already exist which let you easily send email, let you use the Jinja2 templating system, let you use XML-RPC or JSON-RPC, let you integrate with jQuery Mobile, etc. -Examples: https://docs.pylonsproject.org/docs/pyramid.html#pyramid-add-on-documentation +Examples: http://docs.pylonsproject.org/docs/pyramid.html#pyramid-add-on-documentation Class-based and function-based views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -842,7 +842,7 @@ official narrative docs. In any case, the Pyramid documentation is comprehensive. Example: The rest of this documentation and the cookbook at -https://docs.pylonsproject.org/projects/pyramid_cookbook/dev/ . +http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/ . .. index:: single: Pylons Project diff --git a/docs/narr/logging.rst b/docs/narr/logging.rst index 5377d0c66..f9f72270f 100644 --- a/docs/narr/logging.rst +++ b/docs/narr/logging.rst @@ -291,7 +291,7 @@ Logging Exceptions To log (or email) exceptions generated by your :app:`Pyramid` application, use the :term:`pyramid_exclog` package. Details about its configuration are in its `documentation -<https://docs.pylonsproject.org/projects/pyramid_exclog/dev/>`_. +<http://docs.pylonsproject.org/projects/pyramid_exclog/dev/>`_. Request Logging with Paste's TransLogger ---------------------------------------- diff --git a/docs/whatsnew-1.2.rst b/docs/whatsnew-1.2.rst index 49854a7e7..ea56cf52d 100644 --- a/docs/whatsnew-1.2.rst +++ b/docs/whatsnew-1.2.rst @@ -63,7 +63,7 @@ Scaffolding Changes package at all; configuration in the ``production.ini`` file which used to require its ``error_catcher`` middleware has been removed. Configuring error catching / email sending is now the domain of the ``pyramid_exclog`` - package (see https://docs.pylonsproject.org/projects/pyramid_exclog/dev/). + package (see http://docs.pylonsproject.org/projects/pyramid_exclog/dev/). - All scaffolds now send the ``cache_max_age`` parameter to the ``add_static_view`` method. diff --git a/pyramid/scaffolds/__init__.py b/pyramid/scaffolds/__init__.py index dc6926024..50c04017a 100644 --- a/pyramid/scaffolds/__init__.py +++ b/pyramid/scaffolds/__init__.py @@ -7,6 +7,10 @@ from pyramid.scaffolds.template import Template class PyramidTemplate(Template): def pre(self, command, output_dir, vars): + if vars['package'] == 'site': + raise ValueError('Sorry, you may not name your package "site". ' + 'The package name "site" has a special meaning in ' + 'Python. Please name it anything except "site".') vars['random_string'] = native_(binascii.hexlify(os.urandom(20))) package_logger = vars['package'] if package_logger == 'root': diff --git a/pyramid/tests/test_scaffolds/test_init.py b/pyramid/tests/test_scaffolds/test_init.py index 6b038914a..4988e66ff 100644 --- a/pyramid/tests/test_scaffolds/test_init.py +++ b/pyramid/tests/test_scaffolds/test_init.py @@ -11,6 +11,11 @@ class TestPyramidTemplate(unittest.TestCase): inst.pre('command', 'output dir', vars) self.assertTrue(vars['random_string']) self.assertEqual(vars['package_logger'], 'one') + + def test_pre_site(self): + inst = self._makeOne() + vars = {'package':'site'} + self.assertRaises(ValueError, inst.pre, 'command', 'output dir', vars) def test_pre_root(self): inst = self._makeOne() @@ -67,6 +67,8 @@ setup(name='pyramid', "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Pylons", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI", |
