Skip to content

Commit 34d6ead

Browse files
committed
Reverse style changes
1 parent 7f83c85 commit 34d6ead

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scrapy_jsonschema/item.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Draft4Validator,
88
Draft6Validator,
99
Draft7Validator,
10-
FormatChecker,
10+
FormatChecker
1111
)
1212
from scrapy_jsonschema.draft import (
1313
JSON_SCHEMA_DRAFT_3,
@@ -63,42 +63,42 @@ def __new__(mcs, class_name, bases, attrs):
6363
cls = super(JsonSchemaMeta, mcs).__new__(mcs, class_name, bases, attrs)
6464

6565
fields = {}
66-
schema = attrs.get("jsonschema", {})
66+
schema = attrs.get('jsonschema', {})
6767
if cls.merge_schema:
6868
# priority: left to right
6969
for base in bases:
70-
base_schema = getattr(base, "jsonschema", None)
70+
base_schema = getattr(base, 'jsonschema', None)
7171
if base_schema:
7272
schema = _merge_schema(schema, base_schema)
73-
setattr(cls, "jsonschema", schema)
73+
setattr(cls, 'jsonschema', schema)
7474
if not schema:
7575
raise ValueError(
7676
'{} must contain "jsonschema" attribute'.format(cls.__name__)
7777
)
7878
cls.validator = cls._get_validator(schema)
7979
cls.validator.check_schema(schema)
80-
for k in schema["properties"]:
80+
for k in schema['properties']:
8181
fields[k] = Field()
8282
cls.fields = cls.fields.copy()
8383
cls.fields.update(fields)
8484

85-
pattern_properties = schema.get("patternProperties", {})
85+
pattern_properties = schema.get('patternProperties', {})
8686
cls.pattern_properties = [
8787
re.compile(p)
8888
for p in pattern_properties.keys()
89-
if p is not "additionalProperties"
89+
if p is not 'additionalProperties'
9090
]
9191
return cls
9292

9393
@classmethod
9494
def _get_validator(cls, schema):
95-
draft_version = schema.get("$schema")
95+
draft_version = schema.get('$schema')
9696
# Default to Draft4Validator for backward-compatibility
9797
validator_class = cls.draft_to_validator.get(
9898
draft_version, Draft4Validator
9999
)
100100
format_checker = cls.draft_to_format_checker.get(
101-
schema.get("$schema"), draft4_format_checker
101+
schema.get('$schema'), draft4_format_checker
102102
)
103103
return validator_class(schema, format_checker=format_checker)
104104

0 commit comments

Comments
 (0)