• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python hubQ.send_ready函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyanaconda.ui.communication.hubQ.send_ready函数的典型用法代码示例。如果您正苦于以下问题:Python send_ready函数的具体用法?Python send_ready怎么用?Python send_ready使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _initialize

    def _initialize(self):
        threadMgr.wait(constants.THREAD_PAYLOAD)
        # Select groups which should be selected by kickstart
        try:
            for group in self.payload.selectedGroupsIDs():
                if self.environment and self.payload.environmentOptionIsDefault(self.environment, group):
                    self._addonStates[group] = self._ADDON_DEFAULT
                else:
                    self._addonStates[group] = self._ADDON_SELECTED
        except PayloadError as e:
            # Group translation is not supported
            log.warning(e)
            # It's better to have all or nothing selected from kickstart
            self._addonStates = {}

        if not self._kickstarted:
            # having done all the slow downloading, we need to do the first refresh
            # of the UI here so there's an environment selected by default.  This
            # happens inside the main thread by necessity.  We can't do anything
            # that takes any real amount of time, or it'll block the UI from
            # updating.
            if not self._first_refresh():
                return

        hubQ.send_ready(self.__class__.__name__, False)

        # If packages were provided by an input kickstart file (or some other means),
        # we should do dependency solving here.
        if not self._error:
            self._apply()

        # report that software spoke initialization has been completed
        self.initialize_done()
开发者ID:zhangsju,项目名称:anaconda,代码行数:33,代码来源:software_selection.py


示例2: ready

    def ready(self):
        """
        The ready property that tells whether the spoke is ready (can be visited)
        or not. The spoke is made (in)sensitive based on the returned value.

        :rtype: bool

        """

        # Check if the hostname starts with "localhost"
        # if
        myHostname = subprocess.check_output(['hostname','-s']).strip()
        if myHostname.startswith("localhost"):
            self.readyState=BADHOSTNAME
            return False
        # if the readyState was BADHOSTNAME return to CONFIGURE state
        # send a message to Hub that we are now ready (only way to
        # to remove this spoke from _notReady list
        if self.readyState == BADHOSTNAME:
            self.readyState = CONFIGURE
            hubQ.send_ready(self.__class__.__name__, True)
        if self.readyState == BUILDING:
            self.log.info("rocks_rolls.py:building db (ready)")
            return False            
        self.log.info("rocks_rolls.py:ready")
        return True
开发者ID:rocksclusters,项目名称:kernel,代码行数:26,代码来源:rocks_rolls.py


示例3: _doExecute

 def _doExecute(self):
     self._ready = False
     hubQ.send_not_ready(self.__class__.__name__)
     # on the off-chance dasdfmt is running, we can't proceed further
     threadMgr.wait(constants.THREAD_DASDFMT)
     hubQ.send_message(self.__class__.__name__, _("Saving storage configuration..."))
     try:
         doKickstartStorage(self.storage, self.data, self.instclass)
     except (StorageError, KickstartValueError) as e:
         log.error("storage configuration failed: %s", e)
         StorageChecker.errors = str(e).split("\n")
         hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
         self.data.bootloader.bootDrive = ""
         self.data.ignoredisk.drives = []
         self.data.ignoredisk.onlyuse = []
         self.storage.config.update(self.data)
         self.storage.reset()
         self.disks = getDisks(self.storage.devicetree)
         # now set ksdata back to the user's specified config
         applyDiskSelection(self.storage, self.data, self.selected_disks)
     except BootLoaderError as e:
         log.error("BootLoader setup failed: %s", e)
         StorageChecker.errors = str(e).split("\n")
         hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
         self.data.bootloader.bootDrive = ""
     else:
         if self.autopart:
             self.run()
     finally:
         resetCustomStorageData(self.data)
         self._ready = True
         hubQ.send_ready(self.__class__.__name__, True)
开发者ID:jresch,项目名称:anaconda,代码行数:32,代码来源:storage.py


示例4: _wait_ready

    def _wait_ready(self):
        self._add_dialog.wait_initialize()
        self._ready = True
        hubQ.send_ready(self.__class__.__name__, False)

        # report that the keyboard spoke initialization has been completed
        self.initialize_done()
