added tags to boxes. For now only one tag: MOBILE
[nepi.git] / src / nepi / core / execute.py
index 67e5ebc..3b1463a 100644 (file)
@@ -97,6 +97,7 @@ class Factory(AttributesMap):
         self._prestart_function = prestart_function
         self._connector_types = dict()
         self._traces = list()
+        self._tags = list()
         self._box_attributes = AttributesMap()
 
     @property
@@ -155,6 +156,10 @@ class Factory(AttributesMap):
     def traces(self):
         return self._traces
 
+    @property
+    def tags(self):
+        return self._tags
+
     def connector_type(self, name):
         return self._connector_types[name]
 
@@ -164,6 +169,9 @@ class Factory(AttributesMap):
     def add_trace(self, trace_id):
         self._traces.append(trace_id)
 
+    def add_tag(self, tag_id):
+        self._tags.append(tag_id)
+
     def add_box_attribute(self, name, help, type, value = None, range = None,
         allowed = None, flags = Attribute.NoFlags, validation_function = None,
         category = None):
@@ -321,6 +329,9 @@ class TestbedController(object):
     def get_attribute_list(self, guid):
         raise NotImplementedError
 
+    def get_tags(self, guid):
+        raise NotImplementedError
+
     def action(self, time, guid, action):
         raise NotImplementedError
 
@@ -549,6 +560,10 @@ class ExperimentController(object):
         testbed = self._testbeds[testbed_guid]
         return testbed.get(guid, name, time)
 
+    def get_tags(self, testbed_guid, guid):
+        testbed = self._testbeds[testbed_guid]
+        return testbed.get_tags(guid)
+
     def shutdown(self):
         for testbed in self._testbeds.values():
             testbed.shutdown()