Back to Black

This commit is contained in:
Matěj Cepl 2020-10-06 08:46:05 +02:00
commit 5697ff87a8
112 changed files with 1803 additions and 977 deletions

View file

@ -523,7 +523,10 @@ class LifecycleAndFilter(BaseModel):
for key, value in self.tags.items():
data.append(
{"type": "LifecycleTagPredicate", "tag": {"key": key, "value": value},}
{
"type": "LifecycleTagPredicate",
"tag": {"key": key, "value": value},
}
)
return data
@ -1129,7 +1132,11 @@ class FakeBucket(CloudFormationModel):
@classmethod
def update_from_cloudformation_json(
cls, original_resource, new_resource_name, cloudformation_json, region_name,
cls,
original_resource,
new_resource_name,
cloudformation_json,
region_name,
):
properties = cloudformation_json["Properties"]
@ -1469,7 +1476,8 @@ class S3Backend(BaseBackend):
raise MissingKey(key_name)
self.tagger.delete_all_tags_for_resource(key.arn)
self.tagger.tag_resource(
key.arn, [{"Key": k, "Value": v} for (k, v) in tags.items()],
key.arn,
[{"Key": k, "Value": v} for (k, v) in tags.items()],
)
return key
@ -1481,7 +1489,8 @@ class S3Backend(BaseBackend):
bucket = self.get_bucket(bucket_name)
self.tagger.delete_all_tags_for_resource(bucket.arn)
self.tagger.tag_resource(
bucket.arn, [{"Key": key, "Value": value} for key, value in tags.items()],
bucket.arn,
[{"Key": key, "Value": value} for key, value in tags.items()],
)
def delete_bucket_tagging(self, bucket_name):

View file

@ -406,8 +406,8 @@ class ResponseObject(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
template = self.response_template(S3_BUCKET_CORS_RESPONSE)
return template.render(cors=cors)
elif "notification" in querystring:
notification_configuration = self.backend.get_bucket_notification_configuration(
bucket_name
notification_configuration = (
self.backend.get_bucket_notification_configuration(bucket_name)
)
if not notification_configuration:
return 200, {}, ""

View file

@ -98,7 +98,7 @@ def undo_clean_key_name(key_name):
class _VersionedKeyStore(dict):
""" A simplified/modified version of Django's `MultiValueDict` taken from:
"""A simplified/modified version of Django's `MultiValueDict` taken from:
https://github.com/django/django/blob/70576740b0bb5289873f5a9a9a4e1a26b2c330e5/django/utils/datastructures.py#L282
"""