开发者ID:dougsland,项目名称:anaconda,代码行数:7,代码来源:keyboard.py


示例5: _doExecute

 def _doExecute(self):
     self._ready = False
     hubQ.send_not_ready(self.__class__.__name__)
     hubQ.send_message(self.__class__.__name__, _("Saving storage configuration..."))
     try:
         doKickstartStorage(self.storage, self.data, self.instclass)
     except (StorageError, KickstartValueError) as e:
         log.error("storage configuration failed: %s", e)
         StorageChecker.errors = str(e).split("\n")
         hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
         self.data.bootloader.bootDrive = ""
         self.data.ignoredisk.drives = []
         self.data.ignoredisk.onlyuse = []
         self.storage.config.update(self.data)
         self.storage.reset()
         self.disks = getDisks(self.storage.devicetree)
         # now set ksdata back to the user's specified config
         self._applyDiskSelection(self.selected_disks)
     except BootLoaderError as e:
         log.error("BootLoader setup failed: %s", e)
         StorageChecker.errors = str(e).split("\n")
         hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
         self.data.bootloader.bootDrive = ""
     else:
         if self.autopart:
             # this was already run as part of doAutoPartition. dumb.
             StorageChecker.errors = []
             StorageChecker.warnings = []
             self.run()
     finally:
         self._ready = True
         hubQ.send_ready(self.__class__.__name__, True)
开发者ID:pombreda,项目名称:anaconda,代码行数:32,代码来源:storage.py


示例6: apply

    def apply(self):
        # Copy data from the UI back to the kickstart object
        homedir = self._tHome.get_text()

        # If the user cleared the home directory, revert back to the
        # default
        if not homedir:
            self._user.homedir = None
        # If the user modified the home directory input, save that the
        # home directory has been modified and use the value.
        elif self._origHome != homedir:
            if not os.path.isabs(homedir):
                homedir = "/" + homedir
            self._user.homedir = homedir

        # Otherwise leave the home directory alone. If the home
        # directory is currently the default value, the next call
        # to refresh() will update the input text to reflect
        # changes in the username.

        if self._cUid.get_active():
            self._user.uid = int(self._uid.get_value())
        else:
            self._user.uid = None

        if self._cGid.get_active():
            self._user.gid = int(self._gid.get_value())
        else:
            self._user.gid = None

        # ''.split(',') returns [''] instead of [], which is not what we want
        self._user.groups = [g.strip() for g in self._tGroups.get_text().split(",") if g]

        # Send ready signal to main event loop
        hubQ.send_ready(self.__class__.__name__, False)
开发者ID:zhangsju,项目名称:anaconda,代码行数:35,代码来源:user.py


示例7: builddb

 def builddb(self):
     oldReady = self.readyState 
     self.log.info("rocks_rolls.py:building db (builddb)")
     self.readyState = BUILDING
     hubQ.send_ready(self.__class__.__name__, False)
     self.buildit(None)
     self.readyState = oldReady
     self.log.info("rocks_rolls.py: database built (builddb)")
     hubQ.send_ready(self.__class__.__name__, True)
开发者ID:rocksclusters,项目名称:kernel,代码行数:9,代码来源:rocks_rolls.py


示例8: initialize

    def initialize(self):
        GUIObject.initialize(self)

        self._grabObjects()

        # Validate the group input box
        self.add_check(self._tGroups, self._validateGroups)
        # Send ready signal to main event loop
        hubQ.send_ready(self.__class__.__name__, False)
开发者ID:jaymzh,项目名称:anaconda,代码行数:9,代码来源:user.py


示例9: decorated

    def decorated(self, *args, **kwargs):
        ret = func(self, *args, **kwargs)

        self._unitialized_status = None
        self._ready = True
        # pylint: disable-msg=E1101
        hubQ.send_ready(self.__class__.__name__, True)
        hubQ.send_message(self.__class__.__name__, self.status)

        return ret
开发者ID:OpenSCAP,项目名称:oscap-anaconda-addon,代码行数:10,代码来源:oscap.py


