Ejemplo n.º 1
0
    def __init__(self,
                 plugin_base,
                 args,
                 quit=None,
                 ui_builder=urwid_builder.UrwidUIBuilder):
        """Constructs a new application

        Args:
            plugin_base: The package where to find page-plugins
            ui_builder: An implementation of the UIBuilder class to be used
        """
        import gettext

        reload(sys)
        sys.setdefaultencoding('utf-8')
        gettext.install('ovirt_node', '/usr/share/locale', unicode=True)

        super(Application, self).__init__()
        self.logger.info(("Starting '%s' application " + "with '%s' UI") %
                         (plugin_base, ui_builder))

        if console.is_terminal():
            # We're on a physical console, so explicitly load fonts in
            # case they weren't loaded for some reason
            self.logger.info("Console path is %s" %
                             os.ttyname(sys.stdin.fileno()))
            utils.process.check_call(["setfont"])

        self.args = args
        self.__parse_cmdline()

        self.ui_builder = ui_builder(self)
        self.ui = self.ui_builder.build(ui.Window("screen", self))
        self.plugin_base = plugin_base
        self.quit = lambda: quit(self) if quit else self.app_quit
Ejemplo n.º 2
0
    def __init__(self,
                 plugin_base,
                 args,
                 quit=None,
                 ui_builder=urwid_builder.UrwidUIBuilder):
        """Constructs a new application

        Args:
            plugin_base: The package where to find page-plugins
            ui_builder: An implementation of the UIBuilder class to be used
        """
        import gettext

        reload(sys)
        sys.setdefaultencoding('utf-8')
        gettext.install('ovirt_node', '/usr/share/locale', unicode=True)

        super(Application, self).__init__()
        self.logger.info(("Starting '%s' application " + "with '%s' UI") %
                         (plugin_base, ui_builder))

        self.args = args
        self.__parse_cmdline()

        self.ui_builder = ui_builder(self)
        self.ui = self.ui_builder.build(ui.Window("screen", self))
        self.plugin_base = plugin_base
        self.quit = lambda: quit(self) if quit else self.app_quit
Ejemplo n.º 3
0
    def __init__(self, plugin_base, ui_builder=urwid_builder.UrwidUIBuilder):
        """Constructs a new application

        Args:
            plugin_base: The package where to find page-plugins
            ui_builder: An implementation of the UIBuilder class to be used
        """
        super(Application, self).__init__()
        self.logger.info(("Starting '%s' application " +
                          "with '%s' UI") % (plugin_base, ui_builder))

        self.__parse_cmdline()

        self.ui_builder = ui_builder(self)
        self.ui = self.ui_builder.build(ui.Window("screen", self))
        self.plugin_base = plugin_base