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


Python NormalSpoke.refresh方法代码示例

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


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

示例1: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        threadMgr.wait(constants.THREAD_PAYLOAD_MD)

        if self.environment not in self.payload.environments:
            self.environment = None

        firstEnvironment = True
        firstRadio = None

        self._clear_listbox(self._environmentListBox)

        for environment in self.payload.environments:
            (name, desc) = self.payload.environmentDescription(environment)

            radio = Gtk.RadioButton(group=firstRadio)

            active = environment == self.environment or \
                     not self.environment and firstEnvironment
            radio.set_active(active)
            if active:
                self.environment = environment

            self._add_row(self._environmentListBox, name, desc, radio)
            firstRadio = firstRadio or radio

            firstEnvironment = False

        self.refreshAddons()
开发者ID:pombreda,项目名称:anaconda,代码行数:32,代码来源:software.py

示例2: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        threadMgr.wait(constants.THREAD_PAYLOAD_MD)

        self._environmentStore.clear()

        firstEnvironment = True
        for environment in self.payload.environments:
            (name, desc) = self.payload.environmentDescription(environment)

            itr = self._environmentStore.append([environment == self.environment, "<b>%s</b>\n%s" % (name, desc), environment])
            # Either:
            # (1) Select the environment given by kickstart or selected last
            #     time this spoke was displayed; or
            # (2) Select the first environment given by display order as the
            #     default if nothing is selected.
            if (environment == self.environment) or \
               (not self.environment and firstEnvironment):
                self.environment = environment
                sel = self.builder.get_object("environmentSelector")
                sel.select_iter(itr)

            firstEnvironment = False

        self.refreshAddons()
开发者ID:Sabayon,项目名称:anaconda,代码行数:28,代码来源:software.py

示例3: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        threadMgr.wait(constants.THREAD_PAYLOAD)

        firstEnvironment = True

        self._clear_listbox(self._environmentListBox)

        # If no environment is selected, use the default from the instclass.
        # If nothing is set in the instclass, the first environment will be
        # selected below.
        if (
            not self.environment
            and self.payload.instclass
            and self.payload.instclass.defaultPackageEnvironment in self.payload.environments
        ):
            self.environment = self.payload.instclass.defaultPackageEnvironment

        # create rows for all valid environments
        for environmentid in self.payload.environments:
            (name, desc) = self.payload.environmentDescription(environmentid)

            # use the invisible radio button as a group for all environment
            # radio buttons
            radio = Gtk.RadioButton(group=self._fakeRadio)

            # automatically select an environment if this is an interactive install
            if flags.automatedInstall:  # kickstart installation
                # tick the radio button if the environment from kickstart is both valid
                # and equal to the environment corresponding to the current row
                radio.set_active(self.environment_valid and self.environmentid == environmentid)
            elif firstEnvironment:  # manual installation
                # for manual installs that don't have a default provided by the install class
                # just tick the first radio button and select the first environment
                #
                # None indicates that an environment has not been set, which is a valid
                # value of the environment variable.
                # Only non existing environments are evaluate as invalid
                if not self.environment_valid or self.environment is None:
                    radio.set_active(True)
                    self.environment = environmentid
                firstEnvironment = False

            self._add_row(self._environmentListBox, name, desc, radio, self.on_radio_button_toggled)

        self.refreshAddons()
        self._environmentListBox.show_all()
        self._addonListBox.show_all()
开发者ID:karmix,项目名称:anaconda,代码行数:51,代码来源:software.py

