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
=== modified file 'ubuntuone/controlpanel/tests/test_backend.py'
--- ubuntuone/controlpanel/tests/test_backend.py 2012-10-29 16:02:46 +0000
+++ ubuntuone/controlpanel/tests/test_backend.py 2012-11-08 16:38:29 +0000
@@ -16,13 +16,12 @@
1616
17"""Tests for the control panel backend."""17"""Tests for the control panel backend."""
1818
19import json
19import operator20import operator
20import os21import os
2122
22from collections import defaultdict23from collections import defaultdict
2324
24import simplejson
25
26from twisted.internet import defer25from twisted.internet import defer
27from twisted.internet.defer import inlineCallbacks, returnValue26from twisted.internet.defer import inlineCallbacks, returnValue
28from ubuntuone.devtools.handlers import MementoHandler27from ubuntuone.devtools.handlers import MementoHandler
@@ -106,7 +105,7 @@
106 elif self.failure:105 elif self.failure:
107 return defer.fail(backend.WebClientError(self.failure))106 return defer.fail(backend.WebClientError(self.failure))
108 else:107 else:
109 result = simplejson.loads(self.results[method])108 result = json.loads(self.results[method])
110 return defer.succeed(result)109 return defer.succeed(result)
111110
112 @defer.inlineCallbacks111 @defer.inlineCallbacks
113112
=== modified file 'ubuntuone/controlpanel/web_client.py'
--- ubuntuone/controlpanel/web_client.py 2012-10-23 19:26:30 +0000
+++ ubuntuone/controlpanel/web_client.py 2012-11-08 16:38:29 +0000
@@ -16,7 +16,7 @@
1616
17"""The web client."""17"""The web client."""
1818
19import simplejson19import json
2020
21from twisted.internet import defer21from twisted.internet import defer
22from ubuntu_sso.utils.webclient import webclient_factory22from ubuntu_sso.utils.webclient import webclient_factory
@@ -48,7 +48,7 @@
48 credentials = yield self.get_credentials()48 credentials = yield self.get_credentials()
49 response = yield self.wc.request(iri, extra_headers=extra_headers,49 response = yield self.wc.request(iri, extra_headers=extra_headers,
50 oauth_credentials=credentials)50 oauth_credentials=credentials)
51 result = simplejson.loads(response.content)51 result = json.loads(response.content)
52 defer.returnValue(result)52 defer.returnValue(result)
5353
54 @defer.inlineCallbacks54 @defer.inlineCallbacks

Subscribers

People subscribed via source and target branches