Commit 9d7e84ed authored by davebshow's avatar davebshow
Browse files

combined two inits into base class

parent cdcb6132
......@@ -150,7 +150,7 @@ class VertexPropertyDescriptor:
class VertexProperty(Vertex, abc.BaseProperty):
"""Base class for user defined vertex properties. Not yet supported."""
"""Base class for user defined vertex properties."""
__descriptor__ = VertexPropertyDescriptor
......
......@@ -3,6 +3,12 @@
class VertexPropertyManager:
def __init__(self, data_type, vertex_prop, card):
self._data_type = data_type
self._vertex_prop = vertex_prop
self._card = card
self._mapper_func = vertex_prop.__mapping__.mapper_func
@property
def mapper_func(self):
return self._mapper_func
......@@ -22,10 +28,7 @@ class VertexPropertyManager:
class ListVertexPropertyManager(list, VertexPropertyManager):
def __init__(self, data_type, vertex_prop, card, obj):
self._data_type = data_type
self._vertex_prop = vertex_prop
self._card = card
self._mapper_func = vertex_prop.__mapping__.mapper_func
VertexPropertyManager.__init__(self, data_type, vertex_prop, card)
list.__init__(self, obj)
def append(self, val):
......@@ -37,10 +40,7 @@ class ListVertexPropertyManager(list, VertexPropertyManager):
class SetVertexPropertyManager(set, VertexPropertyManager):
def __init__(self, data_type, vertex_prop, card, obj):
self._data_type = data_type
self._vertex_prop = vertex_prop
self._card = card
self._mapper_func = vertex_prop.__mapping__.mapper_func
VertexPropertyManager.__init__(self, data_type, vertex_prop, card)
set.__init__(self, obj)
def add(self, val):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment