Example #1
0
    def __init__(self, data, storage, payload):
        if self.__class__ is TUISpoke:
            raise TypeError("TUISpoke is an abstract class")

        TUIObject.__init__(self, data)
        Widget.__init__(self)
        Spoke.__init__(self, storage, payload)

        self.input_required = True
        self.title = N_("Default spoke title")
Example #2
0
    def __init__(self, data, storage, payload, instclass):
        if self.__class__ is TUISpoke:
            raise TypeError("TUISpoke is an abstract class")

        TUIObject.__init__(self, data)
        Widget.__init__(self)
        Spoke.__init__(self, storage, payload, instclass)

        self.input_required = True
        self.title = N_("Default spoke title")
Example #3
0
    def render(self, width):
        """Render the summary representation for Hub to internal buffer."""
        Widget.render(self, width)

        if self.mandatory and not self.completed:
            key = "!"
        elif self.completed:
            key = "x"
        else:
            key = " "

        # always set completed = True here; otherwise key value won't be
        # displayed if completed (spoke value from above) is False
        c = CheckboxWidget(key=key, completed=True,
                           title=_(self.title), text=self.status)
        c.render(width)
        self.draw(c)
Example #4
0
    def render(self, width):
        """Render the summary representation for Hub to internal buffer."""
        Widget.render(self, width)

        if self.mandatory and not self.completed:
            key = "!"
        elif self.completed:
            key = "x"
        else:
            key = " "

        # always set completed = True here; otherwise key value won't be
        # displayed if completed (spoke value from above) is False
        c = CheckboxWidget(key=key,
                           completed=True,
                           title=_(self.title),
                           text=self.status)
        c.render(width)
        self.draw(c)