当前位置: 首页>>代码示例>>Python>>正文


Python NormalTUISpoke.refresh方法代码示例

本文整理汇总了Python中pyanaconda.ui.tui.spokes.NormalTUISpoke.refresh方法的典型用法代码示例。如果您正苦于以下问题:Python NormalTUISpoke.refresh方法的具体用法?Python NormalTUISpoke.refresh怎么用?Python NormalTUISpoke.refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyanaconda.ui.tui.spokes.NormalTUISpoke的用法示例。


在下文中一共展示了NormalTUISpoke.refresh方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        # Join the initialization thread to block on it
        # This print is foul.  Need a better message display
        print(_(PAYLOAD_STATUS_PROBING_STORAGE))
        threadMgr.wait(THREAD_STORAGE_WATCHER)

        # synchronize our local data store with the global ksdata
        # Commment out because there is no way to select a disk right
        # now without putting it in ksdata.  Seems wrong?
        #self.selected_disks = self.data.ignoredisk.onlyuse[:]
        self.autopart = self.data.autopart.autopart

        self._container = ListColumnContainer(1, spacing=1)

        message = self._update_summary()

        # loop through the disks and present them.
        for disk in self.disks:
            disk_info = self._format_disk_info(disk)
            c = CheckboxWidget(title=disk_info, completed=(disk.name in self.selected_disks))
            self._container.add(c, self._update_disk_list_callback, disk)

        # if we have more than one disk, present an option to just
        # select all disks
        if len(self.disks) > 1:
            c = CheckboxWidget(title=_("Select all"), completed=self.select_all)
            self._container.add(c, self._select_all_disks_callback)

        self.window.add_with_separator(self._container)
        self.window.add_with_separator(TextWidget(message))
开发者ID:jaymzh,项目名称:anaconda,代码行数:34,代码来源:storage.py

示例2: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """
        args is None if we want a list of languages; or, it is a list of all
        locales for a language.
        """
        NormalTUISpoke.refresh(self, args)

        if args:
            self._window += [TextWidget(_("Available locales"))]
            displayed = [TextWidget(localization.get_english_name(z)) for z in args]
        else:
            self._window += [TextWidget(_("Available languages"))]
            displayed = [TextWidget(z) for z in self._langs]

        def _prep(i, w):
            """ make everything look nice """
            number = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [number]), (None, [w])], 1)

        # split zones to three columns
        middle = len(displayed) / 3
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= middle]
        center = [_prep(i, w) for i, w in enumerate(displayed) if i > middle and i <= 2*middle]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > 2*middle]

        c = ColumnWidget([(24, left), (24, center), (24, right)], 3)
        self._window += [c, ""]

        return True
开发者ID:dougsland,项目名称:anaconda,代码行数:31,代码来源:langsupport.py

示例3: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """
        The refresh method that is called every time the spoke is displayed.
        It should update the UI elements according to the contents of
        self.data.

        :see: pyanaconda.ui.common.UIObject.refresh
        :see: pyanaconda.ui.tui.base.UIScreen.refresh
        :param args: optional argument that may be used when the screen is
                     scheduled (passed to App.switch_screen* methods)
        :type args: anything
        :return: whether this screen requests input or not
        :rtype: bool

        """
        NormalTUISpoke.refresh(self, args)
        # It should always prompt
        box1 = CheckboxWidget(
            title="1. Enable Cloud Support",
            text="OpenStack MODE: " + str(self.data.addons.org_centos_cloud.arguments),
            completed=(self.data.addons.org_centos_cloud.state == "True"),
        )
        box2 = CheckboxWidget(
            title=("2. Disable Cloud Support"), completed=(self.data.addons.org_centos_cloud.state == "False")
        )
        self._window += [box1, "", box2, ""]
        return self.enabled  # Don't Prompt if ADDON was disabled during setup, because no packages have been installed
开发者ID:asadpiz,项目名称:org_centos_cloud,代码行数:29,代码来源:cloud_tui.py

