summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-08-16 09:20:43 +0200
committerChris McDonough <chrism@plope.com>2013-08-16 09:20:43 +0200
commitbedddda9e128bd4497ddfa1122ea06288ee1c58f (patch)
tree4059af6880d0f7f50b68b7407b0381262eb4ace7
parent5aab1e9c2aebbbb0e955a34067db9a196d430a0c (diff)
parentedfc4f80a1240f6f5f0c41e53078a8f5d305075f (diff)
downloadpyramid-bedddda9e128bd4497ddfa1122ea06288ee1c58f.tar.gz
pyramid-bedddda9e128bd4497ddfa1122ea06288ee1c58f.tar.bz2
pyramid-bedddda9e128bd4497ddfa1122ea06288ee1c58f.zip
Merge branch 'master' of github.com:Pylons/pyramid
-rw-r--r--CHANGES.txt4
-rw-r--r--docs/designdefense.rst2
-rw-r--r--docs/narr/commandline.rst6
-rw-r--r--docs/narr/events.rst6
-rw-r--r--docs/narr/extconfig.rst4
-rw-r--r--docs/narr/hooks.rst4
-rw-r--r--docs/narr/install.rst1
-rw-r--r--docs/narr/project.rst4
-rw-r--r--docs/narr/webob.rst2
-rw-r--r--docs/quick_tour.rst2
-rw-r--r--docs/quick_tour/package/development.ini3
-rw-r--r--pyramid/config/__init__.py2
-rw-r--r--pyramid/decorator.py4
-rw-r--r--pyramid/events.py4
-rw-r--r--pyramid/interfaces.py8
-rw-r--r--pyramid/path.py2
16 files changed, 28 insertions, 30 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 679f8ed4a..48efad6d4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -51,11 +51,13 @@ Features
- The ``AuthTktAuthenticationPolicy`` has two new options to configure its
domain usage:
+
* ``parent_domain``: if set the authentication cookie is set on
the parent domain. This is useful if you have multiple sites sharing the
same domain.
* ``domain``: if provided the cookie is always set for this domain, bypassing
- all usual logic.
+ all usual logic.
+
See https://github.com/Pylons/pyramid/pull/1028,
https://github.com/Pylons/pyramid/pull/1072 and
https://github.com/Pylons/pyramid/pull/1078.
diff --git a/docs/designdefense.rst b/docs/designdefense.rst
index 22570c23d..cebcf6218 100644
--- a/docs/designdefense.rst
+++ b/docs/designdefense.rst
@@ -1461,7 +1461,7 @@ code below:
def afunc():
for i in range(10):
- print i
+ print(i)
By its nature, the *request* object created as the result of a WSGI server's
call into a long-lived web framework cannot be global, because the lifetime
diff --git a/docs/narr/commandline.rst b/docs/narr/commandline.rst
index 17e5227fa..58b9bdd21 100644
--- a/docs/narr/commandline.rst
+++ b/docs/narr/commandline.rst
@@ -538,7 +538,7 @@ representing Pyramid your application configuration as a single argument:
from pyramid.paster import bootstrap
env = bootstrap('/path/to/my/development.ini')
- print env['request'].route_url('home')
+ print(env['request'].route_url('home'))
:func:`pyramid.paster.bootstrap` returns a dictionary containing
framework-related information. This dictionary will always contain a
@@ -606,7 +606,7 @@ to load instead of ``main``:
from pyramid.paster import bootstrap
env = bootstrap('/path/to/my/development.ini#another')
- print env['request'].route_url('home')
+ print(env['request'].route_url('home'))
The above example specifies the ``another`` ``app``, ``pipeline``, or
``composite`` section of your PasteDeploy configuration file. The ``app``
@@ -643,7 +643,7 @@ the desired request and passing it into :func:`~pyramid.paster.bootstrap`:
request = Request.blank('/', base_url='https://example.com/prefix')
env = bootstrap('/path/to/my/development.ini#another', request=request)
- print env['request'].application_url
+ print(env['request'].application_url)
# will print 'https://example.com/prefix'
Now you can readily use Pyramid's APIs for generating URLs:
diff --git a/docs/narr/events.rst b/docs/narr/events.rst
index 11af89ca6..2accb3dbe 100644
--- a/docs/narr/events.rst
+++ b/docs/narr/events.rst
@@ -26,7 +26,7 @@ subscriber is a function that accepts a single argument named `event`:
:linenos:
def mysubscriber(event):
- print event
+ print(event)
The above is a subscriber that simply prints the event to the console
when it's called.
@@ -113,10 +113,10 @@ your application like so:
:linenos:
def handle_new_request(event):
- print 'request', event.request
+ print('request', event.request)
def handle_new_response(event):
- print 'response', event.response
+ print('response', event.response)
You may configure these functions to be called at the appropriate
times by adding the following code to your application's
diff --git a/docs/narr/extconfig.rst b/docs/narr/extconfig.rst
index 659056952..6587aef92 100644
--- a/docs/narr/extconfig.rst
+++ b/docs/narr/extconfig.rst
@@ -55,7 +55,7 @@ method of the Configurator:
:linenos:
def mysubscriber(event):
- print event.request
+ print(event.request)
config.add_newrequest_subscriber(mysubscriber)
@@ -79,7 +79,7 @@ able to install it and subsequently do:
:linenos:
def mysubscriber(event):
- print event.request
+ print(event.request)
from pyramid.config import Configurator
config = Configurator()
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 37a74b53a..3a2568775 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -291,7 +291,7 @@ actually execute the function until accessed.
return sum(args)
def prop(request):
- print "getting the property"
+ print("getting the property")
return "the property"
config = Configurator()
@@ -332,7 +332,7 @@ Here is an example of passing a class to ``Configurator.add_request_method``:
# use @property if you don't want to cache the result
@reify
def prop(self):
- print "getting the property"
+ print("getting the property")
return "the property"
config = Configurator()
diff --git a/docs/narr/install.rst b/docs/narr/install.rst
index d05c8abeb..ef5772f79 100644
--- a/docs/narr/install.rst
+++ b/docs/narr/install.rst
@@ -336,6 +336,7 @@ You can use Pyramid on Windows under Python 2 or under Python 3.
#. Install `virtualenv`:
.. code-block:: text
+
# modify the command according to the python version, e.g.:
# for Python 2.7:
c:\> c:\Python27\Scripts\easy_install virtualenv
diff --git a/docs/narr/project.rst b/docs/narr/project.rst
index ec5d706aa..52f13d5a8 100644
--- a/docs/narr/project.rst
+++ b/docs/narr/project.rst
@@ -49,9 +49,7 @@ The included scaffolds are these:
URL mapping via :term:`URL dispatch` and no persistence mechanism.
``zodb``
- URL mapping via :term:`traversal` and persistence via :term:`ZODB`. *Note
- that, as of this writing, this scaffold will not run under Python 3, only
- under Python 2.*
+ URL mapping via :term:`traversal` and persistence via :term:`ZODB`.
``alchemy``
URL mapping via :term:`URL dispatch` and persistence via
diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst
index c0ca450b1..f0a4b5a0b 100644
--- a/docs/narr/webob.rst
+++ b/docs/narr/webob.rst
@@ -287,7 +287,7 @@ When such a request reaches a view in your application, the
@view_config(renderer='string')
def aview(request):
- print request.json_body
+ print(request.json_body)
return 'OK'
For the above view, printed to the console will be:
diff --git a/docs/quick_tour.rst b/docs/quick_tour.rst
index e191de198..f75533220 100644
--- a/docs/quick_tour.rst
+++ b/docs/quick_tour.rst
@@ -37,7 +37,7 @@ If ``wget`` complains with a certificate error, run it with:
In these steps above we first made a :term:`virtualenv` and then
"activated" it, which adjusted our path to look first in
-``env33/bin`` for commands (such as ``python``.) We next downloaded
+``env33/bin`` for commands (such as ``python``). We next downloaded
Python's packaging support and installed it, giving us the
``easy_install`` command-line script for adding new packages. Python
2.7 users will need to use ``virtualenv`` instead of ``pyvenv`` to make
diff --git a/docs/quick_tour/package/development.ini b/docs/quick_tour/package/development.ini
index a751ff903..a3a73e885 100644
--- a/docs/quick_tour/package/development.ini
+++ b/docs/quick_tour/package/development.ini
@@ -11,8 +11,6 @@ debug_templates = true
default_locale_name = en
jinja2.directories = hello_world:templates
-
-
[pipeline:main]
pipeline =
hello_world
@@ -44,7 +42,6 @@ keys = generic
level = INFO
handlers = console
-
[handler_console]
class = StreamHandler
args = (sys.stderr,)
diff --git a/pyramid/config/__init__.py b/pyramid/config/__init__.py
index d52ee0e7a..d4557d6b1 100644
--- a/pyramid/config/__init__.py
+++ b/pyramid/config/__init__.py
@@ -1055,7 +1055,7 @@ class ActionState(object):
... v = context.execute_actions()
... except ConfigurationExecutionError, v:
... pass
- >>> print v
+ >>> print(v)
exceptions.AttributeError: 'function' object has no attribute 'xxx'
in:
oops
diff --git a/pyramid/decorator.py b/pyramid/decorator.py
index e5f2996dc..0d17bc398 100644
--- a/pyramid/decorator.py
+++ b/pyramid/decorator.py
@@ -10,7 +10,7 @@ class reify(object):
class Foo(object):
@reify
def jammy(self):
- print 'jammy called'
+ print('jammy called')
return 1
And usage of Foo:
@@ -18,7 +18,7 @@ class reify(object):
>>> f = Foo()
>>> v = f.jammy
'jammy called'
- >>> print v
+ >>> print(v)
1
>>> f.jammy
1
diff --git a/pyramid/events.py b/pyramid/events.py
index 836466ba2..31af8e1fc 100644
--- a/pyramid/events.py
+++ b/pyramid/events.py
@@ -40,7 +40,7 @@ class subscriber(object):
@subscriber(NewRequest, NewResponse)
def mysubscriber(event):
- print event
+ print(event)
When the ``subscriber`` decorator is used without passing an arguments,
the function it decorates is called for every event sent:
@@ -51,7 +51,7 @@ class subscriber(object):
@subscriber()
def mysubscriber(event):
- print event
+ print(event)
This method will have no effect until a :term:`scan` is performed
against the package or module which contains it, ala:
diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py
index 275209737..2a14df7c7 100644
--- a/pyramid/interfaces.py
+++ b/pyramid/interfaces.py
@@ -760,15 +760,15 @@ class IContextURL(IResourceURL):
#
# class Fudge(object):
# def __init__(self, one, two):
- # print one, two
+ # print(one, two)
# class Another(object):
# def __init__(self, one, two):
- # print one, two
+ # print(one, two)
# ob = object()
# r.registerAdapter(Fudge, (Interface, Interface), IContextURL)
- # print r.queryMultiAdapter((ob, ob), IResourceURL)
+ # print(r.queryMultiAdapter((ob, ob), IResourceURL))
# r.registerAdapter(Another, (Interface, Interface), IResourceURL)
- # print r.queryMultiAdapter((ob, ob), IResourceURL)
+ # print(r.queryMultiAdapter((ob, ob), IResourceURL))
#
# prints
#
diff --git a/pyramid/path.py b/pyramid/path.py
index 57eccdb19..ab39a85d9 100644
--- a/pyramid/path.py
+++ b/pyramid/path.py
@@ -181,7 +181,7 @@ class AssetResolver(Resolver):
a = AssetResolver('myproject')
resolver = a.resolve('templates/foo.pt')
- print resolver.abspath()
+ print(resolver.abspath())
# -> /path/to/myproject/templates/foo.pt
If the AssetResolver is constructed without a ``package`` argument of