def update_time(self, seconds_until_update): time_string = self._now().strftime("%H:%M:%S") update = "Updating in {0:.0f}s".format(seconds_until_update) if self._time is None: self._time = util.subtle(time_string, align="center") self._time_until_update = util.subtle(update, align="center") else: self._time.set_text(("subtle", time_string)) self._time_until_update.set_text(("subtle", update))
def menu(self): l = [ util.main_header("TripleO Dashboard", align="center"), util.subtle("v{0}".format(tripleodash.RELEASE_STRING), align="center"), self._time, self._time_until_update, urwid.Divider(), util.button("Overview", self.overview_window, self._trigger_update), util.button("Glance Images", self.images_window, self._trigger_update), util.button("Ironic Nodes", self.nodes_window, self._trigger_update), util.button("Heat Stacks", self.stacks_window, self._trigger_update), util.button("Nova Servers", self.servers_window, self._trigger_update), urwid.Divider(), urwid.Divider(), util.exit_button("Quit") ] w = urwid.ListBox(urwid.SimpleListWalker(l)) w.set_focus(3) return w
def test_subtle(self): # Test txt = util.subtle("Subtle") # Verify self.assertEqual(txt.get_text(), ('Subtle', [('subtle', 6)]))