Added routes to OMF nodes
[nepi.git] / src / nepi / core / design.py
index 11b9d7b..7ad5509 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 """
@@ -56,6 +55,11 @@ class Connector(object):
         self._connections.append(connector)
         connector._connections.append(self)
 
+    def get_connected_box(self, idx = 0):
+        if len(self._connections) == 0:
+            return None
+        return self._connections[idx].box
+
     def disconnect(self, connector):
         if connector not in self._connections or\
                 self not in connector._connections:
@@ -153,6 +157,12 @@ class Route(AttributesMap):
                 value = 0,
                 flags = Attribute.NoDefaultValue,
                 validation_function = validation.is_integer)
+        self.add_attribute(name = "Device",
+                help = "Device name", 
+                type = Attribute.STRING,
+                value = None,
+                flags = Attribute.NoDefaultValue,
+                validation_function = validation.is_string)
 
 class Box(AttributesMap, Taggable):
     def __init__(self, guid, factory, testbed_guid, container = None):