本文整理汇总了Python中pyanaconda.ui.communication.hubQ.send_ready函数的典型用法代码示例。如果您正苦于以下问题:Python send_ready函数的具体用法?Python send_ready怎么用?Python send_ready使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_ready函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()
示例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
示例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)
示例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()
示例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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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()