diff options
Diffstat (limited to 'grc/python/Connection.py')
-rw-r--r-- | grc/python/Connection.py | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/grc/python/Connection.py b/grc/python/Connection.py index 97bf61d590..7f235b190b 100644 --- a/grc/python/Connection.py +++ b/grc/python/Connection.py @@ -24,27 +24,26 @@ from .. gui.Connection import Connection as _GUIConnection class Connection(_Connection, _GUIConnection): - def __init__(self, **kwargs): - _Connection.__init__(self, **kwargs) - _GUIConnection.__init__(self) - - def is_msg(self): - return self.get_source().get_type() == self.get_sink().get_type() == 'msg' - - def is_message(self): - return self.get_source().get_type() == self.get_sink().get_type() == 'message' - - def is_bus(self): - return self.get_source().get_type() == self.get_sink().get_type() == 'bus' - def validate(self): - """ - Validate the connections. - The ports must match in io size. - """ - Element.validate(self) - source_size = Constants.TYPE_TO_SIZEOF[self.get_source().get_type()] * self.get_source().get_vlen() - sink_size = Constants.TYPE_TO_SIZEOF[self.get_sink().get_type()] * self.get_sink().get_vlen() - if source_size != sink_size: - self.add_error_message('Source IO size "%s" does not match sink IO size "%s".'%(source_size, sink_size)) - - + def __init__(self, **kwargs): + _Connection.__init__(self, **kwargs) + _GUIConnection.__init__(self) + + def is_msg(self): + return self.get_source().get_type() == self.get_sink().get_type() == 'msg' + + def is_message(self): + return self.get_source().get_type() == self.get_sink().get_type() == 'message' + + def is_bus(self): + return self.get_source().get_type() == self.get_sink().get_type() == 'bus' + + def validate(self): + """ + Validate the connections. + The ports must match in io size. + """ + Element.validate(self) + source_size = Constants.TYPE_TO_SIZEOF[self.get_source().get_type()] * self.get_source().get_vlen() + sink_size = Constants.TYPE_TO_SIZEOF[self.get_sink().get_type()] * self.get_sink().get_vlen() + if source_size != sink_size: + self.add_error_message('Source IO size "%s" does not match sink IO size "%s".'%(source_size, sink_size)) |