From 9ea10f562c94747c127eee9321a18801eafd08c7 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Sun, 6 Dec 2015 14:37:44 -0800 Subject: [PATCH] Fixed lint errors --- graphene/core/classtypes/base.py | 2 +- graphene/core/schema.py | 2 +- graphene/core/types/base.py | 5 ++--- graphene/core/types/field.py | 3 ++- graphene/plugins/base.py | 1 + graphene/plugins/camel_case.py | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/graphene/core/classtypes/base.py b/graphene/core/classtypes/base.py index 9dafff0e..cabb909a 100644 --- a/graphene/core/classtypes/base.py +++ b/graphene/core/classtypes/base.py @@ -1,7 +1,7 @@ import copy import inspect -from functools import partial from collections import OrderedDict +from functools import partial import six diff --git a/graphene/core/schema.py b/graphene/core/schema.py index 4da067e4..f3a0b96d 100644 --- a/graphene/core/schema.py +++ b/graphene/core/schema.py @@ -10,9 +10,9 @@ from graphql.core.utils.schema_printer import print_schema from graphene import signals +from ..plugins import CamelCase, Plugin from .classtypes.base import ClassType from .types.base import BaseType -from ..plugins import Plugin, CamelCase class GraphQLSchema(_GraphQLSchema): diff --git a/graphene/core/types/base.py b/graphene/core/types/base.py index 1892cc0d..35797f8e 100644 --- a/graphene/core/types/base.py +++ b/graphene/core/types/base.py @@ -1,10 +1,8 @@ from collections import OrderedDict -from functools import total_ordering, partial +from functools import partial, total_ordering import six -from ...utils import to_camel_case - class BaseType(object): @@ -136,6 +134,7 @@ class NamedType(BaseType): class GroupNamedType(BaseType): + def __init__(self, *types): self.types = types diff --git a/graphene/core/types/field.py b/graphene/core/types/field.py index e5736867..41dc537b 100644 --- a/graphene/core/types/field.py +++ b/graphene/core/types/field.py @@ -9,7 +9,7 @@ from ..classtypes.inputobjecttype import InputObjectType from ..classtypes.mutation import Mutation from ..exceptions import SkipField from .argument import ArgumentsGroup, snake_case_args -from .base import LazyType, NamedType, MountType, OrderedType, GroupNamedType +from .base import GroupNamedType, LazyType, MountType, NamedType, OrderedType from .definitions import NonNull @@ -145,6 +145,7 @@ class InputField(NamedType, OrderedType): class FieldsGroupType(GroupNamedType): + def iter_types(self, schema): for field in sorted(self.types): try: diff --git a/graphene/plugins/base.py b/graphene/plugins/base.py index 557099c7..c881592e 100644 --- a/graphene/plugins/base.py +++ b/graphene/plugins/base.py @@ -1,4 +1,5 @@ class Plugin(object): + def contribute_to_schema(self, schema): self.schema = schema diff --git a/graphene/plugins/camel_case.py b/graphene/plugins/camel_case.py index cba39ad5..281e3d9d 100644 --- a/graphene/plugins/camel_case.py +++ b/graphene/plugins/camel_case.py @@ -1,7 +1,6 @@ -from .base import Plugin - from ..core.types.base import GroupNamedType from ..utils import memoize, to_camel_case +from .base import Plugin def camelcase_named_type(schema, type): @@ -10,6 +9,7 @@ def camelcase_named_type(schema, type): class CamelCase(Plugin): + @memoize def transform_group(self, _type): new_type = _type.__class__(*_type.types)