示例10: checkStorage

    def checkStorage(self):
        threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)

        hubQ.send_not_ready(self._mainSpokeClass)
        hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration..."))
        (StorageChecker.errors,
         StorageChecker.warnings) = self.storage.sanityCheck()
        hubQ.send_ready(self._mainSpokeClass, True)
        for e in StorageChecker.errors:
            self.log.error(e)
        for w in StorageChecker.warnings:
            self.log.warn(w)
开发者ID:mairin,项目名称:anaconda,代码行数:12,代码来源:helpers.py


示例11: _initialize

    def _initialize(self):
        hubQ.send_message(self.__class__.__name__, _("Probing storage..."))

        threadMgr.wait(constants.THREAD_STORAGE)

        hubQ.send_message(self.__class__.__name__, _(METADATA_DOWNLOAD_MESSAGE))

        threadMgr.wait(constants.THREAD_PAYLOAD)

        added = False

        # If there's no fallback mirror to use, we should just disable that option
        # in the UI.
        if not self.payload.mirrorEnabled:
            self._protocolComboBox.remove(PROTOCOL_MIRROR)

        # If we've previously set up to use a CD/DVD method, the media has
        # already been mounted by payload.setup.  We can't try to mount it
        # again.  So just use what we already know to create the selector.
        # Otherwise, check to see if there's anything available.
        if self.data.method.method == "cdrom":
            self._cdrom = self.payload.install_device
        elif not flags.automatedInstall:
            self._cdrom = opticalInstallMedia(self.storage.devicetree)

        if self._cdrom:
            @gtk_action_wait
            def gtk_action_1():
                self._autodetectDeviceLabel.set_text(_("Device: %s") % self._cdrom.name)
                self._autodetectLabel.set_text(_("Label: %s") % (getattr(self._cdrom.format, "label", "") or ""))

            gtk_action_1()
            added = True

        if self.data.method.method == "harddrive":
            self._currentIsoFile = self.payload.ISOImage

        # These UI elements default to not being showable.  If optical install
        # media were found, mark them to be shown.
        if added:
            gtk_call_once(self._autodetectBox.set_no_show_all, False)
            gtk_call_once(self._autodetectButton.set_no_show_all, False)

        # Add the mirror manager URL in as the default for HTTP and HTTPS.
        # We'll override this later in the refresh() method, if they've already
        # provided a URL.
        # FIXME

        self._reset_repoStore()

        self._ready = True
        hubQ.send_ready(self.__class__.__name__, False)
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:52,代码来源:source.py


示例12: checkSoftwareSelection

 def checkSoftwareSelection(self):
     hubQ.send_message(self.__class__.__name__, _("Checking software dependencies..."))
     try:
         self.payload.check_software_selection()
     except DependencyError as e:
         self._error_msgs = str(e)
         hubQ.send_message(self.__class__.__name__, _("Error checking software dependencies"))
         self._tx_id = None
     else:
         self._error_msgs = None
         self._tx_id = self.payload.tx_id
     finally:
         hubQ.send_ready(self.__class__.__name__, False)
         hubQ.send_ready("SourceSpoke", False)
开发者ID:rvykydal,项目名称:anaconda,代码行数:14,代码来源:software_selection.py


示例13: _initialize

    def _initialize(self):
        hubQ.send_message(self.__class__.__name__, _(constants.PAYLOAD_STATUS_PROBING_STORAGE))

        threadMgr.wait(constants.THREAD_STORAGE)
        threadMgr.wait(constants.THREAD_CUSTOM_STORAGE_INIT)

        self.disks = getDisks(self.storage.devicetree)

        # if there's only one disk, select it by default
        if len(self.disks) == 1 and not self.selected_disks:
            applyDiskSelection(self.storage, self.data, [self.disks[0].name])

        self._ready = True
        hubQ.send_ready(self.__class__.__name__, False)
开发者ID:fabiand,项目名称:anaconda-1,代码行数:14,代码来源:storage.py


