Removed unused code

This commit is contained in:
Syrus Akbary 2017-07-11 21:27:20 -07:00
parent f0edcb224a
commit b78b8c4134
3 changed files with 1 additions and 45 deletions

View File

@ -1,5 +1,6 @@
from ..pyutils.init_subclass import InitSubclassMeta
class AbstractType(object):
__metaclass__ = InitSubclassMeta

View File

@ -12,9 +12,6 @@ class ObjectTypeOptions(BaseOptions):
interfaces = () # type: List[Type[Interface]]
class ObjectTypeMeta(type):
pass
class ObjectType(BaseType):
'''
Object Type Definition

View File

@ -1,42 +0,0 @@
import inspect
from ..utils.props import props
class Options(object):
'''
This is the class wrapper around Meta.
It helps to validate and cointain the attributes inside
'''
def __init__(self, meta=None, **defaults):
if meta:
assert inspect.isclass(meta), (
'Meta have to be a class, received "{}".'.format(repr(meta))
)
meta_attrs = props(meta) if meta else {}
for attr_name, value in defaults.items():
if attr_name in meta_attrs:
value = meta_attrs.pop(attr_name)
setattr(self, attr_name, value)
# If meta_attrs is not empty, it implicitly means
# it received invalid attributes
if meta_attrs:
raise TypeError(
"Invalid attributes: {}".format(
', '.join(sorted(meta_attrs.keys()))
)
)
def extend_with_defaults(self, defaults):
for attr_name, value in defaults.items():
if not hasattr(self, attr_name):
setattr(self, attr_name, value)
return self
def __repr__(self):
options_props = props(self)
props_as_attrs = ' '.join(['{}={}'.format(key, value) for key, value in options_props.items()])
return '<Options {}>'.format(props_as_attrs)