summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBert JW Regeer <bertjw@regeer.org>2020-05-06 22:59:30 -0700
committerBert JW Regeer <bertjw@regeer.org>2020-05-06 23:02:10 -0700
commit26308141eb87300ad49134b977692ebcf50e66c7 (patch)
tree598d3ab2a98e37b6285b7995ef58ccbf7d2b3435 /src
parent61fcb53d39b5443007cc7ddbf2305df09276bb40 (diff)
downloadpyramid-26308141eb87300ad49134b977692ebcf50e66c7.tar.gz
pyramid-26308141eb87300ad49134b977692ebcf50e66c7.tar.bz2
pyramid-26308141eb87300ad49134b977692ebcf50e66c7.zip
Cleanup string formatting
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/config/actions.py4
-rw-r--r--src/pyramid/config/routes.py2
-rw-r--r--src/pyramid/config/views.py4
-rw-r--r--src/pyramid/csrf.py2
-rw-r--r--src/pyramid/renderers.py2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/pyramid/config/actions.py b/src/pyramid/config/actions.py
index 4003a6e3f..b19f35b9b 100644
--- a/src/pyramid/config/actions.py
+++ b/src/pyramid/config/actions.py
@@ -398,8 +398,8 @@ def resolveConflicts(actions, state=None):
# error out if we went backward in order
if state.min_order is not None and order < state.min_order:
r = [
- 'Actions were added to order={0} after execution had moved '
- 'on to order={1}. Conflicting actions: '.format(
+ 'Actions were added to order={} after execution had moved '
+ 'on to order={}. Conflicting actions: '.format(
order, state.min_order
)
]
diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py
index 7c78fbfa7..9452a05ab 100644
--- a/src/pyramid/config/routes.py
+++ b/src/pyramid/config/routes.py
@@ -388,7 +388,7 @@ class RoutesConfiguratorMixin:
scheme = parsed.scheme
else:
scheme = request.scheme
- kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)
+ kw['_app_url'] = '{}://{}'.format(scheme, parsed.netloc)
if original_pregenerator:
elements, kw = original_pregenerator(request, elements, kw)
diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py
index a680eafb3..6faa29d20 100644
--- a/src/pyramid/config/views.py
+++ b/src/pyramid/config/views.py
@@ -2320,7 +2320,7 @@ class StaticURLInfo:
rawspec = None
if pkg_name is not None:
- pathspec = '{0}:{1}{2}'.format(pkg_name, pkg_subpath, subpath)
+ pathspec = '{}:{}{}'.format(pkg_name, pkg_subpath, subpath)
overrides = registry.queryUtility(IPackageOverrides, name=pkg_name)
if overrides is not None:
resource_name = posixpath.join(pkg_subpath, subpath)
@@ -2328,7 +2328,7 @@ class StaticURLInfo:
for source, filtered_path in sources:
rawspec = source.get_path(filtered_path)
if hasattr(source, 'pkg_name'):
- rawspec = '{0}:{1}'.format(source.pkg_name, rawspec)
+ rawspec = '{}:{}'.format(source.pkg_name, rawspec)
break
else:
diff --git a/src/pyramid/csrf.py b/src/pyramid/csrf.py
index 8e711c9a7..4c3689714 100644
--- a/src/pyramid/csrf.py
+++ b/src/pyramid/csrf.py
@@ -360,6 +360,6 @@ def check_csrf_origin(
if not any(
is_same_domain(originp.netloc, host) for host in trusted_origins
):
- return _fail("{0} does not match any trusted origins.".format(origin))
+ return _fail("{} does not match any trusted origins.".format(origin))
return True
diff --git a/src/pyramid/renderers.py b/src/pyramid/renderers.py
index b17c7d64d..8da6270c3 100644
--- a/src/pyramid/renderers.py
+++ b/src/pyramid/renderers.py
@@ -387,7 +387,7 @@ class JSONP(JSON):
)
ct = 'application/javascript'
- body = '/**/{0}({1});'.format(callback, val)
+ body = '/**/{}({});'.format(callback, val)
response = request.response
if response.content_type == response.default_content_type:
response.content_type = ct