Ejemplo n.º 1
0
 def __init__(self, configuration):
     Frame.__init__(self,
                    WelcomeBuffer(),
                    header=TabsWidget(),
                    footer=StatusBar(''))
     self._configuration = configuration
     self._editor_mode = False
Ejemplo n.º 2
0
    def __init__(self, loop):
        header = [AttrWrap(Text(TITLE_TEXT), "border"),
                  AttrWrap(Text('(Q) Quit'), "border"),
                  AttrWrap(Text('(F5) Refresh'), "border"),
                  AttrWrap(Text('(F6) Add units'), "border"),
                  AttrWrap(Text('(F8) Console'), "border")]
        header = Columns(header)
        self.timer = Text("", align="left")
        self.status_info = Text("", align="left")
        self.horizon_url = Text("", align="right")
        self.jujugui_url = Text("", align="right")
        footer = Columns([('weight', 0.2, self.status_info),
                          ('weight', 0.1, self.timer),
                          ('weight', 0.2, self.horizon_url),
                          ('weight', 0.2, self.jujugui_url)])
        footer = AttrWrap(footer, "border")
        self.poll_interval = 10
        self.ticks_left = 0
        self.juju_state = None
        self.maas_state = None
        self.nodes = ListWithHeader(NODE_HEADER)
        self.loop = loop

        self.cr = CommandRunner()
        Frame.__init__(self, header=header, body=self.nodes,
                       footer=footer)
        self.controller_overlay = ControllerOverlay(self, self.cr)
        self._target = self.controller_overlay
Ejemplo n.º 3
0
Archivo: ui.py Proyecto: gigigi/turses
 def __init__(self,
              configuration):
     Frame.__init__(self,
                    WelcomeBuffer(),
                    header=TabsWidget(),
                    footer=StatusBar(''))
     self._configuration = configuration
     self._editor_mode = False
Ejemplo n.º 4
0
 def __init__(self):
     header = [AttrWrap(Text(TITLE_TEXT), "border"),
               AttrWrap(Text('(Q) Quit'), "border"),
               AttrWrap(Text('(F8) Node list'), "border")]
     header = Columns(header)
     with open(path.expanduser('~/.cloud-install/commands.log')) as f:
         body = f.readlines()
     body = ListBox([Text(x) for x in body])
     Frame.__init__(self, header=header, body=body)
Ejemplo n.º 5
0
Archivo: ui.py Proyecto: 1reza/turses
    def __init__(self,
                 configuration):
        self._configuration = configuration
        self._editor = None

        # header
        header = TabsWidget()

        # body
        body = Banner(configuration)

        # footer
        self._status_bar = configuration.styles.get('status_bar', False)
        if self._status_bar:
            footer = StatusBar('')
        else:
            footer = None

        Frame.__init__(self,
                       body,
                       header=header,
                       footer=footer)
Ejemplo n.º 6
0
 def __init__(self, notes):
     note_widgets = self._create_note_widgets(notes)
     self.notes = NotesListBox(note_widgets)
     self.notes.focus_first()
     self.status = self._create_statusbar(notes)
     Frame.__init__(self, self.notes, footer=self.status)
Ejemplo n.º 7
0
 def __init__(self, header_text):
     self._contents = SimpleListWalker([])
     body = ListBox(self._contents)
     Frame.__init__(self, header=Columns(header_text), body=body)