示例4: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args = None):
        NormalTUISpoke.refresh(self, args)

        # Join the initialization thread to block on it
        # This print is foul.  Need a better message display
        print(_("Probing storage..."))
        threadMgr.wait(THREAD_STORAGE_WATCHER)

        # synchronize our local data store with the global ksdata
        # Commment out because there is no way to select a disk right
        # now without putting it in ksdata.  Seems wrong?
        #self.selected_disks = self.data.ignoredisk.onlyuse[:]
        self.autopart = self.data.autopart.autopart

        message = self._update_summary()

        # loop through the disks and present them.
        for disk in self.disks:
            size = size_str(disk.size)
            c = CheckboxWidget(title="%i) %s: %s (%s)" % (self.disks.index(disk) + 1,
                                                 disk.model, size, disk.name),
                               completed=(disk.name in self.selected_disks))
            self._window += [c, ""]

        self._window += [TextWidget(message), ""]

        return True
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:29,代码来源:storage.py

示例5: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        environments = self.payload.environments

        displayed = []
        for env in environments:
            (name, desc) = self.payload.environmentDescription(env)

            displayed.append(CheckboxWidget(title="%s" % name, completed=(environments.index(env) == self._selection)))
        print(_("Choose a desktop environment."))

        def _prep(i, w):
            """ Do some format magic for display. """
            num = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [num]), (None, [w])], 1)

        # split list of DE's into two columns
        mid = len(environments) / 2
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= mid]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > mid]

        cw = ColumnWidget([(38, left), (38, right)], 2)
        self._window.append(cw)

        return True
开发者ID:cs2c-zhangchao,项目名称:nkwin1.0-anaconda,代码行数:29,代码来源:software.py

示例6: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        # check if the storage refresh thread is running
        if threadMgr.get(THREAD_STORAGE_WATCHER):
            # storage refresh is running - just report it
            # so that the user can refresh until it is done
            # TODO: refresh once the thread is done ?
            message = _(PAYLOAD_STATUS_PROBING_STORAGE)
            self._window += [TextWidget(message), ""]
            return True

        # check if there are any mountable devices
        if self._mountable_devices:
            def _prep(i, w):
                """ Mangle our text to make it look pretty on screen. """
                number = TextWidget("%2d)" % (i + 1))
                return ColumnWidget([(4, [number]), (None, [w])], 1)

            devices = [TextWidget(d[1]) for d in self._mountable_devices]

            # gnarl and mangle all of our widgets so things look pretty on
            # screen
            choices = [_prep(i, w) for i, w in enumerate(devices)]

            displayed = ColumnWidget([(78, choices)], 1)
            self._window.append(displayed)

        else:
            message = _("No mountable devices found")
            self._window += [TextWidget(message), ""]
        return True
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:34,代码来源:source.py

示例7: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        summary = self._summary_text()
        self._window += [TextWidget(summary), ""]

        if self.data.timezone.timezone:
            timezone_option = _("Change timezone")
        else:
            timezone_option = _("Set timezone")

        _options = [timezone_option, _("Configure NTP servers")]
        text = [TextWidget(m) for m in _options]

        def _prep(i, w):
            """ Mangle our text to make it look pretty on screen. """
            number = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [number]), (None, [w])], 1)

        # gnarl and mangle all of our widgets so things look pretty on screen
        choices = [_prep(i, w) for i, w in enumerate(text)]

        displayed = ColumnWidget([(78, choices)], 1)
        self._window.append(displayed)

        return True
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:28,代码来源:time_spoke.py

示例8: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """args is None if we want a list of zones or "zone" to show all timezones in that zone."""
        NormalTUISpoke.refresh(self, args)

        if args and args in self._timezones:
            self._window += [TextWidget(_("Available timezones in region %s") % args)]
            displayed = [TextWidget(z) for z in self._timezones[args]]
        else:
            self._window += [TextWidget(_("Available regions"))]
            displayed = [TextWidget(z) for z in self._regions]

        def _prep(i, w):
            number = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [number]), (None, [w])], 1)

        # split zones to three columns
        middle = len(displayed) / 3
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= middle]
        center = [_prep(i, w) for i, w in enumerate(displayed) if i > middle and i <= 2*middle]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > 2*middle]

        c = ColumnWidget([(24, left), (24, center), (24, right)], 3)
        self._window.append(c)

        return True
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:27,代码来源:time_spoke.py

