Merge ~cjwatson/lazr.restful:remove-six-moves into lazr.restful:main

Proposed by Colin Watson
Status: Merged
Merged at revision: 9086d701e62d10fb64f53ff846cafbf9d184e6a3
Proposed branch: ~cjwatson/lazr.restful:remove-six-moves
Merge into: lazr.restful:main
Diff against target: 265 lines (+25/-25)
16 files modified
src/lazr/restful/docs/multiversion.rst (+1/-1)
src/lazr/restful/docs/webservice-declarations.rst (+2/-2)
src/lazr/restful/docs/webservice.rst (+2/-2)
src/lazr/restful/example/base/tests/collection.txt (+1/-1)
src/lazr/restful/example/base/tests/entry.txt (+1/-1)
src/lazr/restful/example/base/tests/field.txt (+1/-1)
src/lazr/restful/example/base/tests/hostedfile.txt (+1/-1)
src/lazr/restful/example/base/tests/representation-cache.txt (+1/-1)
src/lazr/restful/example/base/tests/service.txt (+1/-1)
src/lazr/restful/example/base/tests/wadl.txt (+1/-1)
src/lazr/restful/example/base/traversal.py (+2/-2)
src/lazr/restful/marshallers.py (+1/-1)
src/lazr/restful/publisher.py (+3/-3)
src/lazr/restful/simple.py (+2/-2)
src/lazr/restful/tales.py (+1/-1)
src/lazr/restful/testing/webservice.py (+4/-4)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+413797@code.launchpad.net

Commit message

