Merge lp:~dobey/ubuntuone-storage-protocol/update-4-2 into lp:ubuntuone-storage-protocol/stable-4-2

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: no longer in the source branch.
Merged at revision: 155
Proposed branch: lp:~dobey/ubuntuone-storage-protocol/update-4-2
Merge into: lp:ubuntuone-storage-protocol/stable-4-2
Diff against target: 211 lines (+37/-39)
9 files modified
run-tests (+1/-1)
setup.py (+2/-3)
tests/test_client.py (+1/-1)
tests/test_context.py (+4/-4)
tests/test_sharersp.py (+4/-4)
ubuntuone/storageprotocol/client.py (+2/-2)
ubuntuone/storageprotocol/delta.py (+3/-4)
ubuntuone/storageprotocol/errors.py (+19/-19)
ubuntuone/storageprotocol/volumes.py (+1/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-storage-protocol/update-4-2
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
Review via email: mp+137967@code.launchpad.net

Commit message

Ignore some new pep8 errors, and update code to fix others.

To post a comment you must log in.
Revision history for this message
Mike McCracken (mikemc) :
review: Approve
155. By dobey

Ignore some new pep8 errors, and update code to fix others.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests'
2--- run-tests 2012-08-15 18:08:39 +0000
3+++ run-tests 2012-12-04 19:50:28 +0000
4@@ -28,5 +28,5 @@
5 USE_PYFLAKES=1 u1lint
6 /usr/bin/env python setup.py clean
7 rm -rf build
8-pep8 --repeat --exclude="*_pb2.py" .
9+pep8 --repeat --ignore=E126,E127,E128 --exclude="*_pb2.py,.bzr,.pc,build" .
10 rm -rf _trial_temp
11
12=== modified file 'setup.py'
13--- setup.py 2012-08-16 19:21:06 +0000
14+++ setup.py 2012-12-04 19:50:28 +0000
15@@ -79,7 +79,6 @@
16 'data/UbuntuOne-ValiCert_Class_2_VA.pem',
17 'data/UbuntuOne-Go_Daddy_Class_2_CA.pem'])],
18
19- cmdclass={
20- 'build': StorageProtocolBuild,
21- 'clean': StorageProtocolClean},
22+ cmdclass={'build': StorageProtocolBuild,
23+ 'clean': StorageProtocolClean},
24 )
25
26=== modified file 'tests/test_client.py'
27--- tests/test_client.py 2012-03-29 20:28:09 +0000
28+++ tests/test_client.py 2012-12-04 19:50:28 +0000
29@@ -296,7 +296,7 @@
30 'hello')
31 #create a response and message
32 share_resp = sharersp.NotifyShareHolder.from_params(
33- uuid.uuid4(), uuid.uuid4(), 'sname', 'byu', 'tou', 'View')
34+ uuid.uuid4(), uuid.uuid4(), 'sname', 'byu', 'tou', 'View')
35 proto_msg = protocol_pb2.Message()
36 proto_msg.type = protocol_pb2.Message.NOTIFY_SHARE
37 share_resp.dump_to_msg(proto_msg.notify_share)
38
39=== modified file 'tests/test_context.py'
40--- tests/test_context.py 2012-08-11 00:03:47 +0000
41+++ tests/test_context.py 2012-12-04 19:50:28 +0000
42@@ -149,7 +149,7 @@
43 """Test the no_verify option."""
44 certs = FakeCerts(self, "localhost")
45 server_context = ssl.DefaultOpenSSLContextFactory(
46- certs.server_key_path, certs.server_cert_path)
47+ certs.server_key_path, certs.server_cert_path)
48 client_context = context.get_ssl_context(no_verify=True,
49 hostname="localhost")
50
51@@ -165,7 +165,7 @@
52 """A wrong certificate is rejected."""
53 certs = FakeCerts(self, "localhost")
54 server_context = ssl.DefaultOpenSSLContextFactory(
55- certs.server_key_path, certs.server_cert_path)
56+ certs.server_key_path, certs.server_cert_path)
57 client_context = context.get_ssl_context(no_verify=False,
58 hostname="localhost")
59
60@@ -178,7 +178,7 @@
61 """A wrong hostname is rejected."""
62 certs = FakeCerts(self, "thisiswronghost.net")
63 server_context = ssl.DefaultOpenSSLContextFactory(
64- certs.server_key_path, certs.server_cert_path)
65+ certs.server_key_path, certs.server_cert_path)
66 self.patch(context, "get_certificates", lambda: [certs.ca_cert])
67 client_context = context.get_ssl_context(no_verify=False,
68 hostname="localhost")
69@@ -192,7 +192,7 @@
70 """A valid certificate passes checks."""
71 certs = FakeCerts(self, "localhost")
72 server_context = ssl.DefaultOpenSSLContextFactory(
73- certs.server_key_path, certs.server_cert_path)
74+ certs.server_key_path, certs.server_cert_path)
75 self.patch(context, "get_certificates", lambda: [certs.ca_cert])
76 client_context = context.get_ssl_context(no_verify=False,
77 hostname="localhost")
78
79=== modified file 'tests/test_sharersp.py'
80--- tests/test_sharersp.py 2012-03-29 20:28:09 +0000
81+++ tests/test_sharersp.py 2012-12-04 19:50:28 +0000
82@@ -79,7 +79,7 @@
83 def test_from_me(self):
84 """Test ShareResponse.from_params with a 'from_me' share."""
85 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
86- u"username", u"visible_name", True, self.access_level,
87+ u"username", u"visible_name", True, self.access_level,
88 uuid.uuid4())
89 share = ShareResponse.from_params(*args)
90 self.assertShareResponse(share, args)
91@@ -87,7 +87,7 @@
92 def test_from_me_without_volume(self):
93 """Test ShareResponse.from_params with a 'from_me' share."""
94 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
95- u"username", u"visible_name", True, self.access_level)
96+ u"username", u"visible_name", True, self.access_level)
97 share = ShareResponse.from_params(*args)
98 self.assertShareResponse(share, args)
99
100@@ -135,7 +135,7 @@
101 def test_from_me(self):
102 """Test ShareResponse.from_params with a 'from_me' share."""
103 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
104- u"username", u"visible_name", True, self.access_level,
105+ u"username", u"visible_name", True, self.access_level,
106 uuid.uuid4())
107 share = ShareResponse.from_params(*args)
108 share.dump_to_msg(self.msg.shares)
109@@ -145,7 +145,7 @@
110 def test_from_me_without_volume(self):
111 """Test ShareResponse.from_params with a 'from_me' share."""
112 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
113- u"username", u"visible_name", True, self.access_level)
114+ u"username", u"visible_name", True, self.access_level)
115 share = ShareResponse.from_params(*args)
116 share.dump_to_msg(self.msg.shares)
117 self.assertEqualShare(share,
118
119=== modified file 'ubuntuone/storageprotocol/client.py'
120--- ubuntuone/storageprotocol/client.py 2012-06-26 01:50:53 +0000
121+++ ubuntuone/storageprotocol/client.py 2012-12-04 19:50:28 +0000
122@@ -882,8 +882,8 @@
123
124 def processMessage(self, message):
125 """Process the answer from the server."""
126- if (message.type == protocol_pb2.Message.VOLUME_CREATED and
127- message.volume_created.type == protocol_pb2.Volumes.UDF):
128+ if message.type == protocol_pb2.Message.VOLUME_CREATED and \
129+ message.volume_created.type == protocol_pb2.Volumes.UDF:
130 self.volume_id = message.volume_created.udf.volume
131 self.node_id = message.volume_created.udf.node
132 self.done()
133
134=== modified file 'ubuntuone/storageprotocol/delta.py'
135--- ubuntuone/storageprotocol/delta.py 2012-03-29 20:28:09 +0000
136+++ ubuntuone/storageprotocol/delta.py 2012-12-04 19:50:28 +0000
137@@ -37,10 +37,9 @@
138 FILE = 0
139 DIRECTORY = 1
140
141-file_type_registry = {
142- protocol_pb2.FileInfo.FILE: FILE,
143- protocol_pb2.FileInfo.DIRECTORY: DIRECTORY,
144- }
145+file_type_registry = {protocol_pb2.FileInfo.FILE: FILE,
146+ protocol_pb2.FileInfo.DIRECTORY: DIRECTORY,
147+ }
148
149
150 class FileInfoDelta(object):
151
152=== modified file 'ubuntuone/storageprotocol/errors.py'
153--- ubuntuone/storageprotocol/errors.py 2012-03-29 20:28:09 +0000
154+++ ubuntuone/storageprotocol/errors.py 2012-12-04 19:50:28 +0000
155@@ -164,25 +164,25 @@
156
157
158 _error_mapping = {
159- protocol_pb2.Error.UNSUPPORTED_VERSION: UnsupportedVersionError,
160- protocol_pb2.Error.AUTHENTICATION_FAILED: AuthenticationFailedError,
161- protocol_pb2.Error.INTERNAL_ERROR: InternalError,
162- protocol_pb2.Error.AUTHENTICATION_REQUIRED: AuthenticationRequiredError,
163- protocol_pb2.Error.NO_PERMISSION: NoPermissionError,
164- protocol_pb2.Error.ALREADY_EXISTS: AlreadyExistsError,
165- protocol_pb2.Error.DOES_NOT_EXIST: DoesNotExistError,
166- protocol_pb2.Error.NOT_A_DIRECTORY: NotADirectoryError,
167- protocol_pb2.Error.NOT_EMPTY: NotEmptyError,
168- protocol_pb2.Error.NOT_AVAILABLE: NotAvailableError,
169- protocol_pb2.Error.UPLOAD_IN_PROGRESS: UploadInProgressError,
170- protocol_pb2.Error.UPLOAD_CORRUPT: UploadCorruptError,
171- protocol_pb2.Error.UPLOAD_CANCELED: UploadCanceledError,
172- protocol_pb2.Error.CONFLICT: ConflictError,
173- protocol_pb2.Error.TRY_AGAIN: TryAgainError,
174- protocol_pb2.Error.PROTOCOL_ERROR: ProtocolError,
175- protocol_pb2.Error.QUOTA_EXCEEDED: QuotaExceededError,
176- protocol_pb2.Error.INVALID_FILENAME: InvalidFilenameError,
177- protocol_pb2.Error.CANNOT_PRODUCE_DELTA: CannotProduceDelta,
178+ protocol_pb2.Error.UNSUPPORTED_VERSION: UnsupportedVersionError,
179+ protocol_pb2.Error.AUTHENTICATION_FAILED: AuthenticationFailedError,
180+ protocol_pb2.Error.INTERNAL_ERROR: InternalError,
181+ protocol_pb2.Error.AUTHENTICATION_REQUIRED: AuthenticationRequiredError,
182+ protocol_pb2.Error.NO_PERMISSION: NoPermissionError,
183+ protocol_pb2.Error.ALREADY_EXISTS: AlreadyExistsError,
184+ protocol_pb2.Error.DOES_NOT_EXIST: DoesNotExistError,
185+ protocol_pb2.Error.NOT_A_DIRECTORY: NotADirectoryError,
186+ protocol_pb2.Error.NOT_EMPTY: NotEmptyError,
187+ protocol_pb2.Error.NOT_AVAILABLE: NotAvailableError,
188+ protocol_pb2.Error.UPLOAD_IN_PROGRESS: UploadInProgressError,
189+ protocol_pb2.Error.UPLOAD_CORRUPT: UploadCorruptError,
190+ protocol_pb2.Error.UPLOAD_CANCELED: UploadCanceledError,
191+ protocol_pb2.Error.CONFLICT: ConflictError,
192+ protocol_pb2.Error.TRY_AGAIN: TryAgainError,
193+ protocol_pb2.Error.PROTOCOL_ERROR: ProtocolError,
194+ protocol_pb2.Error.QUOTA_EXCEEDED: QuotaExceededError,
195+ protocol_pb2.Error.INVALID_FILENAME: InvalidFilenameError,
196+ protocol_pb2.Error.CANNOT_PRODUCE_DELTA: CannotProduceDelta,
197 }
198
199
200
201=== modified file 'ubuntuone/storageprotocol/volumes.py'
202--- ubuntuone/storageprotocol/volumes.py 2012-03-29 20:28:09 +0000
203+++ ubuntuone/storageprotocol/volumes.py 2012-12-04 19:50:28 +0000
204@@ -37,7 +37,7 @@
205 # these are valid, pylint: disable=C0103
206 _direction_prot2nice = {
207 protocol_pb2.Shares.FROM_ME: "from_me",
208- protocol_pb2.Shares.TO_ME: "to_me",
209+ protocol_pb2.Shares.TO_ME: "to_me",
210 }
211 _direction_nice2prot = dict((y, x) for x, y in _direction_prot2nice.items())
212

Subscribers

People subscribed via source and target branches

to all changes: