def _prep_text(i, entry): number = tui.TextWidget("%2d)" % i) title = tui.TextWidget(_(entry.title)) value = getdeepattr(self.args, entry.attribute) value = tui.TextWidget(value) return tui.ColumnWidget([(3, [number]), (None, [title, value])], 1)
def _prep_password(i, entry): number = tui.TextWidget("%2d)" % i) title = tui.TextWidget(_(entry.title)) value = "" if len(getdeepattr(self.args, entry.attribute)) > 0: value = _("Password set.") value = tui.TextWidget(value) return tui.ColumnWidget([(3, [number]), (None, [title, value])], 1)
def _prep_check(i, entry): number = tui.TextWidget("%2d)" % i) value = getdeepattr(self.args, entry.attribute) ch = tui.CheckboxWidget(title=_(entry.title), completed=bool(value)) return tui.ColumnWidget([(3, [number]), (None, [ch])], 1)
def refresh(self, args=None): """ Show the help. """ tui.UIScreen.refresh(self, args) help_message = _("The help is not available.") if self.help_path: with open(self.help_path, 'r') as f: help_message = f.read() self._window += [tui.TextWidget(help_message), ""] return True
def _prep(i, w): number = tui.TextWidget("%2d)" % i) return tui.ColumnWidget([(3, [number]), (None, [w])], 1)
def refresh(self, args=None): tui.UIScreen.refresh(self, args) text = tui.TextWidget(self._message) self._window.append(tui.CenterWidget(text)) self._window.append(u"") return True
def refresh(self, args=None): tui.UIScreen.refresh(self, args) text = tui.TextWidget(self._message) self._window += [tui.CenterWidget(text), ""] return True