示例4: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        threadMgr.wait(constants.THREAD_PAYLOAD)

        firstEnvironment = True

        self._clear_listbox(self._environmentListBox)

        # If no environment is selected, use the default from the instclass.
        # If nothing is set in the instclass, the first environment will be
        # selected below.
        if not self.environment and self.payload.instclass and \
                self.payload.instclass.defaultPackageEnvironment in self.payload.environments:
            self.environment = self.payload.instclass.defaultPackageEnvironment

        # create rows for all valid environments
        for environmentid in self.payload.environments:
            (name, desc) = self.payload.environmentDescription(environmentid)

            # use the invisible radio button as a group for all environment
            # radio buttons
            radio = Gtk.RadioButton(group=self._fakeRadio)

            # automatically select the first environment if we are on
            # manual install and the install class does not specify one
            if firstEnvironment and not flags.automatedInstall:  # manual installation
                #
                # Note about self.environment being None:
                # =======================================
                # None indicates that an environment has not been set, which is a valid
                # value of the environment variable.
                # Only non existing environments are evaluated as invalid
                if not self.environment_valid or self.environment is None:
                    self.environment = environmentid
                firstEnvironment = False

            # check if the selected environment (if any) does match the current row
            # and tick the radio button if it does
            radio.set_active(self.environment_valid and self.environmentid == environmentid)

            self._add_row(self._environmentListBox, name, desc, radio, self.on_radio_button_toggled)

        self.refreshAddons()
        self._environmentListBox.show_all()
        self._addonListBox.show_all()
开发者ID:dougsland,项目名称:anaconda,代码行数:48,代码来源:software.py

示例5: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        # Clear out the layout testing box every time the spoke is loaded.  It
        # doesn't make sense to leave temporary data laying around.
        buf = self.builder.get_object("layoutTestBuffer")
        buf.set_text("")

        # Clear and repopulate addedLayoutStore with values from self.data
        self._store.clear()
        self._add_data_layouts()

        # Start with no buttons enabled, since nothing is selected.
        self._upButton.set_sensitive(False)
        self._downButton.set_sensitive(False)
        self._removeButton.set_sensitive(False)
        self._previewButton.set_sensitive(False)

        self._refresh_switching_info()
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:21,代码来源:keyboard.py

示例6: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        self.disks = getDisks(self.storage.devicetree)
        self.selected_disks = self.data.ignoredisk.onlyuse[:]

        self.ancestors = itertools.chain(*map(self._real_ancestors, self.disks))
        self.ancestors = map(lambda d: d.name, self.ancestors)

        self._store.clear()

        allDisks = []
        multipathDisks = []
        otherDisks = []
        raidDisks = []
        zDisks = []

        # Now all all the non-local disks to the store.  Everything has been set up
        # ahead of time, so there's no need to configure anything.  We first make
        # these lists of disks, then call setup on each individual page.  This is
        # because there could be page-specific setup to do that requires a complete
        # view of all the disks on that page.
        for disk in itertools.ifilterfalse(isLocalDisk, self.disks):
            if self.pages[1].ismember(disk):
                multipathDisks.append(disk)
            elif self.pages[2].ismember(disk):
                otherDisks.append(disk)
            elif self.pages[3].ismember(disk):
                raidDisks.append(disk)
            elif self.pages[4].ismember(disk):
                zDisks.append(disk)

            allDisks.append(disk)

        self.pages[0].setup(self._store, self.selected_disks, allDisks)
        self.pages[1].setup(self._store, self.selected_disks, multipathDisks)
        self.pages[2].setup(self._store, self.selected_disks, otherDisks)
        self.pages[3].setup(self._store, self.selected_disks, raidDisks)
        self.pages[4].setup(self._store, self.selected_disks, zDisks)

        self._update_summary()
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:43,代码来源:filter.py

示例7: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        threadMgr.wait(constants.THREAD_PAYLOAD)

        if self.environment not in self.payload.environments:
            self.environment = None

        # If no environment is selected, use the default from the instclass.
        # If nothing is set in the instclass, the first environment will be
        # selected below.
        if not self.environment and self.payload.instclass and \
                self.payload.instclass.defaultPackageEnvironment in self.payload.environments:
            self.environment = self.payload.instclass.defaultPackageEnvironment

        firstEnvironment = True
        firstRadio = None

        self._clear_listbox(self._environmentListBox)

        for environment in self.payload.environments:
            (name, desc) = self.payload.environmentDescription(environment)

            radio = Gtk.RadioButton(group=firstRadio)

            # automatically select an environment if this is an interactive install
            active = environment == self.environment or \
                     not flags.automatedInstall and not self.environment and firstEnvironment
            radio.set_active(active)
            if active:
                self.environment = environment

            self._add_row(self._environmentListBox, name, desc, radio,
                    self.on_radio_button_toggled)
            firstRadio = firstRadio or radio

            firstEnvironment = False

        self.refreshAddons()
        self._environmentListBox.show_all()
        self._addonListBox.show_all()