示例9: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)

        if self.data.method.method == "harddrive" and \
           get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR):
            message = _("The installation source is in use by the installer and cannot be changed.")
            self.window.add_with_separator(TextWidget(message))
            return

        if args == self.SET_NETWORK_INSTALL_MODE:
            if self.payload.mirrors_available:
                self._container.add(TextWidget(_("Closest mirror")), self._set_network_close_mirror)
            self._container.add(TextWidget("http://"), self._set_network_url, SpecifyRepoSpoke.HTTP)
            self._container.add(TextWidget("https://"), self._set_network_url, SpecifyRepoSpoke.HTTPS)
            self._container.add(TextWidget("ftp://"), self._set_network_url, SpecifyRepoSpoke.FTP)
            self._container.add(TextWidget("nfs"), self._set_network_nfs)
        else:
            self.window.add(TextWidget(_("Choose an installation source type.")))
            self._container.add(TextWidget(_("CD/DVD")), self._set_cd_install_source)
            self._container.add(TextWidget(_("local ISO file")), self._set_iso_install_source)
            self._container.add(TextWidget(_("Network")), self._set_network_install_source)

            if self._hmc:
                self._container.add(TextWidget(_("SE/HMC")), self._set_hmc_install_source)

        self.window.add_with_separator(self._container)
开发者ID:zhangsju,项目名称:anaconda,代码行数:32,代码来源:installation_source.py

示例10: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        # Join the initialization thread to block on it
        # This print is foul.  Need a better message display
        print(_(PAYLOAD_STATUS_PROBING_STORAGE))
        threadMgr.wait(THREAD_STORAGE_WATCHER)

        # synchronize our local data store with the global ksdata
        # Commment out because there is no way to select a disk right
        # now without putting it in ksdata.  Seems wrong?
        #self.selected_disks = self.data.ignoredisk.onlyuse[:]
        self.autopart = self.data.autopart.autopart

        message = self._update_summary()

        # loop through the disks and present them.
        for disk in self.disks:
            disk_info = self._format_disk_info(disk)
            c = CheckboxWidget(title="%i) %s" % (self.disks.index(disk) + 1, disk_info),
                               completed=(disk.name in self.selected_disks))
            self._window += [c, ""]

        # if we have more than one disk, present an option to just
        # select all disks
        if len(self.disks) > 1:
            c = CheckboxWidget(title="%i) %s" % (len(self.disks) + 1, _("Select all")),
                                completed=(self.selection == len(self.disks)))

            self._window += [c, ""]

        self._window += [TextWidget(message), ""]

        return True
开发者ID:galleguindio,项目名称:anaconda,代码行数:36,代码来源:storage.py

示例11: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """ Refresh screen. """
        self._load_new_devices()
        NormalTUISpoke.refresh(self, args)

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)

        summary = self._summary_text()
        self.window.add_with_separator(TextWidget(summary))
        hostname = _("Host Name: %s\n") % self._network_module.proxy.Hostname
        self.window.add_with_separator(TextWidget(hostname))
        current_hostname = _("Current host name: %s\n") % self._network_module.proxy.GetCurrentHostname()
        self.window.add_with_separator(TextWidget(current_hostname))

        # if we have any errors, display them
        while len(self.errors) > 0:
            self.window.add_with_separator(TextWidget(self.errors.pop()))

        dialog = Dialog(_("Host Name"))
        self._container.add(TextWidget(_("Set host name")), callback=self._set_hostname_callback, data=dialog)

        for dev_name in self.supported_devices:
            text = (_("Configure device %s") % dev_name)
            self._container.add(TextWidget(text), callback=self._configure_network_interface, data=dev_name)

        self.window.add_with_separator(self._container)
开发者ID:zhangsju,项目名称:anaconda,代码行数:28,代码来源:network.py