示例14: _initialize

    def _initialize(self):
        for day in xrange(1, 32):
            self.add_to_store(self._daysStore, day)

        for i in xrange(1, 13):
            #a bit hacky way, but should return the translated string
            #TODO: how to handle language change? Clear and populate again?
            month = datetime.date(2000, i, 1).strftime('%B')
            self.add_to_store(self._monthsStore, month)
            self._months_nums[month] = i

        for year in xrange(1990, 2051):
            self.add_to_store(self._yearsStore, year)

        cities = set()
        xlated_regions = ((region, get_xlated_timezone(region))
                          for region in self._regions_zones.iterkeys())
        for region, xlated in sorted(xlated_regions, cmp=_compare_regions):
            self.add_to_store_xlated(self._regionsStore, region, xlated)
            for city in self._regions_zones[region]:
                cities.add((city, get_xlated_timezone(city)))

        for city, xlated in sorted(cities, cmp=_compare_cities):
            self.add_to_store_xlated(self._citiesStore, city, xlated)

        if self._radioButton24h.get_active():
            self._set_amPm_part_sensitive(False)

        self._update_datetime_timer_id = None
        if is_valid_timezone(self.data.timezone.timezone):
            self._set_timezone(self.data.timezone.timezone)
        elif not flags.flags.automatedInstall:
            log.warning("%s is not a valid timezone, falling back to default (%s)",
                        self.data.timezone.timezone, DEFAULT_TZ)
            self._set_timezone(DEFAULT_TZ)
            self.data.timezone.timezone = DEFAULT_TZ

        if not flags.can_touch_runtime_system("modify system time and date"):
            self._set_date_time_setting_sensitive(False)

        self._config_dialog = NTPconfigDialog(self.data)
        self._config_dialog.initialize()

        time_init_thread = threadMgr.get(constants.THREAD_TIME_INIT)
        if time_init_thread is not None:
            hubQ.send_message(self.__class__.__name__,
                             _("Restoring hardware time..."))
            threadMgr.wait(constants.THREAD_TIME_INIT)

        hubQ.send_ready(self.__class__.__name__, False)
开发者ID:joesaland,项目名称:qubes-installer-qubes-os,代码行数:50,代码来源:datetime_spoke.py


示例15: initialize

    def initialize(self):
        NormalSpoke.initialize(self)
        self.initialize_start()
        # place holders for the text boxes
        self.pw = self.builder.get_object("pw")
        self.confirm = self.builder.get_object("confirmPW")

        # Install the password checks:
        # - Has a password been specified?
        # - If a password has been specified and there is data in the confirm box, do they match?
        # - How strong is the password?
        # - Does the password contain non-ASCII characters?
        # - Is there any data in the confirm box?
        self._confirm_check = self.add_check(self.confirm, self.check_password_confirm)

        # Keep a reference for these checks, since they have to be manually run for the
        # click Done twice check.
        self._pwEmptyCheck = self.add_check(self.pw, self.check_password_empty)
        self._pwStrengthCheck = self.add_check(self.pw, self.check_user_password_strength)
        self._pwASCIICheck = self.add_check(self.pw, self.check_password_ASCII)

        self._kickstarted = self.data.rootpw.seen
        if self._kickstarted:
            self.pw.set_placeholder_text(_("The password is set."))
            self.confirm.set_placeholder_text(_("The password is set."))

        self.pw_bar = self.builder.get_object("password_bar")
        self.pw_label = self.builder.get_object("password_label")

        # Configure levels for the password bar
        self.pw_bar.add_offset_value("low", 2)
        self.pw_bar.add_offset_value("medium", 3)
        self.pw_bar.add_offset_value("high", 4)
        self.pw_bar.add_offset_value("full", 4)

        # Configure the password policy, if available. Otherwise use defaults.
        self.policy = self.data.anaconda.pwpolicy.get_policy("root")
        if not self.policy:
            self.policy = self.data.anaconda.PwPolicyData()

        # set the visibility of the password entries
        set_password_visibility(self.pw, False)
        set_password_visibility(self.confirm, False)

        # Send ready signal to main event loop
        hubQ.send_ready(self.__class__.__name__, False)

        # report that we are done
        self.initialize_done()
