Example #1
0
    def traits_view(self):
        auth_grp = VGroup(Item('host'),
                          Item('user'),
                          Item('password'),
                          show_border=True,
                          label='Authentication')

        v = View(VGroup(auth_grp,
                        HGroup(icon_button_editor('check_status_button', 'database_go_fatcow',
                                                  tooltip='Check slave status. Equivalent to "Show Slave Status"'),
                               icon_button_editor('start_button', 'start',
                                                  tooltip='Start replication. Equivalent to "Start Slave"',
                                                  enabled_when='not running'),
                               icon_button_editor('stop_button', 'stop',
                                                  tooltip='Stop replication. Equivalent to "Stop Slave"',
                                                  enabled_when='running'),
                               icon_button_editor('skip_button', 'skip_occurrence',
                                                  tooltip='Set global skip counter.\n'
                                                          'Equivalent to "Stop Slave;'
                                                          'Set GLOBAL SQL_SKIP_COUNTER=N;Start Slave;"\n'
                                                          'where N is the number of SQL statements to skip'),
                               UItem('skip_count',
                                     tooltip='Number of SQL statements to skip')),
                        UItem('status_items', editor=TabularEditor(adapter=StatusItemsAdapter(),
                                                                   editable=False)),
                        VGroup(UReadonly('last_error',
                                         height=200,
                                         style_sheet='color: red; font-weight: bold'),
                               label='Error',
                               show_border=True),
                        label='Slave',
                        show_border=True))

        v.width = 500
        return v
Example #2
0
 def _view_factory(self, grps):
     v = View(grps,
              resizable=self.resizable,
              x=self.window_x,
              y=self.window_y,
              title=self.title,
              handler=self.handler_klass)
     if self.window_width:
         v.width = self.window_width
     if self.window_height:
         v.height = self.window_height
     return v
Example #3
0
 def _view_factory(self, grps):
     v = View(grps,
                 resizable=self.resizable,
                 x=self.window_x,
                 y=self.window_y,
                 title=self.title,
                 handler=self.handler_klass
                 )
     if self.window_width:
         v.width = self.window_width
     if self.window_height:
         v.height = self.window_height
     return v
Example #4
0
    def _view_factory(self, grps):
        v = View(grps,
                    resizable=self.resizable,
                    x=self.window_x,
                    y=self.window_y,
                    title=self.title,
                    handler=self.handler_klass,
#                    buttons=[Action(name='Save', action='save')]
                    )

        if self.window_width:
            v.width = self.window_width
        if self.window_height:
            v.height = self.window_height
        return v
Example #5
0
    def _view_factory(self, grps):
        v = View(
            grps,
            resizable=self.resizable,
            x=self.window_x,
            y=self.window_y,
            title=self.title,
            handler=self.handler_klass,
            #                    buttons=[Action(name='Save', action='save')]
        )

        if self.window_width:
            v.width = self.window_width
        if self.window_height:
            v.height = self.window_height
        return v
Example #6
0
                                                         func.doc_string)

    def set_text(self, text):
        """ Display a message in the help window.

            The text message is wrapped in html tags so that it displays
            correctly in the html window.
        """
        self._html = self._htmlify(text)

    def set_html(self, html):
        """ Display html text without modification into the window.
        """
        self._html = html


    ### private methods ######################################################


    def _htmlify(self, text):
        """ Add <html> and <body> tags around text so that it is valid html.
        """
        return "<html>\n<body>\n%s\n</body>\n</html>" % text


if __name__ == "__main__":
    widget = HtmlInfoDisplay()
    html_view.height = .3
    html_view.width = .3
    widget.edit_traits(view=html_view)
Example #7
0
        else:
            self._html = rest_html.convert_function_info(
                func.name, func.doc_string)

    def set_text(self, text):
        """ Display a message in the help window.

            The text message is wrapped in html tags so that it displays
            correctly in the html window.
        """
        self._html = self._htmlify(text)

    def set_html(self, html):
        """ Display html text without modification into the window.
        """
        self._html = html

    ### private methods ######################################################

    def _htmlify(self, text):
        """ Add <html> and <body> tags around text so that it is valid html.
        """
        return "<html>\n<body>\n%s\n</body>\n</html>" % text


if __name__ == "__main__":
    widget = HtmlInfoDisplay()
    html_view.height = .3
    html_view.width = .3
    widget.edit_traits(view=html_view)