Remove uses of six.moves

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/lazr/restful/docs/multiversion.rst b/src/lazr/restful/docs/multiversion.rst
index 6f3fd68..8a3faca 100644
--- a/src/lazr/restful/docs/multiversion.rst
+++ b/src/lazr/restful/docs/multiversion.rst
@@ -163,7 +163,7 @@ contacts.
163163
164Here's a simple implementation of IContact.164Here's a simple implementation of IContact.
165165
166 >>> from six.moves.urllib.parse import quote166 >>> from urllib.parse import quote
167 >>> from zope.interface import implementer167 >>> from zope.interface import implementer
168 >>> from lazr.restful.security import protect_schema168 >>> from lazr.restful.security import protect_schema
169 >>> @implementer(IContact, ILocation)169 >>> @implementer(IContact, ILocation)
diff --git a/src/lazr/restful/docs/webservice-declarations.rst b/src/lazr/restful/docs/webservice-declarations.rst
index 964f5ff..2a8eb46 100644
--- a/src/lazr/restful/docs/webservice-declarations.rst
+++ b/src/lazr/restful/docs/webservice-declarations.rst
@@ -55,8 +55,8 @@ These declarations add tagged values to the original interface elements.
55The tags are in the lazr.restful namespace and are dictionaries of55The tags are in the lazr.restful namespace and are dictionaries of
56elements.56elements.
5757
58 >>> from collections.abc import Mapping
58 >>> from pprint import pformat59 >>> from pprint import pformat
59 >>> from six.moves.collections_abc import Mapping
60 >>> def print_export_tag(element):60 >>> def print_export_tag(element):
61 ... """Print the content of the 'lazr.restful.exported' tag."""61 ... """Print the content of the 'lazr.restful.exported' tag."""
62 ... def format_value(value):62 ... def format_value(value):
@@ -1285,7 +1285,7 @@ URL to the newly created object. The body of the response will be empty.
1285(For the URL generation to work, we need to register an IAbsoluteURL1285(For the URL generation to work, we need to register an IAbsoluteURL
1286adapter and set the request as the current interaction.)1286adapter and set the request as the current interaction.)
12871287
1288 >>> from six.moves.urllib.parse import quote1288 >>> from urllib.parse import quote
1289 >>> from zope.component import provideAdapter1289 >>> from zope.component import provideAdapter
1290 >>> from zope.traversing.browser.interfaces import IAbsoluteURL1290 >>> from zope.traversing.browser.interfaces import IAbsoluteURL
1291 >>> from zope.publisher.interfaces.http import IHTTPApplicationRequest1291 >>> from zope.publisher.interfaces.http import IHTTPApplicationRequest
diff --git a/src/lazr/restful/docs/webservice.rst b/src/lazr/restful/docs/webservice.rst
index 6397038..5289633 100644
--- a/src/lazr/restful/docs/webservice.rst
+++ b/src/lazr/restful/docs/webservice.rst
@@ -114,7 +114,7 @@ interface, and the URL of an object is found by using the IAbsoluteURL
114interface.114interface.
115115
116116
117 >>> from six.moves.urllib.parse import quote117 >>> from urllib.parse import quote
118 >>> from zope.component import (118 >>> from zope.component import (
119 ... adapter, getSiteManager, getMultiAdapter)119 ... adapter, getSiteManager, getMultiAdapter)
120 >>> from zope.interface import implementer120 >>> from zope.interface import implementer
@@ -201,7 +201,7 @@ interface.
201201
202 >>> protect_schema(Cookbook, ICookbook, write_permission=CheckerPublic)202 >>> protect_schema(Cookbook, ICookbook, write_permission=CheckerPublic)
203203
204 >>> from six.moves.urllib.parse import unquote204 >>> from urllib.parse import unquote
205 >>> @implementer(IPublishTraverse)205 >>> @implementer(IPublishTraverse)
206 ... @adapter(ICookbook, IBrowserRequest)206 ... @adapter(ICookbook, IBrowserRequest)
207 ... class CookbookTraversal:207 ... class CookbookTraversal:
diff --git a/src/lazr/restful/example/base/tests/collection.txt b/src/lazr/restful/example/base/tests/collection.txt
index 08009ad..c2a47dc 100644
--- a/src/lazr/restful/example/base/tests/collection.txt
+++ b/src/lazr/restful/example/base/tests/collection.txt
@@ -85,7 +85,7 @@ results in a 400 error.
8585
86A collection may be empty.86A collection may be empty.
8787
88 >>> from six.moves.urllib.parse import quote88 >>> from urllib.parse import quote
89 >>> url = quote("/cookbooks/Cooking Without Recipes/recipes")89 >>> url = quote("/cookbooks/Cooking Without Recipes/recipes")
90 >>> result = webservice.get(url)90 >>> result = webservice.get(url)
91 >>> list(result.jsonBody()['entries'])91 >>> list(result.jsonBody()['entries'])
diff --git a/src/lazr/restful/example/base/tests/entry.txt b/src/lazr/restful/example/base/tests/entry.txt
index ba48787..c260361 100644
--- a/src/lazr/restful/example/base/tests/entry.txt
+++ b/src/lazr/restful/example/base/tests/entry.txt
@@ -22,7 +22,7 @@ GET request to the entry's URL.
2222
23Here we see that the cookbook 'Everyday Greens' is a vegetarian cookbook.23Here we see that the cookbook 'Everyday Greens' is a vegetarian cookbook.
2424
25 >>> from six.moves.urllib.parse import quote25 >>> from urllib.parse import quote
26 >>> greens_url = quote("/cookbooks/Everyday Greens")26 >>> greens_url = quote("/cookbooks/Everyday Greens")
27 >>> print(webservice.get(greens_url).jsonBody()['cuisine'])27 >>> print(webservice.get(greens_url).jsonBody()['cuisine'])
28 Vegetarian28 Vegetarian
diff --git a/src/lazr/restful/example/base/tests/field.txt b/src/lazr/restful/example/base/tests/field.txt
index aa09231..a1e51c7 100644
--- a/src/lazr/restful/example/base/tests/field.txt
+++ b/src/lazr/restful/example/base/tests/field.txt
@@ -8,7 +8,7 @@ field resource itself, rather than PUT/PATCH to the entry.
8 >>> from lazr.restful.testing.webservice import WebServiceCaller8 >>> from lazr.restful.testing.webservice import WebServiceCaller
9 >>> webservice = WebServiceCaller(domain='cookbooks.dev')9 >>> webservice = WebServiceCaller(domain='cookbooks.dev')
1010
11 >>> from six.moves.urllib.parse import quote11 >>> from urllib.parse import quote
12 >>> cookbook_url = quote("/cookbooks/The Joy of Cooking")12 >>> cookbook_url = quote("/cookbooks/The Joy of Cooking")
13 >>> field_url = cookbook_url + "/description"13 >>> field_url = cookbook_url + "/description"
1414
diff --git a/src/lazr/restful/example/base/tests/hostedfile.txt b/src/lazr/restful/example/base/tests/hostedfile.txt
index 4725646..53ff057 100644
--- a/src/lazr/restful/example/base/tests/hostedfile.txt
+++ b/src/lazr/restful/example/base/tests/hostedfile.txt
@@ -15,7 +15,7 @@ File resources
1515
16A cookbook starts out with a link to a cover image, but no actual cover.16A cookbook starts out with a link to a cover image, but no actual cover.
1717
18 >>> from six.moves.urllib.parse import quote18 >>> from urllib.parse import quote
19 >>> greens_url = quote("/cookbooks/Everyday Greens")19 >>> greens_url = quote("/cookbooks/Everyday Greens")
20 >>> greens = webservice.get(greens_url).jsonBody()20 >>> greens = webservice.get(greens_url).jsonBody()
21 >>> print(greens['cover_link'])21 >>> print(greens['cover_link'])
diff --git a/src/lazr/restful/example/base/tests/representation-cache.txt b/src/lazr/restful/example/base/tests/representation-cache.txt
index 7870eac..0b6a340 100644
--- a/src/lazr/restful/example/base/tests/representation-cache.txt
+++ b/src/lazr/restful/example/base/tests/representation-cache.txt
@@ -211,7 +211,7 @@ POST did.
211 >>> print(list(dictionary.keys())[0])211 >>> print(list(dictionary.keys())[0])
212 http://.../devel/cookbooks/Everyday%20Greens,application/json212 http://.../devel/cookbooks/Everyday%20Greens,application/json
213213
214 >>> from six.moves.urllib.parse import quote214 >>> from urllib.parse import quote
215 >>> greens_url = quote("/cookbooks/Everyday Greens")215 >>> greens_url = quote("/cookbooks/Everyday Greens")
216 >>> ignore = webservice.named_post(216 >>> ignore = webservice.named_post(
217 ... greens_url, "replace_cover", cover="foo")217 ... greens_url, "replace_cover", cover="foo")
diff --git a/src/lazr/restful/example/base/tests/service.txt b/src/lazr/restful/example/base/tests/service.txt
index dcaf6cf..67e7ac3 100644
--- a/src/lazr/restful/example/base/tests/service.txt
+++ b/src/lazr/restful/example/base/tests/service.txt
@@ -59,7 +59,7 @@ resource yields a 405 error.
59 Allow: GET POST59 Allow: GET POST
60 ...60 ...
6161
62 >>> from six.moves.urllib.parse import quote62 >>> from urllib.parse import quote
63 >>> print(webservice.delete(quote("/dishes/Roast chicken")))63 >>> print(webservice.delete(quote("/dishes/Roast chicken")))
64 HTTP/1.1 405 Method Not Allowed...64 HTTP/1.1 405 Method Not Allowed...
65 Allow: GET PUT PATCH65 Allow: GET PUT PATCH
diff --git a/src/lazr/restful/example/base/tests/wadl.txt b/src/lazr/restful/example/base/tests/wadl.txt
index e9ba3e9..47ea28f 100644
--- a/src/lazr/restful/example/base/tests/wadl.txt
+++ b/src/lazr/restful/example/base/tests/wadl.txt
@@ -12,7 +12,7 @@ Entry resources
12Let's get a WADL representation of an entry resource (in this case, a12Let's get a WADL representation of an entry resource (in this case, a
13cookbook), and see what's inside.13cookbook), and see what's inside.
1414
15 >>> from six.moves.urllib.parse import quote15 >>> from urllib.parse import quote
16 >>> from lazr.restful.testing.webservice import WebServiceCaller16 >>> from lazr.restful.testing.webservice import WebServiceCaller
17 >>> webservice = WebServiceCaller(domain='cookbooks.dev')17 >>> webservice = WebServiceCaller(domain='cookbooks.dev')
18 >>> entry_url = quote("/cookbooks/The Joy of Cooking")18 >>> entry_url = quote("/cookbooks/The Joy of Cooking")
diff --git a/src/lazr/restful/example/base/traversal.py b/src/lazr/restful/example/base/traversal.py
index 4ae07a9..a48f346 100644
--- a/src/lazr/restful/example/base/traversal.py
+++ b/src/lazr/restful/example/base/traversal.py
@@ -9,11 +9,11 @@ __all__ = [
9 "TraverseWithGet",9 "TraverseWithGet",
10]10]
1111
1212from urllib.parse import (
13from six.moves.urllib.parse import (
14 unquote,13 unquote,
15 urlparse,14 urlparse,
16)15)
16
17from zope.component import getUtility17from zope.component import getUtility
18from zope.publisher.interfaces import IPublishTraverse, NotFound18from zope.publisher.interfaces import IPublishTraverse, NotFound
19from zope.publisher.interfaces.browser import IDefaultBrowserLayer19from zope.publisher.interfaces.browser import IDefaultBrowserLayer
diff --git a/src/lazr/restful/marshallers.py b/src/lazr/restful/marshallers.py
index 3439106..20f6f9e 100644
--- a/src/lazr/restful/marshallers.py
+++ b/src/lazr/restful/marshallers.py
@@ -25,10 +25,10 @@ from collections import OrderedDict
25from datetime import datetime25from datetime import datetime
26from io import BytesIO26from io import BytesIO
27import re27import re
28from urllib.parse import unquote
2829
29import pytz30import pytz
30import simplejson31import simplejson
31from six.moves.urllib.parse import unquote
3232
33from zope.datetime import (33from zope.datetime import (
34 DateTimeError,34 DateTimeError,
diff --git a/src/lazr/restful/publisher.py b/src/lazr/restful/publisher.py
index 92b668a..67e4ea0 100644
--- a/src/lazr/restful/publisher.py
+++ b/src/lazr/restful/publisher.py
@@ -12,13 +12,13 @@ __all__ = [
12 "WebServiceRequestTraversal",12 "WebServiceRequestTraversal",
13]13]
1414
1515from urllib.parse import (
16import simplejson
17from six.moves.urllib.parse import (
18 quote,16 quote,
19 urlsplit,17 urlsplit,
20 urlunsplit,18 urlunsplit,
21)19)
20
21import simplejson
22from zope.component import (22from zope.component import (
23 adapter,23 adapter,
24 getMultiAdapter,24 getMultiAdapter,
diff --git a/src/lazr/restful/simple.py b/src/lazr/restful/simple.py
index 2c58320..3a2b271 100644
--- a/src/lazr/restful/simple.py
+++ b/src/lazr/restful/simple.py
@@ -16,11 +16,11 @@ __all__ = [
16]16]
1717
18import traceback18import traceback
1919from urllib.parse import (
20from six.moves.urllib.parse import (
21 quote,20 quote,
22 unquote,21 unquote,
23)22)
23
24from zope.component import (24from zope.component import (
25 adapter,25 adapter,
26 getMultiAdapter,26 getMultiAdapter,
diff --git a/src/lazr/restful/tales.py b/src/lazr/restful/tales.py
index 0be2185..6b975fe 100644
--- a/src/lazr/restful/tales.py
+++ b/src/lazr/restful/tales.py
@@ -30,6 +30,7 @@ import operator
30import re30import re
31import simplejson31import simplejson
32import textwrap32import textwrap
33from urllib.parse import quote
3334
34from docutils import io35from docutils import io
35from docutils.core import Publisher36from docutils.core import Publisher
@@ -45,7 +46,6 @@ from docutils.writers.html4css1 import (
45 Writer as HTMLWriter,46 Writer as HTMLWriter,
46)47)
47from docutils.writers.null import Writer as NullWriter48from docutils.writers.null import Writer as NullWriter
48from six.moves.urllib.parse import quote
49from zope.component import (49from zope.component import (
50 adapter,50 adapter,
51 getGlobalSiteManager,51 getGlobalSiteManager,
diff --git a/src/lazr/restful/testing/webservice.py b/src/lazr/restful/testing/webservice.py
index 148fd4c..85e8ba6 100644
--- a/src/lazr/restful/testing/webservice.py
+++ b/src/lazr/restful/testing/webservice.py
@@ -27,14 +27,14 @@ import simplejson
27import sys27import sys
28from types import ModuleType28from types import ModuleType
29import unittest29import unittest
30from urllib.parse import (
31 quote,
32 urljoin,
33)
3034
31import wsgi_intercept35import wsgi_intercept
3236
33import six37import six
34from six.moves.urllib.parse import (
35 quote,
36 urljoin,
37)
38from zope.component import adapter, getGlobalSiteManager, getUtility38from zope.component import adapter, getGlobalSiteManager, getUtility
39from zope.configuration import xmlconfig39from zope.configuration import xmlconfig
40from zope.interface import alsoProvides, implementer, Interface40from zope.interface import alsoProvides, implementer, Interface

Subscribers

People subscribed via source and target branches