Merge lp:~barry/ubuntuone-control-panel/use-json into lp:ubuntuone-control-panel

Proposed by Barry Warsaw
Status: Merged
Approved by: dobey
Approved revision: 339
Merged at revision: 380
Proposed branch: lp:~barry/ubuntuone-control-panel/use-json
Merge into: lp:ubuntuone-control-panel
Diff against target: 49 lines (+4/-5)
2 files modified
ubuntuone/controlpanel/tests/test_backend.py (+2/-3)
ubuntuone/controlpanel/web_client.py (+2/-2)
To merge this branch: bzr merge lp:~barry/ubuntuone-control-panel/use-json
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+133517@code.launchpad.net

Commit message

Replace the third party simplejson module with the stdlib json module.

Description of the change

Switch from simplejson to the built-in json module. This allows us to remove simplejson as a task:ubuntu dependency and drop simplejson (and thus one of the Python 2 dependencies) from the image.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Also, in the packaging branch, please drop python-simplejson from Depends.

Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There was a problem validating some authors of the branch. Authors must be either one of the listed Launchpad users, or a member of one of the listed teams on Launchpad.

Persons or Teams:

    contributor-agreement-canonical
    ubuntuone-hackers

Unaccepted Authors:

    Barry Warsaw <email address hidden>

Revision history for this message
Barry Warsaw (barry) wrote :

I have no idea what that error means, but that address *is* registered with Launchpad. If it's a problem, just use my <email address hidden> or <email address hidden> address instead.

Revision history for this message
dobey (dobey) wrote :

The error means you're not in any of the listed teams, is all. The e-mail address is from the bzr commit, and if it weren't registered on LP, would result in a different error. Anyway, I've done the workaround.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/tests/test_backend.py'
2--- ubuntuone/controlpanel/tests/test_backend.py 2012-10-29 16:02:46 +0000
3+++ ubuntuone/controlpanel/tests/test_backend.py 2012-11-08 16:38:29 +0000
4@@ -16,13 +16,12 @@
5
6 """Tests for the control panel backend."""
7
8+import json
9 import operator
10 import os
11
12 from collections import defaultdict
13
14-import simplejson
15-
16 from twisted.internet import defer
17 from twisted.internet.defer import inlineCallbacks, returnValue
18 from ubuntuone.devtools.handlers import MementoHandler
19@@ -106,7 +105,7 @@
20 elif self.failure:
21 return defer.fail(backend.WebClientError(self.failure))
22 else:
23- result = simplejson.loads(self.results[method])
24+ result = json.loads(self.results[method])
25 return defer.succeed(result)
26
27 @defer.inlineCallbacks
28
29=== modified file 'ubuntuone/controlpanel/web_client.py'
30--- ubuntuone/controlpanel/web_client.py 2012-10-23 19:26:30 +0000
31+++ ubuntuone/controlpanel/web_client.py 2012-11-08 16:38:29 +0000
32@@ -16,7 +16,7 @@
33
34 """The web client."""
35
36-import simplejson
37+import json
38
39 from twisted.internet import defer
40 from ubuntu_sso.utils.webclient import webclient_factory
41@@ -48,7 +48,7 @@
42 credentials = yield self.get_credentials()
43 response = yield self.wc.request(iri, extra_headers=extra_headers,
44 oauth_credentials=credentials)
45- result = simplejson.loads(response.content)
46+ result = json.loads(response.content)
47 defer.returnValue(result)
48
49 @defer.inlineCallbacks

Subscribers

People subscribed via source and target branches