diff options
98 files changed, 372 insertions, 357 deletions
diff --git a/boto/auth.py b/boto/auth.py index 2192bc47..0f8b10ce 100644 --- a/boto/auth.py +++ b/boto/auth.py @@ -109,7 +109,7 @@ class AnonAuthHandler(AuthHandler, HmacKeys): capability = ['anon'] def __init__(self, host, config, provider): - AuthHandler.__init__(self, host, config, provider) + super(AnonAuthHandler, self).__init__(host, config, provider) def add_auth(self, http_request, **kwargs): pass diff --git a/boto/beanstalk/layer1.py b/boto/beanstalk/layer1.py index fc8ca83f..f70a6b28 100644 --- a/boto/beanstalk/layer1.py +++ b/boto/beanstalk/layer1.py @@ -45,7 +45,7 @@ class Layer1(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(Layer1, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, @@ -1116,7 +1116,7 @@ class Layer1(AWSQueryConnection): :type tier_version: string :type tier_version: The version of the tier. Valid values currently are "1.0". Defaults to "1.0". - + :raises: InsufficientPrivilegesException """ params = {} diff --git a/boto/cloudformation/connection.py b/boto/cloudformation/connection.py index 5970225f..5e6325d5 100644 --- a/boto/cloudformation/connection.py +++ b/boto/cloudformation/connection.py @@ -57,7 +57,7 @@ class CloudFormationConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint, CloudFormationConnection) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(CloudFormationConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/cloudfront/__init__.py b/boto/cloudfront/__init__.py index 9888f50f..0fa4ae81 100644 --- a/boto/cloudfront/__init__.py +++ b/boto/cloudfront/__init__.py @@ -44,7 +44,7 @@ class CloudFrontConnection(AWSAuthConnection): port=None, proxy=None, proxy_port=None, host=DefaultHost, debug=0, security_token=None, validate_certs=True): - AWSAuthConnection.__init__(self, host, + super(CloudFrontConnection, self).__init__(host, aws_access_key_id, aws_secret_access_key, True, port, proxy, proxy_port, debug=debug, security_token=security_token, diff --git a/boto/cloudfront/distribution.py b/boto/cloudfront/distribution.py index 423cb201..9992ab6f 100644 --- a/boto/cloudfront/distribution.py +++ b/boto/cloudfront/distribution.py @@ -176,7 +176,7 @@ class StreamingDistributionConfig(DistributionConfig): def __init__(self, connection=None, origin='', enabled=False, caller_reference='', cnames=None, comment='', trusted_signers=None, logging=None): - DistributionConfig.__init__(self, connection=connection, + super(StreamingDistributionConfig, self).__init__(connection=connection, origin=origin, enabled=enabled, caller_reference=caller_reference, cnames=cnames, comment=comment, @@ -684,8 +684,8 @@ class StreamingDistribution(Distribution): def __init__(self, connection=None, config=None, domain_name='', id='', last_modified_time=None, status=''): - Distribution.__init__(self, connection, config, domain_name, - id, last_modified_time, status) + super(StreamingDistribution, self).__init__(connection, config, + domain_name, id, last_modified_time, status) self._object_class = StreamingObject def startElement(self, name, attrs, connection): @@ -693,7 +693,8 @@ class StreamingDistribution(Distribution): self.config = StreamingDistributionConfig() return self.config else: - return Distribution.startElement(self, name, attrs, connection) + return super(StreamingDistribution, self).startElement(name, attrs, + connection) def update(self, enabled=None, cnames=None, comment=None): """ diff --git a/boto/cloudfront/object.py b/boto/cloudfront/object.py index 3574d136..24fc8506 100644 --- a/boto/cloudfront/object.py +++ b/boto/cloudfront/object.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -24,7 +24,7 @@ from boto.s3.key import Key class Object(Key): def __init__(self, bucket, name=None): - Key.__init__(self, bucket, name=name) + super(Object, self).__init__(bucket, name=name) self.distribution = bucket.distribution def __repr__(self): @@ -43,6 +43,6 @@ class Object(Key): class StreamingObject(Object): def url(self, scheme='rtmp'): - return Object.url(self, scheme) + return super(StreamingObject, self).url(scheme) + - diff --git a/boto/cloudtrail/layer1.py b/boto/cloudtrail/layer1.py index 1ee41d4a..d75fab8d 100644 --- a/boto/cloudtrail/layer1.py +++ b/boto/cloudtrail/layer1.py @@ -90,7 +90,7 @@ class CloudTrailConnection(AWSQueryConnection): if 'host' not in kwargs: kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(CloudTrailConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/connection.py b/boto/connection.py index a7edf6a8..592a0098 100644 --- a/boto/connection.py +++ b/boto/connection.py @@ -888,7 +888,7 @@ class AWSAuthConnection(object): # not include the port. if 's3' not in self._required_auth_capability(): self.set_host_header(request) - + if callable(sender): response = sender(connection, request.method, request.path, request.body, request.headers) @@ -1034,7 +1034,7 @@ class AWSQueryConnection(AWSAuthConnection): proxy_user=None, proxy_pass=None, host=None, debug=0, https_connection_factory=None, path='/', security_token=None, validate_certs=True): - AWSAuthConnection.__init__(self, host, aws_access_key_id, + super(AWSQueryConnection, self).__init__(host, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/contrib/ymlmessage.py b/boto/contrib/ymlmessage.py index b9a2c932..6f3dd20c 100644 --- a/boto/contrib/ymlmessage.py +++ b/boto/contrib/ymlmessage.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -43,7 +43,7 @@ class YAMLMessage(Message): def __init__(self, queue=None, body='', xml_attrs=None): self.data = None - Message.__init__(self, queue, body) + super(YAMLMessage, self).__init__(queue, body) def set_body(self, body): self.data = yaml.load(body) diff --git a/boto/datapipeline/layer1.py b/boto/datapipeline/layer1.py index ff0c4004..0d904352 100644 --- a/boto/datapipeline/layer1.py +++ b/boto/datapipeline/layer1.py @@ -90,7 +90,7 @@ class DataPipelineConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(DataPipelineConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/directconnect/layer1.py b/boto/directconnect/layer1.py index b6a87699..b225e18e 100644 --- a/boto/directconnect/layer1.py +++ b/boto/directconnect/layer1.py @@ -79,7 +79,7 @@ class DirectConnectConnection(AWSQueryConnection): if 'host' not in kwargs: kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(DirectConnectConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/dynamodb/layer1.py b/boto/dynamodb/layer1.py index 95c96a77..ca11ca43 100644 --- a/boto/dynamodb/layer1.py +++ b/boto/dynamodb/layer1.py @@ -84,7 +84,7 @@ class Layer1(AWSAuthConnection): break self.region = region - AWSAuthConnection.__init__(self, self.region.endpoint, + super(Layer1, self).__init__(self.region.endpoint, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, diff --git a/boto/dynamodb2/layer1.py b/boto/dynamodb2/layer1.py index 0555107a..44dadecb 100644 --- a/boto/dynamodb2/layer1.py +++ b/boto/dynamodb2/layer1.py @@ -75,7 +75,7 @@ class DynamoDBConnection(AWSQueryConnection): if 'host' not in kwargs: kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(DynamoDBConnection, self).__init__(**kwargs) self.region = region self._validate_checksums = boto.config.getbool( 'DynamoDB', 'validate_checksums', validate_checksums) diff --git a/boto/ec2/address.py b/boto/ec2/address.py index 27608a4a..3b82d115 100644 --- a/boto/ec2/address.py +++ b/boto/ec2/address.py @@ -37,7 +37,7 @@ class Address(EC2Object): """ def __init__(self, connection=None, public_ip=None, instance_id=None): - EC2Object.__init__(self, connection) + super(Address, self).__init__(connection) self.connection = connection self.public_ip = public_ip self.instance_id = instance_id diff --git a/boto/ec2/autoscale/__init__.py b/boto/ec2/autoscale/__init__.py index ad152069..819a8610 100644 --- a/boto/ec2/autoscale/__init__.py +++ b/boto/ec2/autoscale/__init__.py @@ -114,7 +114,7 @@ class AutoScaleConnection(AWSQueryConnection): self.DefaultRegionEndpoint, AutoScaleConnection) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(AutoScaleConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/ec2/bundleinstance.py b/boto/ec2/bundleinstance.py index 96519921..1bb4dd16 100644 --- a/boto/ec2/bundleinstance.py +++ b/boto/ec2/bundleinstance.py @@ -14,21 +14,21 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. """ -Represents an EC2 Bundle Task +Represents an EC2 Bundle Task """ from boto.ec2.ec2object import EC2Object class BundleInstanceTask(EC2Object): - + def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(BundleInstanceTask, self).__init__(connection) self.id = None self.instance_id = None self.progress = None @@ -38,7 +38,7 @@ class BundleInstanceTask(EC2Object): self.prefix = None self.upload_policy = None self.upload_policy_signature = None - self.update_time = None + self.update_time = None self.code = None self.message = None diff --git a/boto/ec2/cloudwatch/__init__.py b/boto/ec2/cloudwatch/__init__.py index 646f71e9..975bc4c7 100644 --- a/boto/ec2/cloudwatch/__init__.py +++ b/boto/ec2/cloudwatch/__init__.py @@ -107,7 +107,7 @@ class CloudWatchConnection(AWSQueryConnection): if self.region.name == 'eu-west-1': validate_certs = False - AWSQueryConnection.__init__(self, aws_access_key_id, + super(CloudWatchConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/ec2/connection.py b/boto/ec2/connection.py index e0d452ab..366207e3 100644 --- a/boto/ec2/connection.py +++ b/boto/ec2/connection.py @@ -91,7 +91,7 @@ class EC2Connection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(EC2Connection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/ec2/ec2object.py b/boto/ec2/ec2object.py index 265678c6..f697e664 100644 --- a/boto/ec2/ec2object.py +++ b/boto/ec2/ec2object.py @@ -53,7 +53,7 @@ class TaggedEC2Object(EC2Object): """ def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(TaggedEC2Object, self).__init__(connection) self.tags = TagSet() def startElement(self, name, attrs, connection): diff --git a/boto/ec2/elb/__init__.py b/boto/ec2/elb/__init__.py index 4b6c4e24..1fc08fa5 100644 --- a/boto/ec2/elb/__init__.py +++ b/boto/ec2/elb/__init__.py @@ -102,7 +102,7 @@ class ELBConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(ELBConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/ec2/image.py b/boto/ec2/image.py index cc7e8349..ade4a67c 100644 --- a/boto/ec2/image.py +++ b/boto/ec2/image.py @@ -47,7 +47,7 @@ class Image(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(Image, self).__init__(connection) self.id = None self.location = None self.state = None @@ -75,7 +75,7 @@ class Image(TaggedEC2Object): return 'Image:%s' % self.id def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(Image, self).startElement(name, attrs, connection) if retval is not None: return retval if name == 'blockDeviceMapping': diff --git a/boto/ec2/instance.py b/boto/ec2/instance.py index 241fa234..eb7c9ec6 100644 --- a/boto/ec2/instance.py +++ b/boto/ec2/instance.py @@ -122,7 +122,7 @@ class Reservation(EC2Object): Reservation. """ def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(Reservation, self).__init__(connection) self.id = None self.owner_id = None self.groups = [] @@ -211,7 +211,7 @@ class Instance(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(Instance, self).__init__(connection) self.id = None self.dns_name = None self.public_dns_name = None @@ -288,7 +288,7 @@ class Instance(TaggedEC2Object): return self._placement.tenancy def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(Instance, self).startElement(name, attrs, connection) if retval is not None: return retval if name == 'monitoring': diff --git a/boto/ec2/keypair.py b/boto/ec2/keypair.py index c15a0984..9323c24a 100644 --- a/boto/ec2/keypair.py +++ b/boto/ec2/keypair.py @@ -30,7 +30,7 @@ from boto.exception import BotoClientError class KeyPair(EC2Object): def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(KeyPair, self).__init__(connection) self.name = None self.fingerprint = None self.material = None diff --git a/boto/ec2/launchspecification.py b/boto/ec2/launchspecification.py index 037a8b09..f145ac47 100644 --- a/boto/ec2/launchspecification.py +++ b/boto/ec2/launchspecification.py @@ -44,7 +44,7 @@ class GroupList(list): class LaunchSpecification(EC2Object): def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(LaunchSpecification, self).__init__(connection) self.key_name = None self.instance_type = None self.image_id = None diff --git a/boto/ec2/networkinterface.py b/boto/ec2/networkinterface.py index 98368050..b786edb6 100644 --- a/boto/ec2/networkinterface.py +++ b/boto/ec2/networkinterface.py @@ -99,7 +99,7 @@ class NetworkInterface(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(NetworkInterface, self).__init__(connection) self.id = None self.subnet_id = None self.vpc_id = None @@ -119,7 +119,8 @@ class NetworkInterface(TaggedEC2Object): return 'NetworkInterface:%s' % self.id def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(NetworkInterface, self).startElement(name, attrs, + connection) if retval is not None: return retval if name == 'groupSet': diff --git a/boto/ec2/placementgroup.py b/boto/ec2/placementgroup.py index 79bd4c46..65e32844 100644 --- a/boto/ec2/placementgroup.py +++ b/boto/ec2/placementgroup.py @@ -27,7 +27,7 @@ from boto.exception import BotoClientError class PlacementGroup(EC2Object): def __init__(self, connection=None, name=None, strategy=None, state=None): - EC2Object.__init__(self, connection) + super(PlacementGroup, self).__init__(connection) self.name = name self.strategy = strategy self.state = state diff --git a/boto/ec2/regioninfo.py b/boto/ec2/regioninfo.py index 0b37b0ee..1b6c6ad9 100644 --- a/boto/ec2/regioninfo.py +++ b/boto/ec2/regioninfo.py @@ -16,7 +16,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -27,8 +27,8 @@ class EC2RegionInfo(RegionInfo): """ Represents an EC2 Region """ - + def __init__(self, connection=None, name=None, endpoint=None): from boto.ec2.connection import EC2Connection - RegionInfo.__init__(self, connection, name, endpoint, + super(EC2RegionInfo, self).__init__(connection, name, endpoint, EC2Connection) diff --git a/boto/ec2/reservedinstance.py b/boto/ec2/reservedinstance.py index 1386c414..b76aaa87 100644 --- a/boto/ec2/reservedinstance.py +++ b/boto/ec2/reservedinstance.py @@ -31,7 +31,7 @@ class ReservedInstancesOffering(EC2Object): usage_price=None, description=None, instance_tenancy=None, currency_code=None, offering_type=None, recurring_charges=None, pricing_details=None): - EC2Object.__init__(self, connection) + super(ReservedInstancesOffering, self).__init__(connection) self.id = id self.instance_type = instance_type self.availability_zone = availability_zone @@ -128,9 +128,10 @@ class ReservedInstance(ReservedInstancesOffering): availability_zone=None, duration=None, fixed_price=None, usage_price=None, description=None, instance_count=None, state=None): - ReservedInstancesOffering.__init__(self, connection, id, instance_type, - availability_zone, duration, fixed_price, - usage_price, description) + super(ReservedInstance, self).__init__(connection, id, instance_type, + availability_zone, duration, + fixed_price, usage_price, + description) self.instance_count = instance_count self.state = state self.start = None @@ -148,7 +149,7 @@ class ReservedInstance(ReservedInstancesOffering): elif name == 'start': self.start = value else: - ReservedInstancesOffering.endElement(self, name, value, connection) + super(ReservedInstance, self).endElement(name, value, connection) class ReservedInstanceListing(EC2Object): diff --git a/boto/ec2/securitygroup.py b/boto/ec2/securitygroup.py index 9f437ebb..5674f4e9 100644 --- a/boto/ec2/securitygroup.py +++ b/boto/ec2/securitygroup.py @@ -31,7 +31,7 @@ class SecurityGroup(TaggedEC2Object): def __init__(self, connection=None, owner_id=None, name=None, description=None, id=None): - TaggedEC2Object.__init__(self, connection) + super(SecurityGroup, self).__init__(connection) self.id = id self.owner_id = owner_id self.name = name @@ -44,7 +44,8 @@ class SecurityGroup(TaggedEC2Object): return 'SecurityGroup:%s' % self.name def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(SecurityGroup, self).startElement(name, attrs, + connection) if retval is not None: return retval if name == 'ipPermissions': diff --git a/boto/ec2/snapshot.py b/boto/ec2/snapshot.py index 38999e25..6121d0c8 100644 --- a/boto/ec2/snapshot.py +++ b/boto/ec2/snapshot.py @@ -31,7 +31,7 @@ class Snapshot(TaggedEC2Object): AttrName = 'createVolumePermission' def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(Snapshot, self).__init__(connection) self.id = None self.volume_id = None self.status = None diff --git a/boto/ec2/spotdatafeedsubscription.py b/boto/ec2/spotdatafeedsubscription.py index 1b30a99f..26ef7adc 100644 --- a/boto/ec2/spotdatafeedsubscription.py +++ b/boto/ec2/spotdatafeedsubscription.py @@ -29,7 +29,7 @@ class SpotDatafeedSubscription(EC2Object): def __init__(self, connection=None, owner_id=None, bucket=None, prefix=None, state=None,fault=None): - EC2Object.__init__(self, connection) + super(SpotDatafeedSubscription, self).__init__(connection) self.owner_id = owner_id self.bucket = bucket self.prefix = prefix diff --git a/boto/ec2/spotinstancerequest.py b/boto/ec2/spotinstancerequest.py index c5b8bc95..da087fef 100644 --- a/boto/ec2/spotinstancerequest.py +++ b/boto/ec2/spotinstancerequest.py @@ -120,7 +120,7 @@ class SpotInstanceRequest(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(SpotInstanceRequest, self).__init__(connection) self.id = None self.price = None self.type = None @@ -141,7 +141,8 @@ class SpotInstanceRequest(TaggedEC2Object): return 'SpotInstanceRequest:%s' % self.id def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(SpotInstanceRequest, self).startElement(name, attrs, + connection) if retval is not None: return retval if name == 'launchSpecification': diff --git a/boto/ec2/spotpricehistory.py b/boto/ec2/spotpricehistory.py index 268d6b35..7bd0ce89 100644 --- a/boto/ec2/spotpricehistory.py +++ b/boto/ec2/spotpricehistory.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -26,9 +26,9 @@ Represents an EC2 Spot Instance Request from boto.ec2.ec2object import EC2Object class SpotPriceHistory(EC2Object): - + def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(SpotPriceHistory, self).__init__(connection) self.price = 0.0 self.instance_type = None self.product_description = None diff --git a/boto/ec2/vmtype.py b/boto/ec2/vmtype.py index fdb4f369..1ffbc191 100644 --- a/boto/ec2/vmtype.py +++ b/boto/ec2/vmtype.py @@ -35,7 +35,7 @@ class VmType(EC2Object): def __init__(self, connection=None, name=None, cores=None, memory=None, disk=None): - EC2Object.__init__(self, connection) + super(VmType, self).__init__(connection) self.connection = connection self.name = name self.cores = cores diff --git a/boto/ec2/volume.py b/boto/ec2/volume.py index a084f647..95121fa8 100644 --- a/boto/ec2/volume.py +++ b/boto/ec2/volume.py @@ -47,7 +47,7 @@ class Volume(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(Volume, self).__init__(connection) self.id = None self.create_time = None self.status = None @@ -62,7 +62,7 @@ class Volume(TaggedEC2Object): return 'Volume:%s' % self.id def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(Volume, self).startElement(name, attrs, connection) if retval is not None: return retval if name == 'attachmentSet': diff --git a/boto/ec2/zone.py b/boto/ec2/zone.py index 44068d4d..725d1769 100644 --- a/boto/ec2/zone.py +++ b/boto/ec2/zone.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -38,7 +38,7 @@ class MessageSet(list): self.append(value) else: setattr(self, name, value) - + class Zone(EC2Object): """ Represents an Availability Zone. @@ -48,9 +48,9 @@ class Zone(EC2Object): :ivar region_name: The name of the region the zone is associated with. :ivar messages: A list of messages related to the zone. """ - + def __init__(self, connection=None): - EC2Object.__init__(self, connection) + super(Zone, self).__init__(connection) self.name = None self.state = None self.region_name = None @@ -64,7 +64,7 @@ class Zone(EC2Object): self.messages = MessageSet() return self.messages return None - + def endElement(self, name, value, connection): if name == 'zoneName': self.name = value diff --git a/boto/ecs/__init__.py b/boto/ecs/__init__.py index cbaf478a..f39ec5a5 100644 --- a/boto/ecs/__init__.py +++ b/boto/ecs/__init__.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -42,7 +42,7 @@ class ECSConnection(AWSQueryConnection): is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, host='ecs.amazonaws.com', debug=0, https_connection_factory=None, path='/'): - AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_key, + super(ECSConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, host, debug, https_connection_factory, path) @@ -77,13 +77,13 @@ class ECSConnection(AWSQueryConnection): # # Group methods # - + def item_search(self, search_index, **params): """ - Returns items that satisfy the search criteria, including one or more search + Returns items that satisfy the search criteria, including one or more search indices. - For a full list of search terms, + For a full list of search terms, :see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/DG/index.html?ItemSearch.html """ params['SearchIndex'] = search_index diff --git a/boto/ecs/item.py b/boto/ecs/item.py index 29588b86..d0cdb990 100644 --- a/boto/ecs/item.py +++ b/boto/ecs/item.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -26,7 +26,7 @@ from StringIO import StringIO class ResponseGroup(xml.sax.ContentHandler): """A Generic "Response Group", which can - be anything from the entire list of Items to + be anything from the entire list of Items to specific response elements within an item""" def __init__(self, connection=None, nodename=None): @@ -45,7 +45,7 @@ class ResponseGroup(xml.sax.ContentHandler): # def get(self, name): return self.__dict__.get(name) - + def set(self, name, value): self.__dict__[name] = value @@ -90,14 +90,14 @@ class Item(ResponseGroup): def __init__(self, connection=None): """Initialize this Item""" - ResponseGroup.__init__(self, connection, "Item") + super(Item, self).__init__(connection, "Item") class ItemSet(ResponseGroup): """A special ResponseGroup that has built-in paging, and only creates new Items on the "Item" tag""" def __init__(self, connection, action, params, page=0): - ResponseGroup.__init__(self, connection, "Items") + super(ItemSet, self).__init__(connection, "Items") self.objs = [] self.iter = None self.page = page @@ -150,4 +150,4 @@ class ItemSet(ResponseGroup): """Override to first fetch everything""" for item in self: pass - return ResponseGroup.to_xml(self) + return super(ItemSet, self).to_xml() diff --git a/boto/elasticache/layer1.py b/boto/elasticache/layer1.py index 44cba974..be7080d0 100644 --- a/boto/elasticache/layer1.py +++ b/boto/elasticache/layer1.py @@ -55,7 +55,7 @@ class ElastiCacheConnection(AWSQueryConnection): else: del kwargs['region'] kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(ElastiCacheConnection, self).__init__(**kwargs) self.region = region diff --git a/boto/elastictranscoder/layer1.py b/boto/elastictranscoder/layer1.py index 8799753c..4052e01b 100644 --- a/boto/elastictranscoder/layer1.py +++ b/boto/elastictranscoder/layer1.py @@ -55,7 +55,7 @@ class ElasticTranscoderConnection(AWSAuthConnection): else: del kwargs['region'] kwargs['host'] = region.endpoint - AWSAuthConnection.__init__(self, **kwargs) + super(ElasticTranscoderConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): @@ -528,7 +528,7 @@ class ElasticTranscoderConnection(AWSAuthConnection): The ListPipelines operation gets a list of the pipelines associated with the current AWS account. - + """ uri = '/2012-09-25/pipelines' return self.make_request('GET', uri, expected_status=200) @@ -539,7 +539,7 @@ class ElasticTranscoderConnection(AWSAuthConnection): included with Elastic Transcoder and the presets that you've added in an AWS region. - + """ uri = '/2012-09-25/presets' return self.make_request('GET', uri, expected_status=200) diff --git a/boto/emr/connection.py b/boto/emr/connection.py index 9ec5b569..e7b5b747 100644 --- a/boto/emr/connection.py +++ b/boto/emr/connection.py @@ -60,7 +60,7 @@ class EmrConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(EmrConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/emr/step.py b/boto/emr/step.py index b17defbd..4cb78898 100644 --- a/boto/emr/step.py +++ b/boto/emr/step.py @@ -204,7 +204,7 @@ class ScriptRunnerStep(JarStep): ScriptRunnerJar = 's3n://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar' def __init__(self, name, **kw): - JarStep.__init__(self, name, self.ScriptRunnerJar, **kw) + super(ScriptRunnerStep, self).__init__(name, self.ScriptRunnerJar, **kw) class PigBase(ScriptRunnerStep): @@ -225,7 +225,7 @@ class InstallPigStep(PigBase): step_args.extend(self.BaseArgs) step_args.extend(['--install-pig']) step_args.extend(['--pig-versions', pig_versions]) - ScriptRunnerStep.__init__(self, self.InstallPigName, step_args=step_args) + super(InstallPigStep, self).__init__(self.InstallPigName, step_args=step_args) class PigStep(PigBase): @@ -239,7 +239,7 @@ class PigStep(PigBase): step_args.extend(['--pig-versions', pig_versions]) step_args.extend(['--run-pig-script', '--args', '-f', pig_file]) step_args.extend(pig_args) - ScriptRunnerStep.__init__(self, name, step_args=step_args) + super(PigStep, self).__init__(name, step_args=step_args) class HiveBase(ScriptRunnerStep): @@ -261,7 +261,7 @@ class InstallHiveStep(HiveBase): step_args.extend(['--hive-versions', hive_versions]) if hive_site is not None: step_args.extend(['--hive-site=%s' % hive_site]) - ScriptRunnerStep.__init__(self, self.InstallHiveName, + super(InstallHiveStep, self).__init__(self.InstallHiveName, step_args=step_args) @@ -278,4 +278,4 @@ class HiveStep(HiveBase): step_args.extend(['--run-hive-script', '--args', '-f', hive_file]) if hive_args is not None: step_args.extend(hive_args) - ScriptRunnerStep.__init__(self, name, step_args=step_args) + super(HiveStep, self).__init__(name, step_args=step_args) diff --git a/boto/exception.py b/boto/exception.py index f0e1daaf..53626bfe 100644 --- a/boto/exception.py +++ b/boto/exception.py @@ -35,7 +35,7 @@ class BotoClientError(StandardError): General Boto Client error (error accessing AWS) """ def __init__(self, reason, *args): - StandardError.__init__(self, reason, *args) + super(BotoClientError, self).__init__(reason, *args) self.reason = reason def __repr__(self): @@ -72,7 +72,7 @@ class GSPermissionsError(StoragePermissionsError): class BotoServerError(StandardError): def __init__(self, status, reason, body=None, *args): - StandardError.__init__(self, status, reason, body, *args) + super(BotoServerError, self).__init__(status, reason, body, *args) self.status = status self.reason = reason self.body = body or '' @@ -163,13 +163,13 @@ class StorageCreateError(BotoServerError): """ def __init__(self, status, reason, body=None): self.bucket = None - BotoServerError.__init__(self, status, reason, body) + super(StorageCreateError, self).__init__(status, reason, body) def endElement(self, name, value, connection): if name == 'BucketName': self.bucket = value else: - return BotoServerError.endElement(self, name, value, connection) + return super(StorageCreateError, self).endElement(name, value, connection) class S3CreateError(StorageCreateError): """ @@ -213,10 +213,10 @@ class SQSError(BotoServerError): def __init__(self, status, reason, body=None): self.detail = None self.type = None - BotoServerError.__init__(self, status, reason, body) + super(SQSError, self).__init__(status, reason, body) def startElement(self, name, attrs, connection): - return BotoServerError.startElement(self, name, attrs, connection) + return super(SQSError, self).startElement(name, attrs, connection) def endElement(self, name, value, connection): if name == 'Detail': @@ -224,10 +224,10 @@ class SQSError(BotoServerError): elif name == 'Type': self.type = value else: - return BotoServerError.endElement(self, name, value, connection) + return super(SQSError, self).endElement(name, value, connection) def _cleanupParsedProperties(self): - BotoServerError._cleanupParsedProperties(self) + super(SQSError, self)._cleanupParsedProperties() for p in ('detail', 'type'): setattr(self, p, None) @@ -237,7 +237,7 @@ class SQSDecodeError(BotoClientError): Error when decoding an SQS message. """ def __init__(self, reason, message): - BotoClientError.__init__(self, reason, message) + super(SQSDecodeError, self).__init__(reason, message) self.message = message def __repr__(self): @@ -253,19 +253,21 @@ class StorageResponseError(BotoServerError): """ def __init__(self, status, reason, body=None): self.resource = None - BotoServerError.__init__(self, status, reason, body) + super(StorageResponseError, self).__init__(status, reason, body) def startElement(self, name, attrs, connection): - return BotoServerError.startElement(self, name, attrs, connection) + return super(StorageResponseError, self).startElement(name, attrs, + connection) def endElement(self, name, value, connection): if name == 'Resource': self.resource = value else: - return BotoServerError.endElement(self, name, value, connection) + return super(StorageResponseError, self).endElement(name, value, + connection) def _cleanupParsedProperties(self): - BotoServerError._cleanupParsedProperties(self) + super(StorageResponseError, self)._cleanupParsedProperties() for p in ('resource'): setattr(self, p, None) @@ -291,7 +293,7 @@ class EC2ResponseError(BotoServerError): def __init__(self, status, reason, body=None): self.errors = None self._errorResultSet = [] - BotoServerError.__init__(self, status, reason, body) + super(EC2ResponseError, self).__init__(status, reason, body) self.errors = [ (e.error_code, e.error_message) \ for e in self._errorResultSet ] if len(self.errors): @@ -311,7 +313,7 @@ class EC2ResponseError(BotoServerError): return None # don't call subclass here def _cleanupParsedProperties(self): - BotoServerError._cleanupParsedProperties(self) + super(EC2ResponseError, self)._cleanupParsedProperties() self._errorResultSet = [] for p in ('errors'): setattr(self, p, None) @@ -408,21 +410,21 @@ class InvalidUriError(Exception): """Exception raised when URI is invalid.""" def __init__(self, message): - Exception.__init__(self, message) + super(InvalidUriError, self).__init__(message) self.message = message class InvalidAclError(Exception): """Exception raised when ACL XML is invalid.""" def __init__(self, message): - Exception.__init__(self, message) + super(InvalidAclError, self).__init__(message) self.message = message class InvalidCorsError(Exception): """Exception raised when CORS XML is invalid.""" def __init__(self, message): - Exception.__init__(self, message) + super(InvalidCorsError, self).__init__(message) self.message = message class NoAuthHandlerFound(Exception): @@ -433,7 +435,7 @@ class InvalidLifecycleConfigError(Exception): """Exception raised when GCS lifecycle configuration XML is invalid.""" def __init__(self, message): - Exception.__init__(self, message) + super(InvalidLifecycleConfigError, self).__init__(message) self.message = message # Enum class for resumable upload failure disposition. @@ -468,7 +470,7 @@ class ResumableUploadException(Exception): """ def __init__(self, message, disposition): - Exception.__init__(self, message, disposition) + super(ResumableUploadException, self).__init__(message, disposition) self.message = message self.disposition = disposition @@ -484,7 +486,7 @@ class ResumableDownloadException(Exception): """ def __init__(self, message, disposition): - Exception.__init__(self, message, disposition) + super(ResumableDownloadException, self).__init__(message, disposition) self.message = message self.disposition = disposition @@ -499,7 +501,7 @@ class TooManyRecordsException(Exception): """ def __init__(self, message): - Exception.__init__(self, message) + super(TooManyRecordsException, self).__init__(message) self.message = message diff --git a/boto/fps/connection.py b/boto/fps/connection.py index 8f2aaee8..dd9b2351 100644 --- a/boto/fps/connection.py +++ b/boto/fps/connection.py @@ -109,7 +109,7 @@ class FPSConnection(AWSQueryConnection): def __init__(self, *args, **kw): self.currencycode = kw.pop('CurrencyCode', self.currencycode) kw.setdefault('host', 'fps.sandbox.amazonaws.com') - AWSQueryConnection.__init__(self, *args, **kw) + super(FPSConnection, self).__init__(*args, **kw) def _required_auth_capability(self): return ['fps'] diff --git a/boto/fps/response.py b/boto/fps/response.py index fa77b2d4..ef12b00f 100644 --- a/boto/fps/response.py +++ b/boto/fps/response.py @@ -9,7 +9,7 @@ def ResponseFactory(action): # due to nodes receiving their closing tags def endElement(self, name, value, connection): if name != action + 'Response': - Response.endElement(self, name, value, connection) + super(FPSResponse, self).endElement(name, value, connection) return FPSResponse @@ -48,7 +48,7 @@ class Response(ResponseElement): elif name == self._action + 'Result': setattr(self, name, self._Result(name=name)) else: - return ResponseElement.startElement(self, name, attrs, connection) + return super(Response, self).startElement(name, attrs, connection) return getattr(self, name) @@ -66,12 +66,12 @@ class ComplexAmount(ResponseElement): if name not in ('CurrencyCode', 'Value'): message = 'Unrecognized tag {0} in ComplexAmount'.format(name) raise AssertionError(message) - return ResponseElement.startElement(self, name, attrs, connection) + return super(ComplexAmount, self).startElement(name, attrs, connection) def endElement(self, name, value, connection): if name == 'Value': value = Decimal(value) - ResponseElement.endElement(self, name, value, connection) + super(ComplexAmount, self).endElement(name, value, connection) class AmountCollection(ResponseElement): @@ -85,7 +85,7 @@ class AccountBalance(AmountCollection): if name == 'AvailableBalances': setattr(self, name, AmountCollection(name=name)) return getattr(self, name) - return AmountCollection.startElement(self, name, attrs, connection) + return super(AccountBalance, self).startElement(name, attrs, connection) class GetAccountBalanceResult(ResponseElement): @@ -93,7 +93,8 @@ class GetAccountBalanceResult(ResponseElement): if name == 'AccountBalance': setattr(self, name, AccountBalance(name=name)) return getattr(self, name) - return Response.startElement(self, name, attrs, connection) + return super(GetAccountBalanceResult, self).startElement(name, attrs, + connection) class GetTotalPrepaidLiabilityResult(ResponseElement): @@ -101,7 +102,8 @@ class GetTotalPrepaidLiabilityResult(ResponseElement): if name == 'OutstandingPrepaidLiability': setattr(self, name, AmountCollection(name=name)) return getattr(self, name) - return Response.startElement(self, name, attrs, connection) + return super(GetTotalPrepaidLiabilityResult, self).startElement(name, + attrs, connection) class GetPrepaidBalanceResult(ResponseElement): @@ -109,7 +111,8 @@ class GetPrepaidBalanceResult(ResponseElement): if name == 'PrepaidBalance': setattr(self, name, AmountCollection(name=name)) return getattr(self, name) - return Response.startElement(self, name, attrs, connection) + return super(GetPrepaidBalanceResult, self).startElement(name, attrs, + connection) class GetOutstandingDebtBalanceResult(ResponseElement): @@ -117,7 +120,8 @@ class GetOutstandingDebtBalanceResult(ResponseElement): if name == 'OutstandingDebt': setattr(self, name, AmountCollection(name=name)) return getattr(self, name) - return Response.startElement(self, name, attrs, connection) + return super(GetOutstandingDebtBalanceResult, self).startElement(name, + attrs, connection) class TransactionPart(ResponseElement): @@ -125,13 +129,14 @@ class TransactionPart(ResponseElement): if name == 'FeesPaid': setattr(self, name, ComplexAmount(name=name)) return getattr(self, name) - return ResponseElement.startElement(self, name, attrs, connection) + return super(TransactionPart, self).startElement(name, attrs, + connection) class Transaction(ResponseElement): def __init__(self, *args, **kw): self.TransactionPart = [] - ResponseElement.__init__(self, *args, **kw) + super(Transaction, self).__init__(*args, **kw) def startElement(self, name, attrs, connection): if name == 'TransactionPart': @@ -140,19 +145,20 @@ class Transaction(ResponseElement): if name in ('TransactionAmount', 'FPSFees', 'Balance'): setattr(self, name, ComplexAmount(name=name)) return getattr(self, name) - return ResponseElement.startElement(self, name, attrs, connection) + return super(Transaction, self).startElement(name, attrs, connection) class GetAccountActivityResult(ResponseElement): def __init__(self, *args, **kw): self.Transaction = [] - ResponseElement.__init__(self, *args, **kw) + super(GetAccountActivityResult, self).__init__(*args, **kw) def startElement(self, name, attrs, connection): if name == 'Transaction': getattr(self, name).append(Transaction(name=name)) return getattr(self, name)[-1] - return ResponseElement.startElement(self, name, attrs, connection) + return super(GetAccountActivityResult, self).startElement(name, attrs, + connection) class GetTransactionResult(ResponseElement): @@ -160,16 +166,18 @@ class GetTransactionResult(ResponseElement): if name == 'Transaction': setattr(self, name, Transaction(name=name)) return getattr(self, name) - return ResponseElement.startElement(self, name, attrs, connection) + return super(GetTransactionResult, self).startElement(name, attrs, + connection) class GetTokensResult(ResponseElement): def __init__(self, *args, **kw): self.Token = [] - ResponseElement.__init__(self, *args, **kw) + super(GetTokensResult, self).__init__(*args, **kw) def startElement(self, name, attrs, connection): if name == 'Token': getattr(self, name).append(ResponseElement(name=name)) return getattr(self, name)[-1] - return ResponseElement.startElement(self, name, attrs, connection) + return super(GetTokensResult, self).startElement(name, attrs, + connection) diff --git a/boto/glacier/layer1.py b/boto/glacier/layer1.py index e5a39630..f6b05588 100644 --- a/boto/glacier/layer1.py +++ b/boto/glacier/layer1.py @@ -54,7 +54,7 @@ class Layer1(AWSAuthConnection): self.region = region self.account_id = account_id - AWSAuthConnection.__init__(self, region.endpoint, + super(Layer1, self).__init__(region.endpoint, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, debug, @@ -72,7 +72,7 @@ class Layer1(AWSAuthConnection): headers = {} headers['x-amz-glacier-version'] = self.Version uri = '/%s/%s' % (self.account_id, resource) - response = AWSAuthConnection.make_request(self, verb, uri, + response = super(Layer1, self).make_request(verb, uri, params=params, headers=headers, sender=sender, diff --git a/boto/gs/connection.py b/boto/gs/connection.py index e7f2aeb6..4c31979c 100755 --- a/boto/gs/connection.py +++ b/boto/gs/connection.py @@ -14,12 +14,12 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -from boto.gs.bucket import Bucket +from boto.gs.bucket import Bucket from boto.s3.connection import S3Connection from boto.s3.connection import SubdomainCallingFormat from boto.s3.connection import check_lowercase_bucketname @@ -40,7 +40,7 @@ class GSConnection(S3Connection): host=DefaultHost, debug=0, https_connection_factory=None, calling_format=SubdomainCallingFormat(), path='/', suppress_consec_slashes=True): - S3Connection.__init__(self, gs_access_key_id, gs_secret_access_key, + super(GSConnection, self).__init__(gs_access_key_id, gs_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, host, debug, https_connection_factory, calling_format, path, "google", Bucket, @@ -52,12 +52,12 @@ class GSConnection(S3Connection): """ Creates a new bucket. By default it's located in the USA. You can pass Location.EU to create bucket in the EU. You can also pass - a LocationConstraint for where the bucket should be located, and + a LocationConstraint for where the bucket should be located, and a StorageClass describing how the data should be stored. :type bucket_name: string :param bucket_name: The name of the new bucket. - + :type headers: dict :param headers: Additional headers to pass along with the request to GCS. @@ -70,7 +70,7 @@ class GSConnection(S3Connection): :type storage_class: string :param storage_class: Either 'STANDARD' or 'DURABLE_REDUCED_AVAILABILITY'. - + """ check_lowercase_bucketname(bucket_name) diff --git a/boto/iam/connection.py b/boto/iam/connection.py index 7176ceda..32b3ab2e 100644 --- a/boto/iam/connection.py +++ b/boto/iam/connection.py @@ -42,7 +42,7 @@ class IAMConnection(AWSQueryConnection): proxy_user=None, proxy_pass=None, host='iam.amazonaws.com', debug=0, https_connection_factory=None, path='/', security_token=None, validate_certs=True): - AWSQueryConnection.__init__(self, aws_access_key_id, + super(IAMConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, @@ -51,7 +51,6 @@ class IAMConnection(AWSQueryConnection): validate_certs=validate_certs) def _required_auth_capability(self): - #return ['iam'] return ['hmac-v4'] def get_response(self, action, params, path='/', parent=None, diff --git a/boto/kinesis/layer1.py b/boto/kinesis/layer1.py index 2f486e99..f282d898 100644 --- a/boto/kinesis/layer1.py +++ b/boto/kinesis/layer1.py @@ -65,7 +65,7 @@ class KinesisConnection(AWSQueryConnection): self.DefaultRegionEndpoint) if 'host' not in kwargs: kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(KinesisConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/manage/server.py b/boto/manage/server.py index 3acc4b2f..49ed55bb 100644 --- a/boto/manage/server.py +++ b/boto/manage/server.py @@ -15,7 +15,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -134,7 +134,7 @@ class CommandLineGetter(object): if ami.location.find('pyami') >= 0: my_amis.append((ami.location, ami)) return my_amis - + def get_region(self, params): region = params.get('region', None) if isinstance(region, str) or isinstance(region, unicode): @@ -171,7 +171,7 @@ class CommandLineGetter(object): prop = StringProperty(name='zone', verbose_name='EC2 Availability Zone', choices=self.ec2.get_all_zones) params['zone'] = propget.get(prop) - + def get_ami_id(self, params): valid = False while not valid: @@ -271,20 +271,20 @@ class Server(Model): """ Create a new instance based on the specified configuration file or the specified configuration and the passed in parameters. - - If the config_file argument is not None, the configuration is read from there. + + If the config_file argument is not None, the configuration is read from there. Otherwise, the cfg argument is used. - + The config file may include other config files with a #import reference. The included - config files must reside in the same directory as the specified file. - - The logical_volume argument, if supplied, will be used to get the current physical - volume ID and use that as an override of the value specified in the config file. This - may be useful for debugging purposes when you want to debug with a production config - file but a test Volume. - - The dictionary argument may be used to override any EC2 configuration values in the - config file. + config files must reside in the same directory as the specified file. + + The logical_volume argument, if supplied, will be used to get the current physical + volume ID and use that as an override of the value specified in the config file. This + may be useful for debugging purposes when you want to debug with a production config + file but a test Volume. + + The dictionary argument may be used to override any EC2 configuration values in the + config file. """ if config_file: cfg = Config(path=config_file) @@ -304,7 +304,7 @@ class Server(Model): zone = params.get('zone') # deal with possibly passed in logical volume: if logical_volume != None: - cfg.set('EBS', 'logical_volume_name', logical_volume.name) + cfg.set('EBS', 'logical_volume_name', logical_volume.name) cfg_fp = StringIO.StringIO() cfg.write(cfg_fp) # deal with the possibility that zone and/or keypair are strings read from the config file: @@ -328,7 +328,7 @@ class Server(Model): print 'Waiting for instance to start so we can set its elastic IP address...' # Sometimes we get a message from ec2 that says that the instance does not exist. # Hopefully the following delay will giv eec2 enough time to get to a stable state: - time.sleep(5) + time.sleep(5) while instance.update() != 'running': time.sleep(1) instance.use_ip(elastic_ip) @@ -346,7 +346,7 @@ class Server(Model): l.append(s) i += 1 return l - + @classmethod def create_from_instance_id(cls, instance_id, name, description=''): regions = boto.ec2.regions() @@ -393,9 +393,9 @@ class Server(Model): s.put() servers.append(s) return servers - + def __init__(self, id=None, **kw): - Model.__init__(self, id, **kw) + super(Server, self).__init__(id, **kw) self.ssh_key_file = None self.ec2 = None self._cmdshell = None @@ -421,7 +421,7 @@ class Server(Model): self._instance = instance except EC2ResponseError: pass - + def _status(self): status = '' if self._instance: @@ -484,14 +484,14 @@ class Server(Model): return kn def put(self): - Model.put(self) + super(Server, self).put() self._setup_ec2() def delete(self): if self.production: raise ValueError("Can't delete a production server") #self.stop() - Model.delete(self) + super(Server, self).delete() def stop(self): if self.production: @@ -553,4 +553,4 @@ class Server(Model): return self.run('apt-get -y install %s' % pkg) - + diff --git a/boto/manage/task.py b/boto/manage/task.py index 1c37c697..8271529a 100644 --- a/boto/manage/task.py +++ b/boto/manage/task.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -30,7 +30,7 @@ def check_hour(val): return if int(val) < 0 or int(val) > 23: raise ValueError - + class Task(Model): """ @@ -40,10 +40,10 @@ class Task(Model): To keep the operation reasonably efficient and not cause excessive polling, the minimum granularity of a Task is hourly. Some examples: - + hour='*' - the task would be executed each hour hour='3' - the task would be executed at 3AM GMT each day. - + """ name = StringProperty() hour = StringProperty(required=True, validator=check_hour, default='*') @@ -57,13 +57,13 @@ class Task(Model): def start_all(cls, queue_name): for task in cls.all(): task.start(queue_name) - + def __init__(self, id=None, **kw): - Model.__init__(self, id, **kw) + super(Task, self).__init__(id, **kw) self.hourly = self.hour == '*' self.daily = self.hour != '*' self.now = datetime.datetime.utcnow() - + def check(self): """ Determine how long until the next scheduled time for a Task. @@ -76,7 +76,7 @@ class Task(Model): if self.hourly and not self.last_executed: return 0 - + if self.daily and not self.last_executed: if int(self.hour) == self.now.hour: return 0 @@ -97,7 +97,7 @@ class Task(Model): return 82800 # 23 hours, just to be safe else: return max( (int(self.hour)-self.now.hour), (self.now.hour-int(self.hour)) )*60*60 - + def _run(self, msg, vtimeout): boto.log.info('Task[%s] - running:%s' % (self.name, self.command)) log_fp = StringIO.StringIO() @@ -170,6 +170,6 @@ class TaskPoller(object): - - + + diff --git a/boto/manage/volume.py b/boto/manage/volume.py index 49237d47..841c1247 100644 --- a/boto/manage/volume.py +++ b/boto/manage/volume.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -33,7 +33,7 @@ import datetime class CommandLineGetter(object): - + def get_region(self, params): if not params.get('region', None): prop = self.cls.find_property('region_name') @@ -44,7 +44,7 @@ class CommandLineGetter(object): prop = StringProperty(name='zone', verbose_name='EC2 Availability Zone', choices=self.ec2.get_all_zones) params['zone'] = propget.get(prop) - + def get_name(self, params): if not params.get('name', None): prop = self.cls.find_property('name') @@ -151,7 +151,7 @@ class Volume(Model): v.zone_name = self.zone_name v.put() return v - + def get_ec2_connection(self): if self.server: return self.server.ec2 @@ -396,7 +396,7 @@ class Volume(Model): boto.log.info('Deleting %s(%s) for %s' % (snap, snap.date, self.name)) snap.delete() return snaps - + def grow(self, size): pass @@ -411,10 +411,10 @@ class Volume(Model): self.detach() ec2 = self.get_ec2_connection() ec2.delete_volume(self.volume_id) - Model.delete(self) + super(Volume, self).delete() def archive(self): # snapshot volume, trim snaps, delete volume-id pass - + diff --git a/boto/mashups/server.py b/boto/mashups/server.py index aa564471..cb6d78a7 100644 --- a/boto/mashups/server.py +++ b/boto/mashups/server.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -87,7 +87,7 @@ class Server(Model): return s def __init__(self, id=None, **kw): - Model.__init__(self, id, **kw) + super(Server, self).__init__(id, **kw) self._reservation = None self._instance = None self._ssh_client = None @@ -123,13 +123,13 @@ class Server(Model): return self._instance instance = property(getInstance, setReadOnly, None, 'The Instance for the server') - + def getAMI(self): if self.instance: return self.instance.image_id ami = property(getAMI, setReadOnly, None, 'The AMI for the server') - + def getStatus(self): if self.instance: self.instance.update() @@ -137,7 +137,7 @@ class Server(Model): status = property(getStatus, setReadOnly, None, 'The status of the server') - + def getHostname(self): if self.instance: return self.instance.public_dns_name diff --git a/boto/mturk/connection.py b/boto/mturk/connection.py index c85ad6ec..ed7ba9d2 100644 --- a/boto/mturk/connection.py +++ b/boto/mturk/connection.py @@ -54,7 +54,7 @@ class MTurkConnection(AWSQueryConnection): host = 'mechanicalturk.amazonaws.com' self.debug = debug - AWSQueryConnection.__init__(self, aws_access_key_id, + super(MTurkConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, host, debug, @@ -955,7 +955,7 @@ class QualificationRequest(BaseAutoResultElement): """ def __init__(self, connection): - BaseAutoResultElement.__init__(self, connection) + super(QualificationRequest, self).__init__(connection) self.answers = [] def endElement(self, name, value, connection): @@ -967,7 +967,7 @@ class QualificationRequest(BaseAutoResultElement): xml.sax.parseString(value, h) self.answers.append(answer_rs) else: - BaseAutoResultElement.endElement(self, name, value, connection) + super(QualificationRequest, self).endElement(name, value, connection) class Assignment(BaseAutoResultElement): @@ -980,7 +980,7 @@ class Assignment(BaseAutoResultElement): """ def __init__(self, connection): - BaseAutoResultElement.__init__(self, connection) + super(Assignment, self).__init__(connection) self.answers = [] def endElement(self, name, value, connection): @@ -992,7 +992,7 @@ class Assignment(BaseAutoResultElement): xml.sax.parseString(value, h) self.answers.append(answer_rs) else: - BaseAutoResultElement.endElement(self, name, value, connection) + super(Assignment, self).endElement(name, value, connection) class QuestionFormAnswer(BaseAutoResultElement): @@ -1016,7 +1016,7 @@ class QuestionFormAnswer(BaseAutoResultElement): """ def __init__(self, connection): - BaseAutoResultElement.__init__(self, connection) + super(QuestionFormAnswer, self).__init__(connection) self.fields = [] self.qid = None diff --git a/boto/mturk/qualification.py b/boto/mturk/qualification.py index c59cabd2..4b518c89 100644 --- a/boto/mturk/qualification.py +++ b/boto/mturk/qualification.py @@ -67,7 +67,7 @@ class PercentAssignmentsSubmittedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="00000000000000000000", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(PercentAssignmentsSubmittedRequirement, self).__init__(qualification_type_id="00000000000000000000", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class PercentAssignmentsAbandonedRequirement(Requirement): """ @@ -75,7 +75,7 @@ class PercentAssignmentsAbandonedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="00000000000000000070", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(PercentAssignmentsAbandonedRequirement, self).__init__(qualification_type_id="00000000000000000070", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class PercentAssignmentsReturnedRequirement(Requirement): """ @@ -83,7 +83,7 @@ class PercentAssignmentsReturnedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="000000000000000000E0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(PercentAssignmentsReturnedRequirement, self).__init__(qualification_type_id="000000000000000000E0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class PercentAssignmentsApprovedRequirement(Requirement): """ @@ -91,7 +91,7 @@ class PercentAssignmentsApprovedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="000000000000000000L0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(PercentAssignmentsApprovedRequirement, self).__init__(qualification_type_id="000000000000000000L0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class PercentAssignmentsRejectedRequirement(Requirement): """ @@ -99,7 +99,7 @@ class PercentAssignmentsRejectedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="000000000000000000S0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(PercentAssignmentsRejectedRequirement, self).__init__(qualification_type_id="000000000000000000S0", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class NumberHitsApprovedRequirement(Requirement): """ @@ -107,7 +107,7 @@ class NumberHitsApprovedRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="00000000000000000040", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(NumberHitsApprovedRequirement, self).__init__(qualification_type_id="00000000000000000040", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) class LocaleRequirement(Requirement): """ @@ -115,7 +115,7 @@ class LocaleRequirement(Requirement): """ def __init__(self, comparator, locale, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="00000000000000000071", comparator=comparator, integer_value=None, required_to_preview=required_to_preview) + super(LocaleRequirement, self).__init__(qualification_type_id="00000000000000000071", comparator=comparator, integer_value=None, required_to_preview=required_to_preview) self.locale = locale def get_as_params(self): @@ -134,4 +134,4 @@ class AdultRequirement(Requirement): """ def __init__(self, comparator, integer_value, required_to_preview=False): - Requirement.__init__(self, qualification_type_id="00000000000000000060", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) + super(AdultRequirement, self).__init__(qualification_type_id="00000000000000000060", comparator=comparator, integer_value=integer_value, required_to_preview=required_to_preview) diff --git a/boto/mws/connection.py b/boto/mws/connection.py index 1c718af0..d9a20035 100644 --- a/boto/mws/connection.py +++ b/boto/mws/connection.py @@ -251,7 +251,7 @@ class MWSConnection(AWSQueryConnection): kw.setdefault('host', 'mws.amazonservices.com') self.Merchant = kw.pop('Merchant', None) or kw.get('SellerId') self.SellerId = kw.pop('SellerId', None) or self.Merchant - AWSQueryConnection.__init__(self, *args, **kw) + super(MWSConnection, self).__init__(*args, **kw) def _required_auth_capability(self): return ['mws'] diff --git a/boto/mws/response.py b/boto/mws/response.py index 5c8ffb73..064f5d7f 100644 --- a/boto/mws/response.py +++ b/boto/mws/response.py @@ -82,7 +82,7 @@ class Element(DeclarativeType): class SimpleList(DeclarativeType): def __init__(self, *args, **kw): - DeclarativeType.__init__(self, *args, **kw) + super(SimpleList, self).__init__(*args, **kw) self._value = [] def start(self, *args, **kw): @@ -108,16 +108,16 @@ class MemberList(Element): assert 'member' not in kw, message if _member is None: if _hint is None: - Element.__init__(self, *args, member=ElementList(**kw)) + super(MemberList, self).__init__(*args, member=ElementList(**kw)) else: - Element.__init__(self, _hint=_hint) + super(MemberList, self).__init__(_hint=_hint) else: if _hint is None: if issubclass(_member, DeclarativeType): member = _member(**kw) else: member = ElementList(_member, **kw) - Element.__init__(self, *args, member=member) + super(MemberList, self).__init__(*args, member=member) else: message = 'Nonsensical {0} hint {1!r}'.format(self.__class__.__name__, _hint) @@ -130,7 +130,7 @@ class MemberList(Element): if isinstance(self._value.member, DeclarativeType): self._value.member = [] self._value = self._value.member - Element.teardown(self, *args, **kw) + super(MemberList, self).teardown(*args, **kw) def ResponseFactory(action, force=None): @@ -231,7 +231,7 @@ class Response(ResponseElement): if name == self._name: self.update(attrs) else: - return ResponseElement.startElement(self, name, attrs, connection) + return super(Response, self).startElement(name, attrs, connection) @property def _result(self): @@ -247,7 +247,7 @@ class ResponseResultList(Response): def __init__(self, *args, **kw): setattr(self, self._action + 'Result', ElementList(self._ResultClass)) - Response.__init__(self, *args, **kw) + super(ResponseResultList, self).__init__(*args, **kw) class FeedSubmissionInfo(ResponseElement): @@ -374,13 +374,13 @@ class ComplexAmount(ResponseElement): if name not in ('CurrencyCode', self._amount): message = 'Unrecognized tag {0} in ComplexAmount'.format(name) raise AssertionError(message) - return ResponseElement.startElement(self, name, attrs, connection) + return super(ComplexAmount, self).startElement(name, attrs, connection) @strip_namespace def endElement(self, name, value, connection): if name == self._amount: value = Decimal(value) - ResponseElement.endElement(self, name, value, connection) + super(ComplexAmount, self).endElement(name, value, connection) class ComplexMoney(ComplexAmount): @@ -402,13 +402,13 @@ class ComplexWeight(ResponseElement): if name not in ('Unit', 'Value'): message = 'Unrecognized tag {0} in ComplexWeight'.format(name) raise AssertionError(message) - return ResponseElement.startElement(self, name, attrs, connection) + return super(ComplexWeight, self).startElement(name, attrs, connection) @strip_namespace def endElement(self, name, value, connection): if name == 'Value': value = Decimal(value) - ResponseElement.endElement(self, name, value, connection) + super(ComplexWeight, self).endElement(name, value, connection) class Dimension(ComplexType): @@ -501,7 +501,7 @@ class ItemAttributes(AttributeSet): 'MediaType', 'OperatingSystem', 'Platform') for name in names: setattr(self, name, SimpleList()) - AttributeSet.__init__(self, *args, **kw) + super(ItemAttributes, self).__init__(*args, **kw) class VariationRelationship(ResponseElement): @@ -605,7 +605,7 @@ class ProductCategory(ResponseElement): def __init__(self, *args, **kw): setattr(self, 'Parent', Element(ProductCategory)) - ResponseElement.__init__(self, *args, **kw) + super(ProductCategory, self).__init__(*args, **kw) class GetProductCategoriesResult(ResponseElement): diff --git a/boto/opsworks/layer1.py b/boto/opsworks/layer1.py index 1970edbd..6e8d24ba 100644 --- a/boto/opsworks/layer1.py +++ b/boto/opsworks/layer1.py @@ -96,7 +96,7 @@ class OpsWorksConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(OpsWorksConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): @@ -1437,7 +1437,7 @@ class OpsWorksConnection(AWSQueryConnection): explicitly grants permissions. For more information on user permissions, see `Managing User Permissions`_. - + """ params = {} return self.make_request(action='DescribeMyUserProfile', diff --git a/boto/pyami/bootstrap.py b/boto/pyami/bootstrap.py index cd44682f..f0b353de 100644 --- a/boto/pyami/bootstrap.py +++ b/boto/pyami/bootstrap.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -40,7 +40,7 @@ class Bootstrap(ScriptBase): def __init__(self): self.working_dir = '/mnt/pyami' self.write_metadata() - ScriptBase.__init__(self) + super(Bootstrap, self).__init__() def write_metadata(self): fp = open(os.path.expanduser(BotoConfigPath), 'w') diff --git a/boto/pyami/config.py b/boto/pyami/config.py index 08da6581..28b6f6d8 100644 --- a/boto/pyami/config.py +++ b/boto/pyami/config.py @@ -58,6 +58,8 @@ elif 'BOTO_PATH' in os.environ: class Config(ConfigParser.SafeConfigParser): def __init__(self, path=None, fp=None, do_load=True): + # We don't use ``super`` here, because ``ConfigParser`` still uses + # old-style classes. ConfigParser.SafeConfigParser.__init__(self, {'working_dir' : '/mnt/pyami', 'debug' : '0'}) if do_load: diff --git a/boto/pyami/copybot.py b/boto/pyami/copybot.py index ed397cb7..02d8bb22 100644 --- a/boto/pyami/copybot.py +++ b/boto/pyami/copybot.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -26,7 +26,7 @@ import os, StringIO class CopyBot(ScriptBase): def __init__(self): - ScriptBase.__init__(self) + super(CopyBot, self).__init__() self.wdir = boto.config.get('Pyami', 'working_dir') self.log_file = '%s.log' % self.instance_id self.log_path = os.path.join(self.wdir, self.log_file) @@ -80,7 +80,7 @@ class CopyBot(ScriptBase): def copy_log(self): key = self.dst.new_key(self.log_file) key.set_contents_from_filename(self.log_path) - + def main(self): fp = StringIO.StringIO() boto.config.dump_safe(fp) @@ -94,4 +94,4 @@ class CopyBot(ScriptBase): if boto.config.getbool(self.name, 'exit_on_completion', True): ec2 = boto.connect_ec2() ec2.terminate_instances([self.instance_id]) - + diff --git a/boto/pyami/installers/ubuntu/ebs.py b/boto/pyami/installers/ubuntu/ebs.py index 3e5b5c28..45f5dbbe 100644 --- a/boto/pyami/installers/ubuntu/ebs.py +++ b/boto/pyami/installers/ubuntu/ebs.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -36,7 +36,7 @@ Config file section:: [EBS] volume_id = <the id of the EBS volume, should look like vol-xxxxxxxx> - logical_volume_name = <the name of the logical volume that contaings + logical_volume_name = <the name of the logical volume that contaings a reference to the physical volume to be mounted. If this parameter is supplied, it overrides the volume_id setting.> device = <the linux device the EBS volume should be mounted on> @@ -86,7 +86,7 @@ from boto.manage.volume import Volume for v in Volume.all(): v.trim_snapshots(True) """ - + TagBasedBackupCleanupScript= """#!/usr/bin/env python import boto @@ -102,7 +102,7 @@ class EBSInstaller(Installer): """ def __init__(self, config_file=None): - Installer.__init__(self, config_file) + super(EBSInstaller, self).__init__(config_file) self.instance_id = boto.config.get('Instance', 'instance-id') self.device = boto.config.get('EBS', 'device', '/dev/sdp') self.volume_id = boto.config.get('EBS', 'volume_id') @@ -130,7 +130,7 @@ class EBSInstaller(Installer): attempt_attach = False except EC2ResponseError, e: if e.error_code != 'IncorrectState': - # if there's an EC2ResonseError with the code set to IncorrectState, delay a bit for ec2 + # if there's an EC2ResonseError with the code set to IncorrectState, delay a bit for ec2 # to realize the instance is running, then try again. Otherwise, raise the error: boto.log.info('Attempt to attach the EBS volume %s to this instance (%s) returned %s. Trying again in a bit.' % (self.volume_id, self.instance_id, e.errors)) time.sleep(2) @@ -198,7 +198,7 @@ class EBSInstaller(Installer): def install(self): # First, find and attach the volume self.attach() - + # Install the xfs tools self.run('apt-get -y install xfsprogs xfsdump') @@ -221,7 +221,7 @@ class EBSInstaller(Installer): hour = boto.config.get('EBS', 'backup_cleanup_cron_hour') if (minute != None) and (hour != None): # Snapshot clean up can either be done via the manage module, or via the new tag based - # snapshot code, if the snapshots have been tagged with the name of the associated + # snapshot code, if the snapshots have been tagged with the name of the associated # volume. Check for the presence of the new configuration flag, and use the appropriate # cleanup method / script: use_tag_based_cleanup = boto.config.has_option('EBS', 'use_tag_based_snapshot_cleanup') diff --git a/boto/rds/__init__.py b/boto/rds/__init__.py index 7b2873c4..9be60057 100644 --- a/boto/rds/__init__.py +++ b/boto/rds/__init__.py @@ -97,7 +97,7 @@ class RDSConnection(AWSQueryConnection): region = RDSRegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(RDSConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, @@ -204,7 +204,7 @@ class RDSConnection(AWSQueryConnection): * sqlserver-se = 200--1024 * sqlserver-ex = 30--1024 * sqlserver-web = 30--1024 - * postgres = 5--3072 + * postgres = 5--3072 :type instance_class: str :param instance_class: The compute and memory capacity of @@ -291,8 +291,8 @@ class RDSConnection(AWSQueryConnection): Name of a database to create when the DBInstance is created. Default is to create no databases. - Must contain 1--63 alphanumeric characters. Must - begin with a letter or an underscore. Subsequent + Must contain 1--63 alphanumeric characters. Must + begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0-9) and cannot be a reserved PostgreSQL word. @@ -1102,21 +1102,21 @@ class RDSConnection(AWSQueryConnection): params = {'DBSnapshotIdentifier': snapshot_id, 'DBInstanceIdentifier': dbinstance_id} return self.get_object('CreateDBSnapshot', params, DBSnapshot) - + def copy_dbsnapshot(self, source_snapshot_id, target_snapshot_id): """ Copies the specified DBSnapshot. - + :type source_snapshot_id: string :param source_snapshot_id: The identifier for the source DB snapshot. - + :type target_snapshot_id: string :param target_snapshot_id: The identifier for the copied snapshot. - + :rtype: :class:`boto.rds.dbsnapshot.DBSnapshot` - :return: The newly created DBSnapshot. + :return: The newly created DBSnapshot. """ - params = {'SourceDBSnapshotIdentifier': source_snapshot_id, + params = {'SourceDBSnapshotIdentifier': source_snapshot_id, 'TargetDBSnapshotIdentifier': target_snapshot_id} return self.get_object('CopyDBSnapshot', params, DBSnapshot) diff --git a/boto/rds/regioninfo.py b/boto/rds/regioninfo.py index 7d186ae0..376dc9f0 100644 --- a/boto/rds/regioninfo.py +++ b/boto/rds/regioninfo.py @@ -16,7 +16,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -28,5 +28,5 @@ class RDSRegionInfo(RegionInfo): def __init__(self, connection=None, name=None, endpoint=None): from boto.rds import RDSConnection - RegionInfo.__init__(self, connection, name, endpoint, + super(RDSRegionInfo, self).__init__(connection, name, endpoint, RDSConnection) diff --git a/boto/redshift/layer1.py b/boto/redshift/layer1.py index 2f5a332a..02aaff15 100644 --- a/boto/redshift/layer1.py +++ b/boto/redshift/layer1.py @@ -142,7 +142,7 @@ class RedshiftConnection(AWSQueryConnection): self.DefaultRegionEndpoint) if 'host' not in kwargs: kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(RedshiftConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/roboto/awsqueryrequest.py b/boto/roboto/awsqueryrequest.py index 6d950718..1e15c4f8 100644 --- a/boto/roboto/awsqueryrequest.py +++ b/boto/roboto/awsqueryrequest.py @@ -77,22 +77,22 @@ class RequiredParamError(boto.exception.BotoClientError): def __init__(self, required): self.required = required s = 'Required parameters are missing: %s' % self.required - boto.exception.BotoClientError.__init__(self, s) + super(RequiredParamError, self).__init__(s) class EncoderError(boto.exception.BotoClientError): def __init__(self, error_msg): s = 'Error encoding value (%s)' % error_msg - boto.exception.BotoClientError.__init__(self, s) - + super(EncoderError, self).__init__(s) + class FilterError(boto.exception.BotoClientError): def __init__(self, filters): self.filters = filters s = 'Unknown filters: %s' % self.filters - boto.exception.BotoClientError.__init__(self, s) - -class Encoder: + super(FilterError, self).__init__(s) + +class Encoder(object): @classmethod def encode(cls, p, rp, v, label=None): @@ -103,7 +103,7 @@ class Encoder: mthd(p, rp, v, label) except AttributeError: raise EncoderError('Unknown type: %s' % p.ptype) - + @classmethod def encode_string(cls, p, rp, v, l): if l: @@ -122,7 +122,7 @@ class Encoder: else: label = p.name rp[label] = '%d' % v - + @classmethod def encode_boolean(cls, p, rp, v, l): if l: @@ -134,7 +134,7 @@ class Encoder: else: v = 'false' rp[label] = v - + @classmethod def encode_datetime(cls, p, rp, v, l): if l: @@ -142,7 +142,7 @@ class Encoder: else: label = p.name rp[label] = v - + @classmethod def encode_array(cls, p, rp, v, l): v = boto.utils.mklist(v) @@ -153,7 +153,7 @@ class Encoder: label = label + '.%d' for i, value in enumerate(v): rp[label%(i+1)] = value - + class AWSQueryRequest(object): ServiceClass = None @@ -290,7 +290,7 @@ class AWSQueryRequest(object): elif fmt and fmt['type'] == 'array': self.list_markers.append(prev_name) self.item_markers.append(fmt['name']) - + def send(self, verb='GET', **args): self.process_args(**args) self.process_filters() @@ -371,7 +371,7 @@ class AWSQueryRequest(object): if a.doc: s += '\n\n\t%s - %s' % (a.long_name, a.doc) return s - + def build_cli_parser(self): self.parser = optparse.OptionParser(description=self.Description, usage=self.get_usage()) diff --git a/boto/roboto/awsqueryservice.py b/boto/roboto/awsqueryservice.py index 0ca78c2d..cb3a21d0 100644 --- a/boto/roboto/awsqueryservice.py +++ b/boto/roboto/awsqueryservice.py @@ -10,7 +10,7 @@ class NoCredentialsError(boto.exception.BotoClientError): def __init__(self): s = 'Unable to find credentials' - boto.exception.BotoClientError.__init__(self, s) + super(NoCredentialsError, self).__init__(s) class AWSQueryService(boto.connection.AWSQueryConnection): @@ -41,7 +41,7 @@ class AWSQueryService(boto.connection.AWSQueryConnection): if 'port' not in self.args: self.args['port'] = self.Port try: - boto.connection.AWSQueryConnection.__init__(self, **self.args) + super(AWSQueryService, self).__init__(**self.args) self.aws_response = None except boto.exception.NoAuthHandlerFound: raise NoCredentialsError() @@ -115,7 +115,7 @@ class AWSQueryService(boto.connection.AWSQueryConnection): if rslt.path and 'path' not in self.args: self.args['path'] = rslt.path - + def _required_auth_capability(self): return [self.Authentication] - + diff --git a/boto/roboto/param.py b/boto/roboto/param.py index 61364003..d4ddbd9f 100644 --- a/boto/roboto/param.py +++ b/boto/roboto/param.py @@ -23,7 +23,7 @@ import os class Converter(object): - + @classmethod def convert_string(cls, param, value): # TODO: could do length validation, etc. here @@ -35,7 +35,7 @@ class Converter(object): def convert_integer(cls, param, value): # TODO: could do range checking here return int(value) - + @classmethod def convert_boolean(cls, param, value): """ @@ -43,19 +43,19 @@ class Converter(object): of the option means True so just return True """ return True - + @classmethod def convert_file(cls, param, value): if os.path.isfile(value): return value raise ValueError - + @classmethod def convert_dir(cls, param, value): if os.path.isdir(value): return value raise ValueError - + @classmethod def convert(cls, param, value): try: @@ -66,7 +66,7 @@ class Converter(object): return mthd(param, value) except: raise ValidationException(param, '') - + class Param(object): def __init__(self, name=None, ptype='string', optional=True, @@ -142,6 +142,6 @@ class Param(object): :param value: The value to convert. This should always be a string. """ - return Converter.convert(self, value) + return super(Param, self).convert(value) diff --git a/boto/route53/connection.py b/boto/route53/connection.py index 8ba8cd78..398ff870 100644 --- a/boto/route53/connection.py +++ b/boto/route53/connection.py @@ -64,7 +64,7 @@ class Route53Connection(AWSAuthConnection): port=None, proxy=None, proxy_port=None, host=DefaultHost, debug=0, security_token=None, validate_certs=True, https_connection_factory=None): - AWSAuthConnection.__init__(self, host, + super(Route53Connection, self).__init__(host, aws_access_key_id, aws_secret_access_key, True, port, proxy, proxy_port, debug=debug, security_token=security_token, @@ -82,7 +82,7 @@ class Route53Connection(AWSAuthConnection): continue pairs.append(key + '=' + urllib.quote(str(val))) path += '?' + '&'.join(pairs) - return AWSAuthConnection.make_request(self, action, path, + return super(Route53Connection, self).make_request(action, path, headers, data, retry_handler=self._retry_handler) diff --git a/boto/route53/record.py b/boto/route53/record.py index d26ca119..17f38b94 100644 --- a/boto/route53/record.py +++ b/boto/route53/record.py @@ -54,7 +54,7 @@ class ResourceRecordSets(ResultSet): self.changes = [] self.next_record_name = None self.next_record_type = None - ResultSet.__init__(self, [('ResourceRecordSet', Record)]) + super(ResourceRecordSets, self).__init__([('ResourceRecordSet', Record)]) def __repr__(self): if self.changes: @@ -156,11 +156,11 @@ class ResourceRecordSets(ResultSet): elif name == 'NextRecordType': self.next_record_type = value else: - return ResultSet.endElement(self, name, value, connection) + return super(ResourceRecordSets, self).endElement(name, value, connection) def __iter__(self): """Override the next function to support paging""" - results = ResultSet.__iter__(self) + results = super(ResourceRecordSets, self).__iter__() truncated = self.is_truncated while results: for obj in results: diff --git a/boto/s3/connection.py b/boto/s3/connection.py index d670cfc6..138a7786 100644 --- a/boto/s3/connection.py +++ b/boto/s3/connection.py @@ -166,7 +166,7 @@ class S3Connection(AWSAuthConnection): self.calling_format = calling_format self.bucket_class = bucket_class self.anon = anon - AWSAuthConnection.__init__(self, host, + super(S3Connection, self).__init__(host, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, debug=debug, https_connection_factory=https_connection_factory, diff --git a/boto/sdb/connection.py b/boto/sdb/connection.py index dc5e01d5..04212df8 100644 --- a/boto/sdb/connection.py +++ b/boto/sdb/connection.py @@ -48,7 +48,7 @@ class ItemThread(threading.Thread): :class:`Domain <boto.sdb.domain.Domain>`. :ivar list items: A list of items retrieved. Starts as empty list. """ - threading.Thread.__init__(self, name=name) + super(ItemThread, self).__init__(name=name) #print 'starting %s with %d items' % (name, len(item_names)) self.domain_name = domain_name self.conn = SDBConnection() @@ -111,7 +111,7 @@ class SDBConnection(AWSQueryConnection): break self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(SDBConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/sdb/db/property.py b/boto/sdb/db/property.py index b8610cfe..44dab47d 100644 --- a/boto/sdb/db/property.py +++ b/boto/sdb/db/property.py @@ -127,7 +127,7 @@ class StringProperty(Property): def __init__(self, verbose_name=None, name=None, default='', required=False, validator=validate_string, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, + super(StringProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) @@ -138,7 +138,7 @@ class TextProperty(Property): def __init__(self, verbose_name=None, name=None, default='', required=False, validator=None, choices=None, unique=False, max_length=None): - Property.__init__(self, verbose_name, name, default, required, + super(TextProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.max_length = max_length @@ -207,7 +207,7 @@ class PasswordProperty(StringProperty): The remaining parameters are passed through to StringProperty.__init__""" - StringProperty.__init__(self, verbose_name, name, default, required, + super(PasswordProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.hashfunc = hashfunc @@ -216,7 +216,7 @@ class PasswordProperty(StringProperty): return p def get_value_for_datastore(self, model_instance): - value = StringProperty.get_value_for_datastore(self, model_instance) + value = super(PasswordProperty, self).get_value_for_datastore(model_instance) if value and len(value): return str(value) else: @@ -227,13 +227,13 @@ class PasswordProperty(StringProperty): p = self.data_type(hashfunc=self.hashfunc) p.set(value) value = p - Property.__set__(self, obj, value) + super(PasswordProperty, self).__set__(obj, value) def __get__(self, obj, objtype): - return self.data_type(StringProperty.__get__(self, obj, objtype), hashfunc=self.hashfunc) + return self.data_type(super(PasswordProperty, self).__get__(obj, objtype), hashfunc=self.hashfunc) def validate(self, value): - value = Property.validate(self, value) + value = super(PasswordProperty, self).validate(value) if isinstance(value, self.data_type): if len(value) > 1024: raise ValueError('Length of value greater than maxlength') @@ -254,7 +254,7 @@ class BlobProperty(Property): id = oldb.id b = Blob(value=value, id=id) value = b - Property.__set__(self, obj, value) + super(BlobProperty, self).__set__(obj, value) class S3KeyProperty(Property): @@ -265,7 +265,7 @@ class S3KeyProperty(Property): def __init__(self, verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, + super(S3KeyProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) def validate(self, value): @@ -280,7 +280,7 @@ class S3KeyProperty(Property): raise TypeError('Validation Error, expecting %s, got %s' % (self.data_type, type(value))) def __get__(self, obj, objtype): - value = Property.__get__(self, obj, objtype) + value = super(S3KeyProperty, self).__get__(obj, objtype) if value: if isinstance(value, self.data_type): return value @@ -297,7 +297,7 @@ class S3KeyProperty(Property): return value def get_value_for_datastore(self, model_instance): - value = Property.get_value_for_datastore(self, model_instance) + value = super(S3KeyProperty, self).get_value_for_datastore(model_instance) if value: return "s3://%s/%s" % (value.bucket.name, value.name) else: @@ -311,13 +311,13 @@ class IntegerProperty(Property): def __init__(self, verbose_name=None, name=None, default=0, required=False, validator=None, choices=None, unique=False, max=2147483647, min=-2147483648): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(IntegerProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.max = max self.min = min def validate(self, value): value = int(value) - value = Property.validate(self, value) + value = super(IntegerProperty, self).validate(value) if value > self.max: raise ValueError('Maximum value is %d' % self.max) if value < self.min: @@ -330,7 +330,7 @@ class IntegerProperty(Property): def __set__(self, obj, value): if value == "" or value == None: value = 0 - return Property.__set__(self, obj, value) + return super(IntegerProperty, self).__set__(obj, value) class LongProperty(Property): @@ -340,11 +340,11 @@ class LongProperty(Property): def __init__(self, verbose_name=None, name=None, default=0, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(LongProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) def validate(self, value): value = long(value) - value = Property.validate(self, value) + value = super(LongProperty, self).validate(value) min = -9223372036854775808 max = 9223372036854775807 if value > max: @@ -364,7 +364,7 @@ class BooleanProperty(Property): def __init__(self, verbose_name=None, name=None, default=False, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(BooleanProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) def empty(self, value): return value is None @@ -377,11 +377,11 @@ class FloatProperty(Property): def __init__(self, verbose_name=None, name=None, default=0.0, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(FloatProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) def validate(self, value): value = float(value) - value = Property.validate(self, value) + value = super(FloatProperty, self).validate(value) return value def empty(self, value): @@ -398,14 +398,14 @@ class DateTimeProperty(Property): def __init__(self, verbose_name=None, auto_now=False, auto_now_add=False, name=None, default=None, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(DateTimeProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.auto_now = auto_now self.auto_now_add = auto_now_add def default_value(self): if self.auto_now or self.auto_now_add: return self.now() - return Property.default_value(self) + return super(DateTimeProperty, self).default_value() def validate(self, value): if value == None: @@ -417,7 +417,7 @@ class DateTimeProperty(Property): def get_value_for_datastore(self, model_instance): if self.auto_now: setattr(model_instance, self.name, self.now()) - return Property.get_value_for_datastore(self, model_instance) + return super(DateTimeProperty, self).get_value_for_datastore(model_instance) def now(self): return datetime.datetime.utcnow() @@ -430,14 +430,14 @@ class DateProperty(Property): def __init__(self, verbose_name=None, auto_now=False, auto_now_add=False, name=None, default=None, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(DateProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.auto_now = auto_now self.auto_now_add = auto_now_add def default_value(self): if self.auto_now or self.auto_now_add: return self.now() - return Property.default_value(self) + return super(DateProperty, self).default_value() def validate(self, value): value = super(DateProperty, self).validate(value) @@ -449,7 +449,7 @@ class DateProperty(Property): def get_value_for_datastore(self, model_instance): if self.auto_now: setattr(model_instance, self.name, self.now()) - val = Property.get_value_for_datastore(self, model_instance) + val = super(DateProperty, self).get_value_for_datastore(model_instance) if isinstance(val, datetime.datetime): val = val.date() return val @@ -464,7 +464,7 @@ class TimeProperty(Property): def __init__(self, verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(TimeProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) def validate(self, value): value = super(TimeProperty, self).validate(value) @@ -481,7 +481,7 @@ class ReferenceProperty(Property): def __init__(self, reference_class=None, collection_name=None, verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False): - Property.__init__(self, verbose_name, name, default, required, validator, choices, unique) + super(ReferenceProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.reference_class = reference_class self.collection_name = collection_name @@ -506,7 +506,7 @@ class ReferenceProperty(Property): return super(ReferenceProperty, self).__set__(obj, value) def __property_config__(self, model_class, property_name): - Property.__property_config__(self, model_class, property_name) + super(ReferenceProperty, self).__property_config__(model_class, property_name) if self.collection_name is None: self.collection_name = '%s_%s_set' % (model_class.__name__.lower(), self.name) if hasattr(self.reference_class, self.collection_name): @@ -576,7 +576,7 @@ class CalculatedProperty(Property): def __init__(self, verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, calculated_type=int, unique=False, use_method=False): - Property.__init__(self, verbose_name, name, default, required, + super(CalculatedProperty, self).__init__(verbose_name, name, default, required, validator, choices, unique) self.calculated_type = calculated_type self.use_method = use_method @@ -617,7 +617,7 @@ class ListProperty(Property): if default is None: default = [] self.item_type = item_type - Property.__init__(self, verbose_name, name, default=default, required=True, **kwds) + super(ListProperty, self).__init__(verbose_name, name, default=default, required=True, **kwds) def validate(self, value): if self.validator: @@ -672,7 +672,7 @@ class MapProperty(Property): if default is None: default = {} self.item_type = item_type - Property.__init__(self, verbose_name, name, default=default, required=True, **kwds) + super(MapProperty, self).__init__(verbose_name, name, default=default, required=True, **kwds) def validate(self, value): value = super(MapProperty, self).validate(value) diff --git a/boto/sdb/domain.py b/boto/sdb/domain.py index 137709dc..6f0489e2 100644 --- a/boto/sdb/domain.py +++ b/boto/sdb/domain.py @@ -364,7 +364,7 @@ class UploaderThread(Thread): def __init__(self, domain): self.db = domain self.items = {} - Thread.__init__(self) + super(UploaderThread, self).__init__() def run(self): try: diff --git a/boto/sdb/regioninfo.py b/boto/sdb/regioninfo.py index 5c32864d..769be555 100644 --- a/boto/sdb/regioninfo.py +++ b/boto/sdb/regioninfo.py @@ -16,7 +16,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -28,5 +28,5 @@ class SDBRegionInfo(RegionInfo): def __init__(self, connection=None, name=None, endpoint=None): from boto.sdb.connection import SDBConnection - RegionInfo.__init__(self, connection, name, endpoint, + super(SDBRegionInfo, self).__init__(connection, name, endpoint, SDBConnection) diff --git a/boto/services/service.py b/boto/services/service.py index e0e987ce..e1a04c8e 100644 --- a/boto/services/service.py +++ b/boto/services/service.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -35,7 +35,7 @@ class Service(ScriptBase): ProcessingTime = 60 def __init__(self, config_file=None, mimetype_files=None): - ScriptBase.__init__(self, config_file) + super(Service, self).__init__(config_file) self.name = self.__class__.__name__ self.working_dir = boto.config.get('Pyami', 'working_dir') self.sd = ServiceDef(config_file) @@ -100,7 +100,7 @@ class Service(ScriptBase): key = self.put_file(output_bucket, file, key_name) output_keys.append('%s;type=%s' % (key.name, type)) output_message['OutputKey'] = ','.join(output_keys) - + # write message to each output queue def write_message(self, message): message['Service-Write'] = get_ts() diff --git a/boto/services/servicedef.py b/boto/services/servicedef.py index 1cb01aa7..a43b3f34 100644 --- a/boto/services/servicedef.py +++ b/boto/services/servicedef.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -26,7 +26,7 @@ import boto class ServiceDef(Config): def __init__(self, config_file, aws_access_key_id=None, aws_secret_access_key=None): - Config.__init__(self, config_file) + super(ServiceDef, self).__init__(config_file) self.aws_access_key_id = aws_access_key_id self.aws_secret_access_key = aws_secret_access_key script = Config.get(self, 'Pyami', 'scripts') @@ -37,22 +37,22 @@ class ServiceDef(Config): def get(self, name, default=None): - return Config.get(self, self.name, name, default) + return super(ServiceDef, self).get(self.name, name, default) def has_option(self, option): - return Config.has_option(self, self.name, option) + return super(ServiceDef, self).has_option(self.name, option) def getint(self, option, default=0): try: - val = Config.get(self, self.name, option) + val = super(ServiceDef, self).get(self.name, option) val = int(val) except: val = int(default) return val - + def getbool(self, option, default=False): try: - val = Config.get(self, self.name, option) + val = super(ServiceDef, self).get(self.name, option) if val.lower() == 'true': val = True else: @@ -60,7 +60,7 @@ class ServiceDef(Config): except: val = default return val - + def get_obj(self, name): """ Returns the AWS object associated with a given option. @@ -88,4 +88,4 @@ class ServiceDef(Config): obj = None return obj - + diff --git a/boto/services/sonofmmm.py b/boto/services/sonofmmm.py index acb7e610..3ef60838 100644 --- a/boto/services/sonofmmm.py +++ b/boto/services/sonofmmm.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -28,7 +28,7 @@ import mimetypes class SonOfMMM(Service): def __init__(self, config_file=None): - Service.__init__(self, config_file) + super(SonOfMMM, self).__init__(config_file) self.log_file = '%s.log' % self.instance_id self.log_path = os.path.join(self.working_dir, self.log_file) boto.set_file_logger(self.name, self.log_path) @@ -78,4 +78,4 @@ class SonOfMMM(Service): if self.output_bucket: key = self.output_bucket.new_key(self.log_file) key.set_contents_from_filename(self.log_path) - Service.shutdown(self) + super(SonOfMMM, self).shutdown() diff --git a/boto/ses/connection.py b/boto/ses/connection.py index 8652042d..5425ef35 100644 --- a/boto/ses/connection.py +++ b/boto/ses/connection.py @@ -47,7 +47,7 @@ class SESConnection(AWSAuthConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSAuthConnection.__init__(self, self.region.endpoint, + super(SESConnection, self).__init__(self.region.endpoint, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, debug, diff --git a/boto/sns/connection.py b/boto/sns/connection.py index 701892ce..1d459311 100644 --- a/boto/sns/connection.py +++ b/boto/sns/connection.py @@ -62,7 +62,7 @@ class SNSConnection(AWSQueryConnection): self.DefaultRegionEndpoint, connection_cls=SNSConnection) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(SNSConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, @@ -274,7 +274,7 @@ class SNSConnection(AWSQueryConnection): * For http, this would be a URL beginning with http * For https, this would be a URL beginning with https * For sqs, this would be the ARN of an SQS Queue - * For sms, this would be a phone number of an SMS-enabled device + * For sms, this would be a phone number of an SMS-enabled device """ params = {'TopicArn': topic, 'Protocol': protocol, diff --git a/boto/sqs/bigmessage.py b/boto/sqs/bigmessage.py index be04db1a..e47ec045 100644 --- a/boto/sqs/bigmessage.py +++ b/boto/sqs/bigmessage.py @@ -15,7 +15,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -55,7 +55,7 @@ class BigMessage(RawMessage): def __init__(self, queue=None, body=None, s3_url=None): self.s3_url = s3_url - RawMessage.__init__(self, queue, body) + super(BigMessage, self).__init__(queue, body) def _get_bucket_key(self, s3_url): bucket_name = key_name = None @@ -115,5 +115,5 @@ class BigMessage(RawMessage): if self.s3_url: key = self._get_s3_object(self.s3_url) key.delete() - RawMessage.delete(self) - + super(BigMessage, self).delete() + diff --git a/boto/sqs/connection.py b/boto/sqs/connection.py index 5e8d5d02..f403d639 100644 --- a/boto/sqs/connection.py +++ b/boto/sqs/connection.py @@ -48,7 +48,7 @@ class SQSConnection(AWSQueryConnection): region = SQSRegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) self.region = region - AWSQueryConnection.__init__(self, aws_access_key_id, + super(SQSConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, diff --git a/boto/sqs/message.py b/boto/sqs/message.py index 0afc15a9..a0364712 100644 --- a/boto/sqs/message.py +++ b/boto/sqs/message.py @@ -179,7 +179,7 @@ class MHMessage(Message): def __init__(self, queue=None, body=None, xml_attrs=None): if body == None or body == '': body = {} - Message.__init__(self, queue, body) + super(MHMessage, self).__init__(queue, body) def decode(self, value): try: @@ -251,9 +251,9 @@ class EncodedMHMessage(MHMessage): value = base64.b64decode(value) except: raise SQSDecodeError('Unable to decode message', self) - return MHMessage.decode(self, value) + return super(EncodedMHMessage, self).decode(value) def encode(self, value): - value = MHMessage.encode(self, value) + value = super(EncodedMHMessage, self).encode(value) return base64.b64encode(value) diff --git a/boto/sqs/regioninfo.py b/boto/sqs/regioninfo.py index 66d67336..9f7d7f12 100644 --- a/boto/sqs/regioninfo.py +++ b/boto/sqs/regioninfo.py @@ -16,7 +16,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -28,5 +28,5 @@ class SQSRegionInfo(RegionInfo): def __init__(self, connection=None, name=None, endpoint=None): from boto.sqs.connection import SQSConnection - RegionInfo.__init__(self, connection, name, endpoint, + super(SQSRegionInfo, self).__init__(connection, name, endpoint, SQSConnection) diff --git a/boto/sts/connection.py b/boto/sts/connection.py index 49dcd771..820d8b38 100644 --- a/boto/sts/connection.py +++ b/boto/sts/connection.py @@ -77,7 +77,7 @@ class STSConnection(AWSQueryConnection): self.region = region self.anon = anon self._mutex = threading.Semaphore() - AWSQueryConnection.__init__(self, aws_access_key_id, + super(STSConnection, self).__init__(aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, proxy_user, proxy_pass, diff --git a/boto/support/layer1.py b/boto/support/layer1.py index c5180636..3b52efd9 100644 --- a/boto/support/layer1.py +++ b/boto/support/layer1.py @@ -108,7 +108,7 @@ class SupportConnection(AWSQueryConnection): region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint) kwargs['host'] = region.endpoint - AWSQueryConnection.__init__(self, **kwargs) + super(SupportConnection, self).__init__(**kwargs) self.region = region def _required_auth_capability(self): diff --git a/boto/swf/layer1.py b/boto/swf/layer1.py index 264016bd..d027abd4 100644 --- a/boto/swf/layer1.py +++ b/boto/swf/layer1.py @@ -79,7 +79,7 @@ class Layer1(AWSAuthConnection): break self.region = region - AWSAuthConnection.__init__(self, self.region.endpoint, + super(Layer1, self).__init__(self.region.endpoint, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, debug, session_token) diff --git a/boto/utils.py b/boto/utils.py index 56db88e5..ec81f4da 100644 --- a/boto/utils.py +++ b/boto/utils.py @@ -600,7 +600,7 @@ class AuthSMTPHandler(logging.handlers.SMTPHandler): We have extended the constructor to accept a username/password for SMTP authentication. """ - logging.handlers.SMTPHandler.__init__(self, mailhost, fromaddr, + super(AuthSMTPHandler, self).__init__(mailhost, fromaddr, toaddrs, subject) self.username = username self.password = password diff --git a/boto/vpc/customergateway.py b/boto/vpc/customergateway.py index 76c34831..8f19a81a 100644 --- a/boto/vpc/customergateway.py +++ b/boto/vpc/customergateway.py @@ -29,7 +29,7 @@ from boto.ec2.ec2object import TaggedEC2Object class CustomerGateway(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(CustomerGateway, self).__init__(connection) self.id = None self.type = None self.state = None diff --git a/boto/vpc/dhcpoptions.py b/boto/vpc/dhcpoptions.py index 74846838..758d452c 100644 --- a/boto/vpc/dhcpoptions.py +++ b/boto/vpc/dhcpoptions.py @@ -14,7 +14,7 @@ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. @@ -33,7 +33,7 @@ class DhcpValueSet(list): def endElement(self, name, value, connection): if name == 'value': self.append(value) - + class DhcpConfigSet(dict): def startElement(self, name, attrs, connection): @@ -45,19 +45,19 @@ class DhcpConfigSet(dict): def endElement(self, name, value, connection): if name == 'key': self._name = value - + class DhcpOptions(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(DhcpOptions, self).__init__(connection) self.id = None self.options = None def __repr__(self): return 'DhcpOptions:%s' % self.id - + def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(DhcpOptions, self).startElement(name, attrs, connection) if retval is not None: return retval if name == 'dhcpConfigurationSet': diff --git a/boto/vpc/internetgateway.py b/boto/vpc/internetgateway.py index 011fdee1..09f1fe04 100644 --- a/boto/vpc/internetgateway.py +++ b/boto/vpc/internetgateway.py @@ -28,7 +28,7 @@ from boto.resultset import ResultSet class InternetGateway(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(InternetGateway, self).__init__(connection) self.id = None self.attachments = [] diff --git a/boto/vpc/networkacl.py b/boto/vpc/networkacl.py index 47714791..d38e0283 100644 --- a/boto/vpc/networkacl.py +++ b/boto/vpc/networkacl.py @@ -51,7 +51,7 @@ class Icmp(object): class NetworkAcl(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(NetworkAcl, self).__init__(connection) self.id = None self.vpc_id = None self.network_acl_entries = [] diff --git a/boto/vpc/routetable.py b/boto/vpc/routetable.py index b3f00553..7f83717e 100644 --- a/boto/vpc/routetable.py +++ b/boto/vpc/routetable.py @@ -29,7 +29,7 @@ from boto.resultset import ResultSet class RouteTable(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(RouteTable, self).__init__(connection) self.id = None self.vpc_id = None self.routes = [] diff --git a/boto/vpc/subnet.py b/boto/vpc/subnet.py index f87d72c2..4d6f9025 100644 --- a/boto/vpc/subnet.py +++ b/boto/vpc/subnet.py @@ -28,7 +28,7 @@ from boto.ec2.ec2object import TaggedEC2Object class Subnet(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(Subnet, self).__init__(connection) self.id = None self.vpc_id = None self.state = None diff --git a/boto/vpc/vpc.py b/boto/vpc/vpc.py index 2eb480d1..575a1c45 100644 --- a/boto/vpc/vpc.py +++ b/boto/vpc/vpc.py @@ -39,7 +39,7 @@ class VPC(TaggedEC2Object): :ivar is_default: Indicates whether the VPC is the default VPC. :ivar instance_tenancy: The allowed tenancy of instances launched into the VPC. """ - TaggedEC2Object.__init__(self, connection) + super(VPC, self).__init__(connection) self.id = None self.dhcp_options_id = None self.state = None diff --git a/boto/vpc/vpnconnection.py b/boto/vpc/vpnconnection.py index c36492f5..cd8b11a6 100644 --- a/boto/vpc/vpnconnection.py +++ b/boto/vpc/vpnconnection.py @@ -152,7 +152,7 @@ class VpnConnection(TaggedEC2Object): """ def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(VpnConnection, self).__init__(connection) self.id = None self.state = None self.customer_gateway_configuration = None diff --git a/boto/vpc/vpngateway.py b/boto/vpc/vpngateway.py index fe476d93..80598109 100644 --- a/boto/vpc/vpngateway.py +++ b/boto/vpc/vpngateway.py @@ -45,7 +45,7 @@ class Attachment(object): class VpnGateway(TaggedEC2Object): def __init__(self, connection=None): - TaggedEC2Object.__init__(self, connection) + super(VpnGateway, self).__init__(connection) self.id = None self.type = None self.state = None @@ -56,7 +56,7 @@ class VpnGateway(TaggedEC2Object): return 'VpnGateway:%s' % self.id def startElement(self, name, attrs, connection): - retval = TaggedEC2Object.startElement(self, name, attrs, connection) + retval = super(VpnGateway, self).startElement(name, attrs, connection) if retval is not None: return retval if name == 'item': diff --git a/tests/unit/ec2/test_volume.py b/tests/unit/ec2/test_volume.py index 14f0bcb6..7acc6181 100644 --- a/tests/unit/ec2/test_volume.py +++ b/tests/unit/ec2/test_volume.py @@ -39,7 +39,6 @@ class VolumeTests(unittest.TestCase): volume = Volume() volume.startElement("some name", "some attrs", None) startElement.assert_called_with( - volume, "some name", "some attrs", None |