Reorder Entity constructor, parameters last
Signed-off-by: martin f. krafft <madduck@madduck.net>
diff --git a/datatypes/entity.py b/datatypes/entity.py
index e493c8b..d8d0ef7 100644
--- a/datatypes/entity.py
+++ b/datatypes/entity.py
@@ -12,8 +12,8 @@
class Entity(object):
- def __init__(self, classes=Classes(), parameters=Parameters(),
- applications=Applications()):
+ def __init__(self, classes=Classes(), applications=Applications(),
+ parameters=Parameters()):
self._applications = applications
self._classes = classes
self._parameters = parameters
@@ -28,5 +28,5 @@
self.parameters.merge(other.parameters)
def __repr__(self):
- return '<Entity classes:{0} parameters:{1} applications:{2}>'.format(
- len(self.classes), len(self.parameters), len(self.applications))
+ return '<Entity classes:{0} applications:{1}, parameters:{2}>'.format(
+ len(self.classes), len(self.applications), len(self.parameters))
diff --git a/datatypes/tests/test_entity.py b/datatypes/tests/test_entity.py
index 1b1ac7f..c9e11ab 100644
--- a/datatypes/tests/test_entity.py
+++ b/datatypes/tests/test_entity.py
@@ -23,7 +23,7 @@
c = Classes(['one', 'two'])
p = Parameters({'blue':'white', 'black':'yellow'})
a = Applications(['three', 'four'])
- e = Entity(c, p, a)
+ e = Entity(c, a, p)
assert e.classes == c
assert e.parameters == p
assert e.applications == a
diff --git a/storage/yaml_fs/yamlfile.py b/storage/yaml_fs/yamlfile.py
index 7570155..ee69b0a 100644
--- a/storage/yaml_fs/yamlfile.py
+++ b/storage/yaml_fs/yamlfile.py
@@ -27,9 +27,9 @@
def _get_entity(self):
classes = datatypes.Classes(self._data.get('classes', []))
- parameters = datatypes.Parameters(self._data.get('parameters', {}))
applications = datatypes.Applications(self._data.get('applications', []))
- return datatypes.Entity(classes, parameters, applications)
+ parameters = datatypes.Parameters(self._data.get('parameters', {}))
+ return datatypes.Entity(classes, applications, parameters)
entity = property(lambda self: self._get_entity())
def __repr__(self):