Merge lp:~dobey/ubuntuone-storage-protocol/new-pep8 into lp:ubuntuone-storage-protocol

Proposed by dobey
Status: Merged
Approved by: Roberto Alsina
Approved revision: no longer in the source branch.
Merged at revision: 156
Proposed branch: lp:~dobey/ubuntuone-storage-protocol/new-pep8
Merge into: lp:ubuntuone-storage-protocol
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/new-pep8
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Michał Karnicki (community) Approve
Review via email: mp+137673@code.launchpad.net

Commit message

Ignore some new PEP8 errors for now and update code to deal with others.

To post a comment you must log in.
Revision history for this message
Michał Karnicki (karni) wrote :

Comments given on IRC.

review: Approve
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
156. By dobey

Ignore some new PEP8 errors for now and update code to deal with others.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'run-tests'
--- run-tests 2012-08-15 18:08:39 +0000
+++ run-tests 2012-12-03 20:05:29 +0000
@@ -28,5 +28,5 @@
28USE_PYFLAKES=1 u1lint28USE_PYFLAKES=1 u1lint
29/usr/bin/env python setup.py clean29/usr/bin/env python setup.py clean
30rm -rf build30rm -rf build
31pep8 --repeat --exclude="*_pb2.py" .31pep8 --repeat --ignore=E126,E127,E128 --exclude="*_pb2.py,.bzr,.pc,build" .
32rm -rf _trial_temp32rm -rf _trial_temp
3333
=== modified file 'setup.py'
--- setup.py 2012-10-31 21:51:14 +0000
+++ setup.py 2012-12-03 20:05:29 +0000
@@ -79,7 +79,6 @@
79 'data/UbuntuOne-ValiCert_Class_2_VA.pem',79 'data/UbuntuOne-ValiCert_Class_2_VA.pem',
80 'data/UbuntuOne-Go_Daddy_Class_2_CA.pem'])],80 'data/UbuntuOne-Go_Daddy_Class_2_CA.pem'])],
8181
82 cmdclass={82 cmdclass={'build': StorageProtocolBuild,
83 'build': StorageProtocolBuild,83 'clean': StorageProtocolClean},
84 'clean': StorageProtocolClean},
85 )84 )
8685
=== modified file 'tests/test_client.py'
--- tests/test_client.py 2012-03-29 20:28:09 +0000
+++ tests/test_client.py 2012-12-03 20:05:29 +0000
@@ -296,7 +296,7 @@
296 'hello')296 'hello')
297 #create a response and message297 #create a response and message
298 share_resp = sharersp.NotifyShareHolder.from_params(298 share_resp = sharersp.NotifyShareHolder.from_params(
299 uuid.uuid4(), uuid.uuid4(), 'sname', 'byu', 'tou', 'View')299 uuid.uuid4(), uuid.uuid4(), 'sname', 'byu', 'tou', 'View')
300 proto_msg = protocol_pb2.Message()300 proto_msg = protocol_pb2.Message()
301 proto_msg.type = protocol_pb2.Message.NOTIFY_SHARE301 proto_msg.type = protocol_pb2.Message.NOTIFY_SHARE
302 share_resp.dump_to_msg(proto_msg.notify_share)302 share_resp.dump_to_msg(proto_msg.notify_share)
303303
=== modified file 'tests/test_context.py'
--- tests/test_context.py 2012-08-11 00:03:47 +0000
+++ tests/test_context.py 2012-12-03 20:05:29 +0000
@@ -149,7 +149,7 @@
149 """Test the no_verify option."""149 """Test the no_verify option."""
150 certs = FakeCerts(self, "localhost")150 certs = FakeCerts(self, "localhost")
151 server_context = ssl.DefaultOpenSSLContextFactory(151 server_context = ssl.DefaultOpenSSLContextFactory(
152 certs.server_key_path, certs.server_cert_path)152 certs.server_key_path, certs.server_cert_path)
153 client_context = context.get_ssl_context(no_verify=True,153 client_context = context.get_ssl_context(no_verify=True,
154 hostname="localhost")154 hostname="localhost")
155155
@@ -165,7 +165,7 @@
165 """A wrong certificate is rejected."""165 """A wrong certificate is rejected."""
166 certs = FakeCerts(self, "localhost")166 certs = FakeCerts(self, "localhost")
167 server_context = ssl.DefaultOpenSSLContextFactory(167 server_context = ssl.DefaultOpenSSLContextFactory(
168 certs.server_key_path, certs.server_cert_path)168 certs.server_key_path, certs.server_cert_path)
169 client_context = context.get_ssl_context(no_verify=False,169 client_context = context.get_ssl_context(no_verify=False,
170 hostname="localhost")170 hostname="localhost")
171171
@@ -178,7 +178,7 @@
178 """A wrong hostname is rejected."""178 """A wrong hostname is rejected."""
179 certs = FakeCerts(self, "thisiswronghost.net")179 certs = FakeCerts(self, "thisiswronghost.net")
180 server_context = ssl.DefaultOpenSSLContextFactory(180 server_context = ssl.DefaultOpenSSLContextFactory(
181 certs.server_key_path, certs.server_cert_path)181 certs.server_key_path, certs.server_cert_path)
182 self.patch(context, "get_certificates", lambda: [certs.ca_cert])182 self.patch(context, "get_certificates", lambda: [certs.ca_cert])
183 client_context = context.get_ssl_context(no_verify=False,183 client_context = context.get_ssl_context(no_verify=False,
184 hostname="localhost")184 hostname="localhost")
@@ -192,7 +192,7 @@
192 """A valid certificate passes checks."""192 """A valid certificate passes checks."""
193 certs = FakeCerts(self, "localhost")193 certs = FakeCerts(self, "localhost")
194 server_context = ssl.DefaultOpenSSLContextFactory(194 server_context = ssl.DefaultOpenSSLContextFactory(
195 certs.server_key_path, certs.server_cert_path)195 certs.server_key_path, certs.server_cert_path)
196 self.patch(context, "get_certificates", lambda: [certs.ca_cert])196 self.patch(context, "get_certificates", lambda: [certs.ca_cert])
197 client_context = context.get_ssl_context(no_verify=False,197 client_context = context.get_ssl_context(no_verify=False,
198 hostname="localhost")198 hostname="localhost")
199199
=== modified file 'tests/test_sharersp.py'
--- tests/test_sharersp.py 2012-03-29 20:28:09 +0000
+++ tests/test_sharersp.py 2012-12-03 20:05:29 +0000
@@ -79,7 +79,7 @@
79 def test_from_me(self):79 def test_from_me(self):
80 """Test ShareResponse.from_params with a 'from_me' share."""80 """Test ShareResponse.from_params with a 'from_me' share."""
81 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",81 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
82 u"username", u"visible_name", True, self.access_level,82 u"username", u"visible_name", True, self.access_level,
83 uuid.uuid4())83 uuid.uuid4())
84 share = ShareResponse.from_params(*args)84 share = ShareResponse.from_params(*args)
85 self.assertShareResponse(share, args)85 self.assertShareResponse(share, args)
@@ -87,7 +87,7 @@
87 def test_from_me_without_volume(self):87 def test_from_me_without_volume(self):
88 """Test ShareResponse.from_params with a 'from_me' share."""88 """Test ShareResponse.from_params with a 'from_me' share."""
89 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",89 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
90 u"username", u"visible_name", True, self.access_level)90 u"username", u"visible_name", True, self.access_level)
91 share = ShareResponse.from_params(*args)91 share = ShareResponse.from_params(*args)
92 self.assertShareResponse(share, args)92 self.assertShareResponse(share, args)
9393
@@ -135,7 +135,7 @@
135 def test_from_me(self):135 def test_from_me(self):
136 """Test ShareResponse.from_params with a 'from_me' share."""136 """Test ShareResponse.from_params with a 'from_me' share."""
137 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",137 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
138 u"username", u"visible_name", True, self.access_level,138 u"username", u"visible_name", True, self.access_level,
139 uuid.uuid4())139 uuid.uuid4())
140 share = ShareResponse.from_params(*args)140 share = ShareResponse.from_params(*args)
141 share.dump_to_msg(self.msg.shares)141 share.dump_to_msg(self.msg.shares)
@@ -145,7 +145,7 @@
145 def test_from_me_without_volume(self):145 def test_from_me_without_volume(self):
146 """Test ShareResponse.from_params with a 'from_me' share."""146 """Test ShareResponse.from_params with a 'from_me' share."""
147 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",147 args = (uuid.uuid4(), "from_me", uuid.uuid4(), "share_name",
148 u"username", u"visible_name", True, self.access_level)148 u"username", u"visible_name", True, self.access_level)
149 share = ShareResponse.from_params(*args)149 share = ShareResponse.from_params(*args)
150 share.dump_to_msg(self.msg.shares)150 share.dump_to_msg(self.msg.shares)
151 self.assertEqualShare(share,151 self.assertEqualShare(share,
152152
=== modified file 'ubuntuone/storageprotocol/client.py'
--- ubuntuone/storageprotocol/client.py 2012-06-26 01:50:53 +0000
+++ ubuntuone/storageprotocol/client.py 2012-12-03 20:05:29 +0000
@@ -882,8 +882,8 @@
882882
883 def processMessage(self, message):883 def processMessage(self, message):
884 """Process the answer from the server."""884 """Process the answer from the server."""
885 if (message.type == protocol_pb2.Message.VOLUME_CREATED and885 if message.type == protocol_pb2.Message.VOLUME_CREATED and \
886 message.volume_created.type == protocol_pb2.Volumes.UDF):886 message.volume_created.type == protocol_pb2.Volumes.UDF:
887 self.volume_id = message.volume_created.udf.volume887 self.volume_id = message.volume_created.udf.volume
888 self.node_id = message.volume_created.udf.node888 self.node_id = message.volume_created.udf.node
889 self.done()889 self.done()
890890
=== modified file 'ubuntuone/storageprotocol/delta.py'
--- ubuntuone/storageprotocol/delta.py 2012-03-29 20:28:09 +0000
+++ ubuntuone/storageprotocol/delta.py 2012-12-03 20:05:29 +0000
@@ -37,10 +37,9 @@
37FILE = 037FILE = 0
38DIRECTORY = 138DIRECTORY = 1
3939
40file_type_registry = {40file_type_registry = {protocol_pb2.FileInfo.FILE: FILE,
41 protocol_pb2.FileInfo.FILE: FILE,41 protocol_pb2.FileInfo.DIRECTORY: DIRECTORY,
42 protocol_pb2.FileInfo.DIRECTORY: DIRECTORY,42 }
43 }
4443
4544
46class FileInfoDelta(object):45class FileInfoDelta(object):
4746
=== modified file 'ubuntuone/storageprotocol/errors.py'
--- ubuntuone/storageprotocol/errors.py 2012-03-29 20:28:09 +0000
+++ ubuntuone/storageprotocol/errors.py 2012-12-03 20:05:29 +0000
@@ -164,25 +164,25 @@
164164
165165
166_error_mapping = {166_error_mapping = {
167 protocol_pb2.Error.UNSUPPORTED_VERSION: UnsupportedVersionError,167 protocol_pb2.Error.UNSUPPORTED_VERSION: UnsupportedVersionError,
168 protocol_pb2.Error.AUTHENTICATION_FAILED: AuthenticationFailedError,168 protocol_pb2.Error.AUTHENTICATION_FAILED: AuthenticationFailedError,
169 protocol_pb2.Error.INTERNAL_ERROR: InternalError,169 protocol_pb2.Error.INTERNAL_ERROR: InternalError,
170 protocol_pb2.Error.AUTHENTICATION_REQUIRED: AuthenticationRequiredError,170 protocol_pb2.Error.AUTHENTICATION_REQUIRED: AuthenticationRequiredError,
171 protocol_pb2.Error.NO_PERMISSION: NoPermissionError,171 protocol_pb2.Error.NO_PERMISSION: NoPermissionError,
172 protocol_pb2.Error.ALREADY_EXISTS: AlreadyExistsError,172 protocol_pb2.Error.ALREADY_EXISTS: AlreadyExistsError,
173 protocol_pb2.Error.DOES_NOT_EXIST: DoesNotExistError,173 protocol_pb2.Error.DOES_NOT_EXIST: DoesNotExistError,
174 protocol_pb2.Error.NOT_A_DIRECTORY: NotADirectoryError,174 protocol_pb2.Error.NOT_A_DIRECTORY: NotADirectoryError,
175 protocol_pb2.Error.NOT_EMPTY: NotEmptyError,175 protocol_pb2.Error.NOT_EMPTY: NotEmptyError,
176 protocol_pb2.Error.NOT_AVAILABLE: NotAvailableError,176 protocol_pb2.Error.NOT_AVAILABLE: NotAvailableError,
177 protocol_pb2.Error.UPLOAD_IN_PROGRESS: UploadInProgressError,177 protocol_pb2.Error.UPLOAD_IN_PROGRESS: UploadInProgressError,
178 protocol_pb2.Error.UPLOAD_CORRUPT: UploadCorruptError,178 protocol_pb2.Error.UPLOAD_CORRUPT: UploadCorruptError,
179 protocol_pb2.Error.UPLOAD_CANCELED: UploadCanceledError,179 protocol_pb2.Error.UPLOAD_CANCELED: UploadCanceledError,
180 protocol_pb2.Error.CONFLICT: ConflictError,180 protocol_pb2.Error.CONFLICT: ConflictError,
181 protocol_pb2.Error.TRY_AGAIN: TryAgainError,181 protocol_pb2.Error.TRY_AGAIN: TryAgainError,
182 protocol_pb2.Error.PROTOCOL_ERROR: ProtocolError,182 protocol_pb2.Error.PROTOCOL_ERROR: ProtocolError,
183 protocol_pb2.Error.QUOTA_EXCEEDED: QuotaExceededError,183 protocol_pb2.Error.QUOTA_EXCEEDED: QuotaExceededError,
184 protocol_pb2.Error.INVALID_FILENAME: InvalidFilenameError,184 protocol_pb2.Error.INVALID_FILENAME: InvalidFilenameError,
185 protocol_pb2.Error.CANNOT_PRODUCE_DELTA: CannotProduceDelta,185 protocol_pb2.Error.CANNOT_PRODUCE_DELTA: CannotProduceDelta,
186}186}
187187
188188
189189
=== modified file 'ubuntuone/storageprotocol/volumes.py'
--- ubuntuone/storageprotocol/volumes.py 2012-03-29 20:28:09 +0000
+++ ubuntuone/storageprotocol/volumes.py 2012-12-03 20:05:29 +0000
@@ -37,7 +37,7 @@
37# these are valid, pylint: disable=C010337# these are valid, pylint: disable=C0103
38_direction_prot2nice = {38_direction_prot2nice = {
39 protocol_pb2.Shares.FROM_ME: "from_me",39 protocol_pb2.Shares.FROM_ME: "from_me",
40 protocol_pb2.Shares.TO_ME: "to_me",40 protocol_pb2.Shares.TO_ME: "to_me",
41}41}
42_direction_nice2prot = dict((y, x) for x, y in _direction_prot2nice.items())42_direction_nice2prot = dict((y, x) for x, y in _direction_prot2nice.items())
4343

Subscribers

People subscribed via source and target branches