txaws-dev team mailing list archive
-
txaws-dev team
-
Mailing list archive
-
Message #00076
[Merge] lp:~oubiwann/txaws/920227-fix-pep8-pyflakes-errors into lp:txaws
Duncan McGreggor has proposed merging lp:~oubiwann/txaws/920227-fix-pep8-pyflakes-errors into lp:txaws.
Requested reviews:
txAWS Developers (txaws-dev)
Related bugs:
Bug #920227 in txAWS: "codebase currently has PEP8 and Pyflake errors"
https://bugs.launchpad.net/txaws/+bug/920227
For more details, see:
https://code.launchpad.net/~oubiwann/txaws/920227-fix-pep8-pyflakes-errors/+merge/89619
--
https://code.launchpad.net/~oubiwann/txaws/920227-fix-pep8-pyflakes-errors/+merge/89619
Your team txAWS Developers is requested to review the proposed merge of lp:~oubiwann/txaws/920227-fix-pep8-pyflakes-errors into lp:txaws.
=== modified file 'txaws/client/discover/command.py'
--- txaws/client/discover/command.py 2011-09-30 14:35:08 +0000
+++ txaws/client/discover/command.py 2012-01-23 01:30:30 +0000
@@ -72,7 +72,8 @@
print >> self.output, "URL: %s" % query.client.url
print >> self.output
if getattr(query.client, "status", None) is not None:
- print >> self.output, "HTTP status code: %s" % query.client.status
+ print >> self.output, "HTTP status code: %s" % (
+ query.client.status,)
print >> self.output
print >> self.output, message
=== modified file 'txaws/client/gui/gtk.py'
--- txaws/client/gui/gtk.py 2010-02-12 23:12:17 +0000
+++ txaws/client/gui/gtk.py 2012-01-23 01:30:30 +0000
@@ -63,7 +63,7 @@
def set_region(self, creds):
from txaws.service import AWSServiceRegion
- self.region = AWSServiceRegion(creds)
+ self.region = AWSServiceRegion(creds)
def create_client(self, creds):
if creds is not None:
@@ -98,6 +98,7 @@
gtk.STOCK_CANCEL,
gtk.RESPONSE_REJECT))
content = self.password_dialog.get_content_area()
+
def add_entry(name):
box = gtk.HBox()
box.show()
=== modified file 'txaws/client/gui/tests/test_gtk.py'
--- txaws/client/gui/tests/test_gtk.py 2009-04-26 08:32:36 +0000
+++ txaws/client/gui/tests/test_gtk.py 2012-01-23 01:30:30 +0000
@@ -8,4 +8,3 @@
pass
# Really need some, but UI testing hurts my brain.
-
=== modified file 'txaws/ec2/exception.py'
--- txaws/ec2/exception.py 2011-04-21 13:10:37 +0000
+++ txaws/ec2/exception.py 2012-01-23 01:30:30 +0000
@@ -15,6 +15,3 @@
data = self._node_to_dict(error)
if data:
self.errors.append(data)
-
-
-
=== modified file 'txaws/ec2/tests/test_client.py'
--- txaws/ec2/tests/test_client.py 2011-08-29 19:51:50 +0000
+++ txaws/ec2/tests/test_client.py 2012-01-23 01:30:30 +0000
@@ -139,7 +139,8 @@
def submit(self):
return succeed(
- payload.sample_describe_availability_zones_multiple_results)
+ payload.
+ sample_describe_availability_zones_multiple_results)
def check_parsed_availability_zones(results):
self.assertEquals(len(results), 3)
@@ -1751,7 +1752,8 @@
"&SignatureVersion=2&"
"Timestamp=2007-11-12T13%3A14%3A15Z&Version=2008-12-01&"
"argwithnovalue=&fu%20n=g%2Fames")
- self.assertEqual(expected_params, signature.get_canonical_query_params())
+ self.assertEqual(
+ expected_params, signature.get_canonical_query_params())
def test_signing_text(self):
signature = client.Signature(self.creds, self.endpoint, self.params)
=== modified file 'txaws/ec2/tests/test_model.py'
--- txaws/ec2/tests/test_model.py 2009-09-15 21:15:19 +0000
+++ txaws/ec2/tests/test_model.py 2012-01-23 01:30:30 +0000
@@ -28,12 +28,12 @@
"name", "desc", owner_id="me", groups=user_group_pairs, ips=ips)
self.assertEquals(group.name, "name")
self.assertEquals(group.description, "desc")
- self.assertEquals(group.owner_id, "me")
- self.assertEquals(group.allowed_groups[0].user_id, "somegal24")
- self.assertEquals(group.allowed_groups[0].group_name, "other1")
- self.assertEquals(group.allowed_groups[1].user_id, "somegal24")
- self.assertEquals(group.allowed_groups[1].group_name, "other2")
- self.assertEquals(group.allowed_ips[0].cidr_ip, "10.0.1.0/24")
+ self.assertEquals(group.owner_id, "me")
+ self.assertEquals(group.allowed_groups[0].user_id, "somegal24")
+ self.assertEquals(group.allowed_groups[0].group_name, "other1")
+ self.assertEquals(group.allowed_groups[1].user_id, "somegal24")
+ self.assertEquals(group.allowed_groups[1].group_name, "other2")
+ self.assertEquals(group.allowed_ips[0].cidr_ip, "10.0.1.0/24")
class UserIDGroupPairTestCase(TXAWSTestCase):
=== modified file 'txaws/exception.py'
--- txaws/exception.py 2010-03-29 17:16:46 +0000
+++ txaws/exception.py 2012-01-23 01:30:30 +0000
@@ -122,7 +122,6 @@
return self.errors[0]["Message"]
-
class AWSResponseParseError(Exception):
"""
txAWS was unable to parse the server response.
=== modified file 'txaws/meta.py'
--- txaws/meta.py 2009-12-08 04:08:53 +0000
+++ txaws/meta.py 2012-01-23 01:30:30 +0000
@@ -7,4 +7,3 @@
description = """
Twisted-based Asynchronous Libraries for Amazon Web Services
"""
-
=== modified file 'txaws/reactor.py'
--- txaws/reactor.py 2010-01-13 19:56:00 +0000
+++ txaws/reactor.py 2012-01-23 01:30:30 +0000
@@ -1,5 +1,6 @@
'''Reactor utilities.'''
+
def get_exitcode_reactor():
"""
This is only neccesary until a fix like the one outlined here is
=== modified file 'txaws/s3/client.py'
--- txaws/s3/client.py 2012-01-06 00:00:22 +0000
+++ txaws/s3/client.py 2012-01-23 01:30:30 +0000
@@ -61,7 +61,8 @@
def get_url(self):
if self.endpoint.port is not None:
return "%s://%s:%d%s" % (
- self.endpoint.scheme, self.get_host(), self.endpoint.port, self.get_path())
+ self.endpoint.scheme, self.get_host(), self.endpoint.port,
+ self.get_path())
else:
return "%s://%s%s" % (
self.endpoint.scheme, self.get_host(), self.get_path())
=== modified file 'txaws/s3/tests/test_acls.py'
--- txaws/s3/tests/test_acls.py 2011-03-26 12:50:41 +0000
+++ txaws/s3/tests/test_acls.py 2012-01-23 01:30:30 +0000
@@ -22,7 +22,8 @@
display_name='BucketOwnersEmail@xxxxxxxxxx')
xml_bytes = grantee.to_xml()
self.assertEquals(xml_bytes, """\
-<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
+<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
+ xsi:type="CanonicalUser">
<ID>8a6925ce4adf588a4f21c32aa379004fef</ID>
<DisplayName>BucketOwnersEmail@xxxxxxxxxx</DisplayName>
</Grantee>
@@ -35,7 +36,8 @@
xml_bytes = grant.to_xml()
self.assertEquals(xml_bytes, """\
<Grant>
- <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
+ <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
+ xsi:type="CanonicalUser">
<ID>8a6925ce4adf588a4f21c32aa379004fef</ID>
<DisplayName>BucketOwnersEmail@xxxxxxxxxx</DisplayName>
</Grantee>
=== modified file 'txaws/s3/tests/test_client.py'
--- txaws/s3/tests/test_client.py 2012-01-06 09:51:07 +0000
+++ txaws/s3/tests/test_client.py 2012-01-23 01:30:30 +0000
@@ -63,7 +63,7 @@
"http://localhost/mydocs/notes.txt")
def test_custom_port_endpoint(self):
- test_uri='http://0.0.0.0:12345/'
+ test_uri = 'http://0.0.0.0:12345/'
endpoint = AWSServiceEndpoint(uri=test_uri)
self.assertEquals(endpoint.port, 12345)
self.assertEquals(endpoint.scheme, 'http')
@@ -74,7 +74,7 @@
self.assertEquals(context.get_url(), test_uri + 'foo/bar')
def test_custom_port_endpoint_https(self):
- test_uri='https://0.0.0.0:12345/'
+ test_uri = 'https://0.0.0.0:12345/'
endpoint = AWSServiceEndpoint(uri=test_uri)
self.assertEquals(endpoint.port, 12345)
self.assertEquals(endpoint.scheme, 'https')
=== modified file 'txaws/server/tests/fixtures/amodule.py'
--- txaws/server/tests/fixtures/amodule.py 2011-08-28 20:45:42 +0000
+++ txaws/server/tests/fixtures/amodule.py 2012-01-23 01:30:30 +0000
@@ -1,6 +1,7 @@
from txaws.server.tests.fixtures import method
from txaws.server.method import Method
+
@method
class TestMethod(Method):
pass
=== modified file 'txaws/server/tests/fixtures/importerror/amodule.py'
--- txaws/server/tests/fixtures/importerror/amodule.py 2011-08-28 20:45:42 +0000
+++ txaws/server/tests/fixtures/importerror/amodule.py 2012-01-23 01:30:30 +0000
@@ -1,5 +1,6 @@
from txaws.server.method import Method
-from txaws.server.tests.fixtures import method
+from txaws.server.tests.fixtures import method
+
@method
class TestMethod(Method):
=== modified file 'txaws/server/tests/test_exception.py'
--- txaws/server/tests/test_exception.py 2011-12-01 14:19:12 +0000
+++ txaws/server/tests/test_exception.py 2012-01-23 01:30:30 +0000
@@ -54,7 +54,7 @@
def test_with_unicode_message(self):
"""
- L{APIError} will convert message to plain ASCII if converted to string.
+ L{APIError} will convert message to plain ASCII if converted to string.
"""
error = APIError(400, code="APIError", message=u"cittá")
self.assertEqual(u"cittá", error.message)
=== modified file 'txaws/server/tests/test_registry.py'
--- txaws/server/tests/test_registry.py 2011-08-28 20:36:04 +0000
+++ txaws/server/tests/test_registry.py 2012-01-23 01:30:30 +0000
@@ -98,6 +98,7 @@
deal with scanning errors.
"""
swallowed = []
+
def swallow(error):
swallowed.append(error)
=== modified file 'txaws/server/tests/test_schema.py'
--- txaws/server/tests/test_schema.py 2012-01-06 01:01:10 +0000
+++ txaws/server/tests/test_schema.py 2012-01-23 01:30:30 +0000
@@ -328,7 +328,7 @@
"""
parameter = Date("Test")
date = datetime(2010, 9, 15, 23, 59, 59,
- tzinfo=tzoffset('UTC', 120*60))
+ tzinfo=tzoffset('UTC', 120 * 60))
self.assertEqual("2010-09-15T21:59:59Z", parameter.format(date))
=== modified file 'txaws/testing/base.py'
--- txaws/testing/base.py 2010-06-04 19:00:25 +0000
+++ txaws/testing/base.py 2012-01-23 01:30:30 +0000
@@ -24,4 +24,3 @@
for key in set(os.environ) - set(self.orig_environ):
del os.environ[key]
os.environ.update(self.orig_environ)
-
=== modified file 'txaws/testing/payload.py'
--- txaws/testing/payload.py 2011-08-29 19:51:50 +0000
+++ txaws/testing/payload.py 2012-01-23 01:30:30 +0000
@@ -22,7 +22,8 @@
<code>16</code>
<name>running</name>
</instanceState>
- <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal</privateDnsName>
+ <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal\
+</privateDnsName>
<dnsName>ec2-75-101-245-65.compute-1.amazonaws.com</dnsName>
<instanceType>c1.xlarge</instanceType>
<launchTime>2009-04-27T02:23:18.000Z</launchTime>
@@ -58,7 +59,8 @@
<code>16</code>
<name>running</name>
</instanceState>
- <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal</privateDnsName>
+ <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal\
+</privateDnsName>
<dnsName>ec2-75-101-245-65.compute-1.amazonaws.com</dnsName>
<reason/>
<keyName>keyname</keyName>
@@ -494,7 +496,8 @@
<Errors>
<Error>
<Code>InvalidGroup.InUse</Code>
- <Message>Group groupID1:GroupReferredTo is used by groups: groupID2:UsingGroup</Message>
+ <Message>Group groupID1:GroupReferredTo is used by groups: \
+groupID2:UsingGroup</Message>
</Error>
</Errors>
<RequestID>9a6df05f-9c27-47aa-81d8-6619689210cc</RequestID>
@@ -503,7 +506,8 @@
sample_authorize_security_group = """\
-<AuthorizeSecurityGroupIngressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
+<AuthorizeSecurityGroupIngressResponse\
+ xmlns="http://ec2.amazonaws.com/doc/%s/">
<return>true</return>
</AuthorizeSecurityGroupIngressResponse>
""" % (version.ec2_api,)
@@ -650,7 +654,8 @@
<keySet>
<item>
<keyName>gsg-keypair</keyName>
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
+ <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
+ca:9f:f5:f1:6f</keyFingerprint>
</item>
</keySet>
</DescribeKeyPairsResponse>
@@ -663,11 +668,13 @@
<keySet>
<item>
<keyName>gsg-keypair-1</keyName>
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
+ <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
+ca:9f:f5:f1:6f</keyFingerprint>
</item>
<item>
<keyName>gsg-keypair-2</keyName>
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:70</keyFingerprint>
+ <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
+ca:9f:f5:f1:70</keyFingerprint>
</item>
</keySet>
</DescribeKeyPairsResponse>
@@ -678,7 +685,8 @@
<?xml version="1.0"?>
<CreateKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
<keyName>example-key-name</keyName>
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
+ <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
+ca:9f:f5:f1:6f</keyFingerprint>
<keyMaterial>-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp
HungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg
@@ -747,7 +755,8 @@
<?xml version="1.0"?>
<ImportKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
<keyName>example-key-name</keyName>
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
+ <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
+ca:9f:f5:f1:6f</keyFingerprint>
</ImportKeyPairResponse>
""" % (version.ec2_api,)
@@ -837,7 +846,8 @@
<Errors>
<Error>
<Code>InvalidClientTokenId</Code>
- <Message>The AWS Access Key Id you provided does not exist in our records.</Message>
+ <Message>The AWS Access Key Id you provided does not exist in our\
+ records.</Message>
</Error>
</Errors>
<RequestID>47bfd77d-78d6-446d-be0d-f7621795dded</RequestID>
@@ -865,7 +875,8 @@
<Code>InternalError</Code>
<Message>We encountered an internal error. Please try again.</Message>
<RequestID>A2A7E5395E27DFBB</RequestID>
- <HostID>f691zulHNsUqonsZkjhILnvWwD3ZnmOM4ObM1wXTc6xuS3GzPmjArp8QC/sGsn6K</HostID>
+ <HostID>f691zulHNsUqonsZkjhILnvWwD3ZnmOM4ObM1wXTc6xuS3GzPmjArp8QC/sGsn6K\
+</HostID>
</Error>
"""
@@ -926,7 +937,8 @@
sample_get_bucket_location_result = """\
-<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">EU</LocationConstraint>
+<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">EU\
+</LocationConstraint>
"""
sample_request_payment = """\
@@ -940,12 +952,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SignatureDoesNotMatch</Code>
- <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
- <StringToSignBytes>47 45 54 0a 31 42 32 4d 32 59 38 41 73 67 54 70 67 41 6d 59 37 50 68 43 66 67 3d 3d 0a 0a 54 68 75 2c 20 30 35 20 4e 6f 76 20 32 30 30 39 20 32 31 3a 33 33 3a 32 39 20 47 4d 54 0a 2f</StringToSignBytes>
+ <Message>The request signature we calculated does not match the signature\
+ you provided. Check your key and signing method.</Message>
+ <StringToSignBytes>47 45 54 0a 31 42 32 4d 32 59 38 41 73 67 54 70 67 41 6d\
+ 59 37 50 68 43 66 67 3d 3d 0a 0a 54 68 75 2c 20 30 35 20 4e 6f 76 20 32 30\
+ 30 39 20 32 31 3a 33 33 3a 32 39 20 47 4d 54 0a 2f</StringToSignBytes>
<RequestId>AB9216C8640751B2</RequestId>
- <HostId>sAPBpmFdsOsgUUwtSLsiT6KIwP1mPbmrYY0xUoahzJE263qmABkTaqzGhHddgOq5</HostId>
- <SignatureProvided>ltowhdrbjaQ8dQc9VS5MxzJfsPJZi0BZHEzJC3r9pzU=</SignatureProvided>
- <StringToSign>GET\n1B2M2Y8AsgTpgAmY7PhCfg==\n\nThu, 05 Nov 2009 21:33:29 GMT\n/</StringToSign>
+ <HostId>sAPBpmFdsOsgUUwtSLsiT6KIwP1mPbmrYY0xUoahzJE263qmABkTaqzGhHddgOq5\
+</HostId>
+ <SignatureProvided>ltowhdrbjaQ8dQc9VS5MxzJfsPJZi0BZHEzJC3r9pzU=
+</SignatureProvided>
+ <StringToSign>GET\n1B2M2Y8AsgTpgAmY7PhCfg==\n\nThu, 05 Nov 2009 21:33:29\
+ GMT\n/</StringToSign>
<AWSAccessKeyId>SOMEKEYID</AWSAccessKeyId>
</Error>
"""
@@ -955,9 +973,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>InvalidAccessKeyId</Code>
- <Message>The AWS Access Key Id you provided does not exist in our records.</Message>
+ <Message>The AWS Access Key Id you provided does not exist in our records.\
+</Message>
<RequestId>0223AD81A94821CE</RequestId>
- <HostId>HAw5g9P1VkN8ztgLKFTK20CY5LmCfTwXcSths1O7UQV6NuJx2P4tmFnpuOsziwOE</HostId>
+ <HostId>HAw5g9P1VkN8ztgLKFTK20CY5LmCfTwXcSths1O7UQV6NuJx2P4tmFnpuOsziwOE\
+</HostId>
<AWSAccessKeyId>SOMEKEYID</AWSAccessKeyId>
</Error>
"""
@@ -970,14 +990,16 @@
</Owner>
<AccessControlList>
<Grant>
- <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
+ <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
+ xsi:type="CanonicalUser">
<ID>8a6925ce4adf588a4f21c32aa379004fef</ID>
<DisplayName>foo@xxxxxxxxxxx</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
- <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
+ <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
+ xsi:type="CanonicalUser">
<ID>8a6925ce4adf588a4f21c32aa37900feed</ID>
<DisplayName>bar@xxxxxxxxxxx</DisplayName>
</Grantee>
@@ -985,4 +1007,3 @@
</Grant>
</AccessControlList>
</AccessControlPolicy>"""
-
=== modified file 'txaws/tests/__init__.py'
--- txaws/tests/__init__.py 2009-08-28 02:32:44 +0000
+++ txaws/tests/__init__.py 2012-01-23 01:30:30 +0000
@@ -1,1 +0,0 @@
-
=== modified file 'txaws/tests/test_util.py'
--- txaws/tests/test_util.py 2009-11-19 16:33:05 +0000
+++ txaws/tests/test_util.py 2012-01-23 01:30:30 +0000
@@ -4,6 +4,7 @@
from txaws.util import hmac_sha1, iso8601time, parse
+
class MiscellaneousTests(TestCase):
def test_hmac_sha1(self):
@@ -20,8 +21,8 @@
self.assertEqual(hmac_sha1(key, data), expected)
def test_iso8601time(self):
- self.assertEqual("2006-07-07T15:04:56Z", iso8601time((2006,7,7,15,4,56,
- 0, 0, 0)))
+ self.assertEqual("2006-07-07T15:04:56Z",
+ iso8601time((2006, 7, 7, 15, 4, 56, 0, 0, 0)))
class ParseUrlTestCase(TestCase):