示例12: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)

        if not self.nm_client:
            self.window.add_with_separator(TextWidget(_("Network configuration is not available.")))
            return

        summary = self._summary_text()
        self.window.add_with_separator(TextWidget(summary))

        hostname = _("Host Name: %s\n") % self._network_module.proxy.Hostname
        self.window.add_with_separator(TextWidget(hostname))
        current_hostname = _("Current host name: %s\n") % self._network_module.proxy.GetCurrentHostname()
        self.window.add_with_separator(TextWidget(current_hostname))

        # if we have any errors, display them
        while len(self.errors) > 0:
            self.window.add_with_separator(TextWidget(self.errors.pop()))

        dialog = Dialog(_("Host Name"))
        self._container.add(TextWidget(_("Set host name")), callback=self._set_hostname_callback, data=dialog)

        for device_configuration in self.editable_configurations:
            iface = device_configuration.device_name
            text = (_("Configure device %s") % iface)
            self._container.add(TextWidget(text), callback=self._ensure_connection_and_configure,
                                data=iface)

        self.window.add_with_separator(self._container)
开发者ID:rvykydal,项目名称:anaconda,代码行数:34,代码来源:network.py

示例13: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        if not self.payload.baseRepo:
            message = TextWidget(_("Installation source needs to be set up first."))
            self._window.append(message)

            # add some more space below
            self._window.append(TextWidget(""))
            return True

        threadMgr.wait(THREAD_CHECK_SOFTWARE)
        displayed = []

        # Display the environments
        if args is None:
            environments = self.payload.environments
            length = len(environments)
            msg = _("Base environment")

            for env in environments:
                name = self.payload.environmentDescription(env)[0]
                selected = environments.index(env) == self._selection
                displayed.append(CheckboxWidget(title="%s" % name, completed=selected))

        # Display the add-ons
        else:
            length = len(args)

            if length > 0:
                msg = _("Add-ons for selected environment")
            else:
                msg = _("No add-ons to select.")

            for addon_id in args:
                name = self.payload.groupDescription(addon_id)[0]
                selected = addon_id in self._addons_selection
                displayed.append(CheckboxWidget(title="%s" % name, completed=selected))

        def _prep(i, w):
            """ Do some format magic for display. """
            num = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [num]), (None, [w])], 1)

        # split list of DE's into two columns
        mid = length / 2
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= mid]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > mid]

        cw = ColumnWidget([(38, left), (38, right)], 2)

        self._window.append(TextWidget(msg))
        self._window.append(TextWidget(""))
        self._window.append(cw)
        self._window.append(TextWidget(""))
        return True
开发者ID:adrelanos,项目名称:qubes-installer-qubes-os,代码行数:61,代码来源:software.py

示例14: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args = None):
        NormalTUISpoke.refresh(self, args)

        self._window += [TextWidget(self._message), ""]

        for idx, choice in enumerate(self._choices):
            number = TextWidget("%2d)" % (idx + 1))
            c = ColumnWidget([(3, [number]), (None, [TextWidget(choice)])], 1)
            self._window += [c, ""]

        return True
开发者ID:cs2c-zhangchao,项目名称:nkwin1.0-anaconda,代码行数:13,代码来源:askvnc.py

示例15: refresh

# 需要导入模块: from pyanaconda.ui.tui.spokes import NormalTUISpoke [as 别名]
# 或者: from pyanaconda.ui.tui.spokes.NormalTUISpoke import refresh [as 别名]
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        message = _("The following installations were discovered on your system.\n")
        self.window.add_with_separator(TextWidget(message))

        for i, root_desc in enumerate(self._roots):
            root_name, root_device_path = root_desc
            box = CheckboxWidget(title="%i) %s on %s" % (i + 1, _(root_name), root_device_path),
                                 completed=(self._selection == i))
            self.window.add_with_separator(box)
开发者ID:jaymzh,项目名称:anaconda,代码行数:13,代码来源:rescue.py


注:本文中的pyanaconda.ui.tui.spokes.NormalTUISpoke.refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。