2012-05-11 14:12:41 +02:00
|
|
|
class Link():
|
|
|
|
def __init__(self):
|
2012-06-11 23:53:45 +02:00
|
|
|
self.id = None
|
2014-02-21 15:27:19 +01:00
|
|
|
self.source = LinkConnector()
|
|
|
|
self.target = LinkConnector()
|
2012-06-04 20:47:05 +02:00
|
|
|
self.quality = None
|
2012-06-07 22:58:45 +02:00
|
|
|
self.type = None
|
2012-05-11 14:12:41 +02:00
|
|
|
|
2014-02-21 15:27:19 +01:00
|
|
|
def export(self):
|
|
|
|
return {
|
|
|
|
'source': self.source.id,
|
|
|
|
'target': self.target.id,
|
|
|
|
'quality': self.quality,
|
|
|
|
'type': self.type,
|
|
|
|
'id': self.id
|
|
|
|
}
|
|
|
|
|
2012-06-11 23:53:45 +02:00
|
|
|
class LinkConnector():
|
|
|
|
def __init__(self):
|
|
|
|
self.id = None
|
|
|
|
self.interface = None
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return "LinkConnector(%d, %s)" % (self.id, self.interface)
|