开发者ID:jaymzh,项目名称:anaconda,代码行数:49,代码来源:root_password.py


示例16: checkSoftwareSelection

 def checkSoftwareSelection(self):
     from pyanaconda.packaging import DependencyError
     hubQ.send_message(self.__class__.__name__, _("Checking software dependencies..."))
     try:
         self.payload.checkSoftwareSelection()
     except DependencyError as e:
         self._errorMsgs = "\n".join(sorted(e.message))
         hubQ.send_message(self.__class__.__name__, _("Error checking software dependencies"))
         self._tx_id = None
     else:
         self._errorMsgs = None
         self._tx_id = self.payload.txID
     finally:
         hubQ.send_ready(self.__class__.__name__, False)
         hubQ.send_ready("SourceSpoke", False)
开发者ID:pombreda,项目名称:anaconda,代码行数:15,代码来源:software.py


示例17: checkStorage

    def checkStorage(self):
        from pyanaconda.storage_utils import sanity_check, SanityError, SanityWarning

        threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)

        hubQ.send_not_ready(self._mainSpokeClass)
        hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration..."))
        exns = sanity_check(self.storage, min_ram=self._min_ram)
        errors = [str(exn) for exn in exns if isinstance(exn, SanityError)]
        warnings = [str(exn) for exn in exns if isinstance(exn, SanityWarning)]
        (StorageChecker.errors, StorageChecker.warnings) = (errors, warnings)
        hubQ.send_ready(self._mainSpokeClass, True)
        for e in StorageChecker.errors:
            self.log.error(e)
        for w in StorageChecker.warnings:
            self.log.warning(w)
开发者ID:mdk-linux,项目名称:anaconda,代码行数:16,代码来源:helpers.py


示例18: checkStorage

    def checkStorage(self):
        from pyanaconda.storage_utils import storage_checker

        threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)

        hubQ.send_not_ready(self._mainSpokeClass)
        hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration..."))

        report = storage_checker.check(self.storage)
        # Storage spoke and custom spoke communicate errors via StorageCheckHandler,
        # so we need to set errors and warnings class attributes here.
        StorageCheckHandler.errors = report.errors
        StorageCheckHandler.warnings = report.warnings

        hubQ.send_ready(self._mainSpokeClass, True)
        report.log(self.log)
开发者ID:jaymzh,项目名称:anaconda,代码行数:16,代码来源:helpers.py


示例19: _initialize

    def _initialize(self):
        threadMgr.wait(constants.THREAD_PAYLOAD)
        if not self._kickstarted:
            # having done all the slow downloading, we need to do the first refresh
            # of the UI here so there's an environment selected by default.  This
            # happens inside the main thread by necessity.  We can't do anything
            # that takes any real amount of time, or it'll block the UI from
            # updating.
            if not self._first_refresh():
                return

        hubQ.send_ready(self.__class__.__name__, False)

        # If packages were provided by an input kickstart file (or some other means),
        # we should do dependency solving here.
        if not self._error:
            self._apply()
开发者ID:mdk-linux,项目名称:anaconda,代码行数:17,代码来源:software.py


示例20: checkStorage

    def checkStorage(self):
        from blivet.errors import SanityError
        from blivet.errors import SanityWarning

        threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)

        hubQ.send_not_ready(self._mainSpokeClass)
        hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration..."))
        exns = self.storage.sanityCheck()
        errors = [exn.message for exn in exns if isinstance(exn, SanityError)]
        warnings = [exn.message for exn in exns if isinstance(exn, SanityWarning)]
        (StorageChecker.errors, StorageChecker.warnings) = (errors, warnings)
        hubQ.send_ready(self._mainSpokeClass, True)
        for e in StorageChecker.errors:
            self.log.error(e)
        for w in StorageChecker.warnings:
            self.log.warning(w)
开发者ID:akozumpl,项目名称:anaconda,代码行数:17,代码来源:helpers.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python gui.GUIObject类代码示例发布时间:2022-05-25
下一篇:
Python hubQ.send_not_ready函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap