diff options
Diffstat (limited to 'boto')
-rw-r--r-- | boto/ec2/cloudwatch/alarm.py | 8 | ||||
-rw-r--r-- | boto/ec2/connection.py | 2 | ||||
-rw-r--r-- | boto/manage/cmdshell.py | 2 | ||||
-rw-r--r-- | boto/manage/volume.py | 4 | ||||
-rw-r--r-- | boto/mturk/connection.py | 26 | ||||
-rw-r--r-- | boto/mturk/qualification.py | 2 | ||||
-rw-r--r-- | boto/mturk/question.py | 4 | ||||
-rw-r--r-- | boto/provider.py | 112 | ||||
-rw-r--r-- | boto/roboto/awsqueryrequest.py | 2 | ||||
-rw-r--r-- | boto/s3/bucket.py | 2 | ||||
-rw-r--r-- | boto/s3/key.py | 2 | ||||
-rw-r--r-- | boto/sdb/db/manager/sdbmanager.py | 36 | ||||
-rw-r--r-- | boto/sdb/db/property.py | 4 | ||||
-rw-r--r-- | boto/sdb/db/test_db.py | 2 | ||||
-rw-r--r-- | boto/swf/layer1.py | 2 | ||||
-rw-r--r-- | boto/utils.py | 8 |
16 files changed, 109 insertions, 109 deletions
diff --git a/boto/ec2/cloudwatch/alarm.py b/boto/ec2/cloudwatch/alarm.py index 539ad950..b0b9fd03 100644 --- a/boto/ec2/cloudwatch/alarm.py +++ b/boto/ec2/cloudwatch/alarm.py @@ -56,10 +56,10 @@ class MetricAlarm(object): INSUFFICIENT_DATA = 'INSUFFICIENT_DATA' _cmp_map = { - '>=' : 'GreaterThanOrEqualToThreshold', - '>' : 'GreaterThanThreshold', - '<' : 'LessThanThreshold', - '<=' : 'LessThanOrEqualToThreshold', + '>=': 'GreaterThanOrEqualToThreshold', + '>': 'GreaterThanThreshold', + '<': 'LessThanThreshold', + '<=': 'LessThanOrEqualToThreshold', } _rev_cmp_map = dict((v, k) for (k, v) in _cmp_map.iteritems()) diff --git a/boto/ec2/connection.py b/boto/ec2/connection.py index 3e78d226..ced4f79b 100644 --- a/boto/ec2/connection.py +++ b/boto/ec2/connection.py @@ -118,7 +118,7 @@ class EC2Connection(AWSQueryConnection): value = [value] j = 1 for v in value: - params['Filter.%d.Value.%d' % (i,j)] = v + params['Filter.%d.Value.%d' % (i, j)] = v j += 1 i += 1 diff --git a/boto/manage/cmdshell.py b/boto/manage/cmdshell.py index b21898c0..853f752c 100644 --- a/boto/manage/cmdshell.py +++ b/boto/manage/cmdshell.py @@ -54,7 +54,7 @@ class SSHClient(object): username=self.uname, pkey=self._pkey) return - except socket.error, (value,message): + except socket.error, (value, message): if value == 61 or value == 111: print 'SSH Connection refused, will retry in 5 seconds' time.sleep(5) diff --git a/boto/manage/volume.py b/boto/manage/volume.py index 52c344fe..54a83d2e 100644 --- a/boto/manage/volume.py +++ b/boto/manage/volume.py @@ -194,7 +194,7 @@ class Volume(Model): snapshot.date = boto.utils.parse_ts(snapshot.start_time) snapshot.keep = True snaps.append(snapshot) - snaps.sort(cmp=lambda x,y: cmp(x.date, y.date)) + snaps.sort(cmp=lambda x, y: cmp(x.date, y.date)) return snaps def attach(self, server=None): @@ -376,7 +376,7 @@ class Volume(Model): for snap in partial_week[1:]: snap.keep = False # Keep the first snapshot of each week for the previous 4 weeks - for i in range(0,4): + for i in range(0, 4): weeks_worth = self.get_snapshot_range(snaps, week_boundary-one_week, week_boundary) if len(weeks_worth) > 1: for snap in weeks_worth[1:]: diff --git a/boto/mturk/connection.py b/boto/mturk/connection.py index 375da5a1..af0abb4a 100644 --- a/boto/mturk/connection.py +++ b/boto/mturk/connection.py @@ -176,9 +176,9 @@ class MTurkConnection(AWSQueryConnection): # Handle basic required arguments and set up params dict params = {'Question': question_param.get_as_xml(), - 'LifetimeInSeconds' : + 'LifetimeInSeconds': self.duration_as_seconds(lifetime), - 'MaxAssignments' : max_assignments, + 'MaxAssignments': max_assignments, } # if hit type specified then add it @@ -351,7 +351,7 @@ class MTurkConnection(AWSQueryConnection): def approve_assignment(self, assignment_id, feedback=None): """ """ - params = {'AssignmentId' : assignment_id,} + params = {'AssignmentId': assignment_id,} if feedback: params['RequesterFeedback'] = feedback return self._process_request('ApproveAssignment', params) @@ -359,7 +359,7 @@ class MTurkConnection(AWSQueryConnection): def reject_assignment(self, assignment_id, feedback=None): """ """ - params = {'AssignmentId' : assignment_id,} + params = {'AssignmentId': assignment_id,} if feedback: params['RequesterFeedback'] = feedback return self._process_request('RejectAssignment', params) @@ -367,7 +367,7 @@ class MTurkConnection(AWSQueryConnection): def get_hit(self, hit_id, response_groups=None): """ """ - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} # Handle optional response groups argument if response_groups: self.build_list_params(params, response_groups, 'ResponseGroup') @@ -383,7 +383,7 @@ class MTurkConnection(AWSQueryConnection): Reviewing. Similarly, only Reviewing HITs can be reverted back to a status of Reviewable. """ - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} if revert: params['Revert'] = revert return self._process_request('SetHITAsReviewing', params) @@ -405,7 +405,7 @@ class MTurkConnection(AWSQueryConnection): It is not possible to re-enable a HIT once it has been disabled. To make the work from a disabled HIT available again, create a new HIT. """ - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} # Handle optional response groups argument if response_groups: self.build_list_params(params, response_groups, 'ResponseGroup') @@ -422,7 +422,7 @@ class MTurkConnection(AWSQueryConnection): reviewable, then call GetAssignmentsForHIT to retrieve the assignments. Disposing of a HIT removes the HIT from the results of a call to GetReviewableHITs. """ - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} return self._process_request('DisposeHIT', params) def expire_hit(self, hit_id): @@ -439,7 +439,7 @@ class MTurkConnection(AWSQueryConnection): submitted, the expired HIT becomes"reviewable", and will be returned by a call to GetReviewableHITs. """ - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} return self._process_request('ForceExpireHIT', params) def extend_hit(self, hit_id, assignments_increment=None, expiration_increment=None): @@ -461,7 +461,7 @@ class MTurkConnection(AWSQueryConnection): (assignments_increment is not None and expiration_increment is not None): raise ValueError("Must specify either assignments_increment or expiration_increment, but not both") - params = {'HITId' : hit_id,} + params = {'HITId': hit_id,} if assignments_increment: params['MaxAssignmentsIncrement'] = assignments_increment if expiration_increment: @@ -568,9 +568,9 @@ class MTurkConnection(AWSQueryConnection): """ - params = {'Name' : name, - 'Description' : description, - 'QualificationTypeStatus' : status, + params = {'Name': name, + 'Description': description, + 'QualificationTypeStatus': status, } if retry_delay is not None: params['RetryDelayInSeconds'] = retry_delay diff --git a/boto/mturk/qualification.py b/boto/mturk/qualification.py index 6b620ec7..8272d6d1 100644 --- a/boto/mturk/qualification.py +++ b/boto/mturk/qualification.py @@ -35,7 +35,7 @@ class Qualifications: for n, req in enumerate(self.requirements): reqparams = req.get_as_params() for rp in reqparams: - params['QualificationRequirement.%s.%s' % ((n+1),rp) ] = reqparams[rp] + params['QualificationRequirement.%s.%s' % ((n+1), rp) ] = reqparams[rp] return params diff --git a/boto/mturk/question.py b/boto/mturk/question.py index 3e9271e8..050269a9 100644 --- a/boto/mturk/question.py +++ b/boto/mturk/question.py @@ -250,8 +250,8 @@ class Constraint(object): def get_attributes(self): pairs = zip(self.attribute_names, self.attribute_values) attrs = ' '.join( - '%s="%d"' % (name,value) - for (name,value) in pairs + '%s="%d"' % (name, value) + for (name, value) in pairs if value is not None ) return attrs diff --git a/boto/provider.py b/boto/provider.py index 37ceae72..111c0e47 100644 --- a/boto/provider.py +++ b/boto/provider.py @@ -65,93 +65,93 @@ STORAGE_RESPONSE_ERROR = 'StorageResponseError' class Provider(object): CredentialMap = { - 'aws' : ('aws_access_key_id', 'aws_secret_access_key'), - 'google' : ('gs_access_key_id', 'gs_secret_access_key'), + 'aws': ('aws_access_key_id', 'aws_secret_access_key'), + 'google': ('gs_access_key_id', 'gs_secret_access_key'), } AclClassMap = { - 'aws' : Policy, - 'google' : ACL + 'aws': Policy, + 'google': ACL } CannedAclsMap = { - 'aws' : CannedS3ACLStrings, - 'google' : CannedGSACLStrings + 'aws': CannedS3ACLStrings, + 'google': CannedGSACLStrings } HostKeyMap = { - 'aws' : 's3', - 'google' : 'gs' + 'aws': 's3', + 'google': 'gs' } ChunkedTransferSupport = { - 'aws' : False, - 'google' : True + 'aws': False, + 'google': True } # If you update this map please make sure to put "None" for the # right-hand-side for any headers that don't apply to a provider, rather # than simply leaving that header out (which would cause KeyErrors). HeaderInfoMap = { - 'aws' : { - HEADER_PREFIX_KEY : AWS_HEADER_PREFIX, - METADATA_PREFIX_KEY : AWS_HEADER_PREFIX + 'meta-', - ACL_HEADER_KEY : AWS_HEADER_PREFIX + 'acl', - AUTH_HEADER_KEY : 'AWS', - COPY_SOURCE_HEADER_KEY : AWS_HEADER_PREFIX + 'copy-source', - COPY_SOURCE_VERSION_ID_HEADER_KEY : AWS_HEADER_PREFIX + + 'aws': { + HEADER_PREFIX_KEY: AWS_HEADER_PREFIX, + METADATA_PREFIX_KEY: AWS_HEADER_PREFIX + 'meta-', + ACL_HEADER_KEY: AWS_HEADER_PREFIX + 'acl', + AUTH_HEADER_KEY: 'AWS', + COPY_SOURCE_HEADER_KEY: AWS_HEADER_PREFIX + 'copy-source', + COPY_SOURCE_VERSION_ID_HEADER_KEY: AWS_HEADER_PREFIX + 'copy-source-version-id', - COPY_SOURCE_RANGE_HEADER_KEY : AWS_HEADER_PREFIX + + COPY_SOURCE_RANGE_HEADER_KEY: AWS_HEADER_PREFIX + 'copy-source-range', - DATE_HEADER_KEY : AWS_HEADER_PREFIX + 'date', - DELETE_MARKER_HEADER_KEY : AWS_HEADER_PREFIX + 'delete-marker', - METADATA_DIRECTIVE_HEADER_KEY : AWS_HEADER_PREFIX + + DATE_HEADER_KEY: AWS_HEADER_PREFIX + 'date', + DELETE_MARKER_HEADER_KEY: AWS_HEADER_PREFIX + 'delete-marker', + METADATA_DIRECTIVE_HEADER_KEY: AWS_HEADER_PREFIX + 'metadata-directive', - RESUMABLE_UPLOAD_HEADER_KEY : None, - SECURITY_TOKEN_HEADER_KEY : AWS_HEADER_PREFIX + 'security-token', - SERVER_SIDE_ENCRYPTION_KEY : AWS_HEADER_PREFIX + 'server-side-encryption', - VERSION_ID_HEADER_KEY : AWS_HEADER_PREFIX + 'version-id', - STORAGE_CLASS_HEADER_KEY : AWS_HEADER_PREFIX + 'storage-class', - MFA_HEADER_KEY : AWS_HEADER_PREFIX + 'mfa', + RESUMABLE_UPLOAD_HEADER_KEY: None, + SECURITY_TOKEN_HEADER_KEY: AWS_HEADER_PREFIX + 'security-token', + SERVER_SIDE_ENCRYPTION_KEY: AWS_HEADER_PREFIX + 'server-side-encryption', + VERSION_ID_HEADER_KEY: AWS_HEADER_PREFIX + 'version-id', + STORAGE_CLASS_HEADER_KEY: AWS_HEADER_PREFIX + 'storage-class', + MFA_HEADER_KEY: AWS_HEADER_PREFIX + 'mfa', }, - 'google' : { - HEADER_PREFIX_KEY : GOOG_HEADER_PREFIX, - METADATA_PREFIX_KEY : GOOG_HEADER_PREFIX + 'meta-', - ACL_HEADER_KEY : GOOG_HEADER_PREFIX + 'acl', - AUTH_HEADER_KEY : 'GOOG1', - COPY_SOURCE_HEADER_KEY : GOOG_HEADER_PREFIX + 'copy-source', - COPY_SOURCE_VERSION_ID_HEADER_KEY : GOOG_HEADER_PREFIX + + 'google': { + HEADER_PREFIX_KEY: GOOG_HEADER_PREFIX, + METADATA_PREFIX_KEY: GOOG_HEADER_PREFIX + 'meta-', + ACL_HEADER_KEY: GOOG_HEADER_PREFIX + 'acl', + AUTH_HEADER_KEY: 'GOOG1', + COPY_SOURCE_HEADER_KEY: GOOG_HEADER_PREFIX + 'copy-source', + COPY_SOURCE_VERSION_ID_HEADER_KEY: GOOG_HEADER_PREFIX + 'copy-source-version-id', - COPY_SOURCE_RANGE_HEADER_KEY : None, - DATE_HEADER_KEY : GOOG_HEADER_PREFIX + 'date', - DELETE_MARKER_HEADER_KEY : GOOG_HEADER_PREFIX + 'delete-marker', - METADATA_DIRECTIVE_HEADER_KEY : GOOG_HEADER_PREFIX + + COPY_SOURCE_RANGE_HEADER_KEY: None, + DATE_HEADER_KEY: GOOG_HEADER_PREFIX + 'date', + DELETE_MARKER_HEADER_KEY: GOOG_HEADER_PREFIX + 'delete-marker', + METADATA_DIRECTIVE_HEADER_KEY: GOOG_HEADER_PREFIX + 'metadata-directive', - RESUMABLE_UPLOAD_HEADER_KEY : GOOG_HEADER_PREFIX + 'resumable', - SECURITY_TOKEN_HEADER_KEY : GOOG_HEADER_PREFIX + 'security-token', - SERVER_SIDE_ENCRYPTION_KEY : None, + RESUMABLE_UPLOAD_HEADER_KEY: GOOG_HEADER_PREFIX + 'resumable', + SECURITY_TOKEN_HEADER_KEY: GOOG_HEADER_PREFIX + 'security-token', + SERVER_SIDE_ENCRYPTION_KEY: None, # Note that this version header is not to be confused with # the Google Cloud Storage 'x-goog-api-version' header. - VERSION_ID_HEADER_KEY : GOOG_HEADER_PREFIX + 'version-id', - STORAGE_CLASS_HEADER_KEY : None, - MFA_HEADER_KEY : None, + VERSION_ID_HEADER_KEY: GOOG_HEADER_PREFIX + 'version-id', + STORAGE_CLASS_HEADER_KEY: None, + MFA_HEADER_KEY: None, } } ErrorMap = { - 'aws' : { - STORAGE_COPY_ERROR : boto.exception.S3CopyError, - STORAGE_CREATE_ERROR : boto.exception.S3CreateError, - STORAGE_DATA_ERROR : boto.exception.S3DataError, - STORAGE_PERMISSIONS_ERROR : boto.exception.S3PermissionsError, - STORAGE_RESPONSE_ERROR : boto.exception.S3ResponseError, + 'aws': { + STORAGE_COPY_ERROR: boto.exception.S3CopyError, + STORAGE_CREATE_ERROR: boto.exception.S3CreateError, + STORAGE_DATA_ERROR: boto.exception.S3DataError, + STORAGE_PERMISSIONS_ERROR: boto.exception.S3PermissionsError, + STORAGE_RESPONSE_ERROR: boto.exception.S3ResponseError, }, - 'google' : { - STORAGE_COPY_ERROR : boto.exception.GSCopyError, - STORAGE_CREATE_ERROR : boto.exception.GSCreateError, - STORAGE_DATA_ERROR : boto.exception.GSDataError, - STORAGE_PERMISSIONS_ERROR : boto.exception.GSPermissionsError, - STORAGE_RESPONSE_ERROR : boto.exception.GSResponseError, + 'google': { + STORAGE_COPY_ERROR: boto.exception.GSCopyError, + STORAGE_CREATE_ERROR: boto.exception.GSCreateError, + STORAGE_DATA_ERROR: boto.exception.GSDataError, + STORAGE_PERMISSIONS_ERROR: boto.exception.GSPermissionsError, + STORAGE_RESPONSE_ERROR: boto.exception.GSResponseError, } } diff --git a/boto/roboto/awsqueryrequest.py b/boto/roboto/awsqueryrequest.py index 9e05ac63..4f81b087 100644 --- a/boto/roboto/awsqueryrequest.py +++ b/boto/roboto/awsqueryrequest.py @@ -230,7 +230,7 @@ class AWSQueryRequest(object): self.request_params['Filter.%d.Name' % (i+1)] = name for j, value in enumerate(boto.utils.mklist(filters[name])): Encoder.encode(filter, self.request_params, value, - 'Filter.%d.Value.%d' % (i+1,j+1)) + 'Filter.%d.Value.%d' % (i+1, j+1)) def process_args(self, **args): """ diff --git a/boto/s3/bucket.py b/boto/s3/bucket.py index 4abfdaa5..434ff9f7 100644 --- a/boto/s3/bucket.py +++ b/boto/s3/bucket.py @@ -164,7 +164,7 @@ class Bucket(object): if version_id: query_args.append('versionId=%s' % version_id) if response_headers: - for rk,rv in response_headers.iteritems(): + for rk, rv in response_headers.iteritems(): query_args.append('%s=%s' % (rk, urllib.quote(rv))) if query_args: query_args = '&'.join(query_args) diff --git a/boto/s3/key.py b/boto/s3/key.py index 71c3b91f..433f0bcc 100644 --- a/boto/s3/key.py +++ b/boto/s3/key.py @@ -171,7 +171,7 @@ class Key(object): response_headers = self.resp.msg self.metadata = boto.utils.get_aws_metadata(response_headers, provider) - for name,value in response_headers.items(): + for name, value in response_headers.items(): # To get correct size for Range GETs, use Content-Range # header if one was returned. If not, use Content-Length # header. diff --git a/boto/sdb/db/manager/sdbmanager.py b/boto/sdb/db/manager/sdbmanager.py index 7f20350e..39d7120d 100644 --- a/boto/sdb/db/manager/sdbmanager.py +++ b/boto/sdb/db/manager/sdbmanager.py @@ -49,15 +49,15 @@ class SDBConverter(object): """ def __init__(self, manager): self.manager = manager - self.type_map = { bool : (self.encode_bool, self.decode_bool), - int : (self.encode_int, self.decode_int), - long : (self.encode_long, self.decode_long), - float : (self.encode_float, self.decode_float), - Model : (self.encode_reference, self.decode_reference), - Key : (self.encode_reference, self.decode_reference), - datetime : (self.encode_datetime, self.decode_datetime), - date : (self.encode_date, self.decode_date), - time : (self.encode_time, self.decode_time), + self.type_map = { bool: (self.encode_bool, self.decode_bool), + int: (self.encode_int, self.decode_int), + long: (self.encode_long, self.decode_long), + float: (self.encode_float, self.decode_float), + Model: (self.encode_reference, self.decode_reference), + Key: (self.encode_reference, self.decode_reference), + datetime: (self.encode_datetime, self.decode_datetime), + date: (self.encode_date, self.decode_date), + time: (self.encode_time, self.decode_time), Blob: (self.encode_blob, self.decode_blob), str: (self.encode_string, self.decode_string), } @@ -92,7 +92,7 @@ class SDBConverter(object): # We support lists up to 1,000 attributes, since # SDB technically only supports 1024 attributes anyway values = {} - for k,v in enumerate(value): + for k, v in enumerate(value): values["%03d" % k] = v return self.encode_map(prop, values) @@ -128,7 +128,7 @@ class SDBConverter(object): dec_val = {} for val in value: if val != None: - k,v = self.decode_map_element(item_type, val) + k, v = self.decode_map_element(item_type, val) try: k = int(k) except: @@ -143,7 +143,7 @@ class SDBConverter(object): ret_value = {} item_type = getattr(prop, "item_type") for val in value: - k,v = self.decode_map_element(item_type, val) + k, v = self.decode_map_element(item_type, val) ret_value[k] = v return ret_value @@ -152,7 +152,7 @@ class SDBConverter(object): import urllib key = value if ":" in value: - key, value = value.split(':',1) + key, value = value.split(':', 1) key = urllib.unquote(key) if Model in item_type.mro(): value = item_type(id=value) @@ -470,7 +470,7 @@ class SDBManager(object): def load_object(self, obj): if not obj._loaded: - a = self.domain.get_attributes(obj.id,consistent_read=self.consistent) + a = self.domain.get_attributes(obj.id, consistent_read=self.consistent) if a.has_key('__type__'): for prop in obj.properties(hidden=False): if a.has_key(prop.name): @@ -485,7 +485,7 @@ class SDBManager(object): def get_object(self, cls, id, a=None): obj = None if not a: - a = self.domain.get_attributes(id,consistent_read=self.consistent) + a = self.domain.get_attributes(id, consistent_read=self.consistent) if a.has_key('__type__'): if not cls or a['__type__'] != cls.__name__: cls = find_class(a['__module__'], a['__type__']) @@ -534,7 +534,7 @@ class SDBManager(object): if name != "itemName()": name = '`%s`' % name if val == None: - if op in ('is','='): + if op in ('is', '='): return "%(name)s is null" % {"name": name} elif op in ('is not', '!='): return "%s is not null" % name @@ -698,7 +698,7 @@ class SDBManager(object): self.domain.put_attributes(obj.id, {name : value}, replace=True) def get_property(self, prop, obj, name): - a = self.domain.get_attributes(obj.id,consistent_read=self.consistent) + a = self.domain.get_attributes(obj.id, consistent_read=self.consistent) # try to get the attribute value from SDB if name in a: @@ -715,7 +715,7 @@ class SDBManager(object): self.domain.delete_attributes(obj.id, name) def get_key_value(self, obj, name): - a = self.domain.get_attributes(obj.id, name,consistent_read=self.consistent) + a = self.domain.get_attributes(obj.id, name, consistent_read=self.consistent) if a.has_key(name): return a[name] else: diff --git a/boto/sdb/db/property.py b/boto/sdb/db/property.py index 1387be9d..79e61e49 100644 --- a/boto/sdb/db/property.py +++ b/boto/sdb/db/property.py @@ -488,7 +488,7 @@ class ReferenceProperty(Property): This causes bad things to happen""" if value != None and (obj.id == value or (hasattr(value, "id") and obj.id == value.id)): raise ValueError, "Can not associate an object with itself!" - return super(ReferenceProperty, self).__set__(obj,value) + return super(ReferenceProperty, self).__set__(obj, value) def __property_config__(self, model_class, property_name): Property.__property_config__(self, model_class, property_name) @@ -643,7 +643,7 @@ class ListProperty(Property): value = [value] elif value == None: # Override to allow them to set this to "None" to remove everything value = [] - return super(ListProperty, self).__set__(obj,value) + return super(ListProperty, self).__set__(obj, value) class MapProperty(Property): diff --git a/boto/sdb/db/test_db.py b/boto/sdb/db/test_db.py index 0c345abd..b872f7f8 100644 --- a/boto/sdb/db/test_db.py +++ b/boto/sdb/db/test_db.py @@ -153,7 +153,7 @@ def test_list(): t = TestList() _objects['test_list_t'] = t t.name = 'a list of ints' - t.nums = [1,2,3,4,5] + t.nums = [1, 2, 3, 4, 5] t.put() tt = TestList.get_by_id(t.id) _objects['test_list_tt'] = tt diff --git a/boto/swf/layer1.py b/boto/swf/layer1.py index 73e67ec0..d521059d 100644 --- a/boto/swf/layer1.py +++ b/boto/swf/layer1.py @@ -62,7 +62,7 @@ class Layer1(AWSAuthConnection): 'com.amazonaws.swf.base.model#OperationNotPermittedFault': swf_exceptions.SWFOperationNotPermittedError, 'com.amazonaws.swf.base.model#TypeAlreadyExistsFault': - swf_exceptions.SWFTypeAlreadyExistsError , + swf_exceptions.SWFTypeAlreadyExistsError, } ResponseError = SWFResponseError diff --git a/boto/utils.py b/boto/utils.py index a2bf386d..40f6562f 100644 --- a/boto/utils.py +++ b/boto/utils.py @@ -133,7 +133,7 @@ def canonical_string(method, path, headers, expires=None, qsa = [ a.split('=', 1) for a in qsa] qsa = [ unquote_v(a) for a in qsa if a[0] in qsa_of_interest ] if len(qsa) > 0: - qsa.sort(cmp=lambda x,y:cmp(x[0], y[0])) + qsa.sort(cmp=lambda x, y:cmp(x[0], y[0])) qsa = [ '='.join(a) for a in qsa ] buf += '?' buf += '&'.join(qsa) @@ -225,7 +225,7 @@ def get_instance_metadata(version='latest', url='http://169.254.169.254'): def get_instance_userdata(version='latest', sep=None, url='http://169.254.169.254'): - ud_url = '%s/%s/user-data' % (url,version) + ud_url = '%s/%s/user-data' % (url, version) user_data = retry_url(ud_url, retry_on_404=False) if user_data: if sep: @@ -651,7 +651,7 @@ def write_mime_multipart(content, compress=False, deftype='text/plain', delimite :rtype: str: """ wrapper = MIMEMultipart() - for name,con in content: + for name, con in content: definite_type = guess_mime_type(con, deftype) maintype, subtype = definite_type.split('/', 1) if maintype == 'text': @@ -697,7 +697,7 @@ def guess_mime_type(content, deftype): '#cloud-boothook' : 'text/cloud-boothook' } rtype = deftype - for possible_type,mimetype in starts_with_mappings.items(): + for possible_type, mimetype in starts_with_mappings.items(): if content.startswith(possible_type): rtype = mimetype break |