Ejemplo n.º 1
0
 def __init__(self, widget, nodepath, msgclass, name=None):
     self._log = LOG.getChild("TopicWidget+%s" % nodepath)
     self._sub = SubscriberGObject(nodepath, msgclass)
     self._sub.connect("message", self._on_message)
     self.widget = widget
     self.nodepath = self._sub.nodepath
     self.name = name or self.nodepath
Ejemplo n.º 2
0
 def __init__(self, widget, nodepath, msgclass, name=None):
     self._log = LOG.getChild("TopicWidget+%s" % nodepath)
     self._sub = SubscriberGObject(nodepath, msgclass)
     self._sub.connect("message", self._on_message)
     self.widget = widget
     self.nodepath = self._sub.nodepath
     self.name = name or self.nodepath
Ejemplo n.º 3
0
class TopicWidget(_MagicLabel):

    def __init__(self, widget, nodepath, msgclass, name=None):
        self._log = LOG.getChild("TopicWidget+%s" % nodepath)
        self._sub = SubscriberGObject(nodepath, msgclass)
        self._sub.connect("message", self._on_message)
        self.widget = widget
        self.nodepath = self._sub.nodepath
        self.name = name or self.nodepath

    def _on_message(self, sub, msg):
        self.set_message(msg)

    def set_message(self, msg):
        raise NotImplementedError

    def show_all(self):
        if self.widget is not None:
            self.widget.show_all()
        if self._label is not None:
            self._label.show_all()
Ejemplo n.º 4
0
class TopicWidget(_MagicLabel):

    def __init__(self, widget, nodepath, msgclass, name=None):
        self._log = LOG.getChild("TopicWidget+%s" % nodepath)
        self._sub = SubscriberGObject(nodepath, msgclass)
        self._sub.connect("message", self._on_message)
        self.widget = widget
        self.nodepath = self._sub.nodepath
        self.name = name or self.nodepath

    def _on_message(self, sub, msg):
        self.set_message(msg)

    def set_message(self, msg):
        raise NotImplementedError

    def show_all(self):
        if self.widget is not None:
            self.widget.show_all()
        if self._label is not None:
            self._label.show_all()