开发者ID:cyclefusion,项目名称:anaconda,代码行数:43,代码来源:software.py

示例8: refresh

# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import refresh [as 别名]
    def refresh(self):
        NormalSpoke.refresh(self)

        # Find all hard drive partitions that could hold an ISO and add each
        # to the partitionStore.  This has to be done here because if the user
        # has done partitioning first, they may have blown away partitions
        # found during _initialize on the partitioning spoke.
        store = self.builder.get_object("partitionStore")
        store.clear()

        added = False
        active = 0
        idx = 0
        for dev in potentialHdisoSources(self.storage.devicetree):
            # path model size format type uuid of format
            dev_info = { "model" : self._sanitize_model(dev.disk.model),
                         "path"  : dev.path,
                         "size"  : dev.size,
                         "format": dev.format.name or "",
                         "label" : dev.format.label or dev.format.uuid or ""
                       }
            store.append([dev, "%(model)s %(path)s (%(size)s MB) %(format)s %(label)s" % dev_info])
            if self.data.method.method == "harddrive" and self.data.method.partition in [dev.path, dev.name]:
                active = idx
            added = True
            idx += 1

        # Again, only display these widgets if an HDISO source was found.
        self._isoBox.set_no_show_all(not added)
        self._isoBox.set_visible(added)
        self._isoButton.set_no_show_all(not added)
        self._isoButton.set_visible(added)

        if added:
            combo = self.builder.get_object("isoPartitionCombo")
            combo.set_active(active)

        # We default to the mirror list, and then if the method tells us
        # something different later, we can change it.
        self._protocolComboBox.set_active(PROTOCOL_MIRROR)
        self._urlEntry.set_sensitive(False)

        # Set up the default state of UI elements.
        if self.data.method.method == "url":
            self._networkButton.set_active(True)

            proto = self.data.method.url or self.data.method.mirrorlist
            if proto.startswith("http:"):
                self._protocolComboBox.set_active(PROTOCOL_HTTP)
                l = 7
            elif proto.startswith("https:"):
                self._protocolComboBox.set_active(PROTOCOL_HTTPS)
                l = 8
            elif proto.startswith("ftp:"):
                self._protocolComboBox.set_active(PROTOCOL_FTP)
                l = 6
            else:
                self._protocolComboBox.set_active(PROTOCOL_HTTP)
                l = 0

            self._urlEntry.set_sensitive(True)
            self._urlEntry.set_text(proto[l:])
            self._mirrorlistCheckbox.set_active(bool(self.data.method.mirrorlist))
            self._proxyUrl = self.data.method.proxy
        elif self.data.method.method == "nfs":
            self._networkButton.set_active(True)
            self._protocolComboBox.set_active(PROTOCOL_NFS)

            self._urlEntry.set_text("%s:%s" % (self.data.method.server, self.data.method.dir))
            self._urlEntry.set_sensitive(True)
            self.builder.get_object("nfsOptsEntry").set_text(self.data.method.opts or "")
        elif self.data.method.method == "harddrive":
            self._isoButton.set_active(True)
            self._isoBox.set_sensitive(True)
            self._verifyIsoButton.set_sensitive(True)

            if self._currentIsoFile:
                self._isoChooserButton.set_label(os.path.basename(self._currentIsoFile))
            else:
                self._isoChooserButton.set_label("")
            self._isoChooserButton.set_use_underline(False)
        else:
            # No method was given in advance, so now we need to make a sensible
            # guess.  Go with autodetected media if that was provided, and then
            # fall back to closest mirror.
            if not self._autodetectButton.get_no_show_all():
                self._autodetectButton.set_active(True)
                self.data.method.method = "cdrom"
            else:
                self._networkButton.set_active(True)
                self.data.method.method = None
                self._proxyUrl = self.data.method.proxy

        self._setup_no_updates()

        # Setup the addon repos
        self._reset_repoStore()

        # Then, some widgets get enabled/disabled/greyed out depending on
        # how others are set up.  We can use the signal handlers to handle
#.........这里部分代码省略.........
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:103,代码来源:source.py


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