本文整理汇总了Python中pyanaconda.threads.threadMgr.get函数的典型用法代码示例。如果您正苦于以下问题:Python get函数的具体用法?Python get怎么用?Python get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _software_is_ready
def _software_is_ready(self):
# FIXME: Would be nicer to just ask the spoke if it's ready.
return (not threadMgr.get(constants.THREAD_PAYLOAD) and
not threadMgr.get(constants.THREAD_PAYLOAD_MD) and
not threadMgr.get(constants.THREAD_SOFTWARE_WATCHER) and
not threadMgr.get(constants.THREAD_CHECK_SOFTWARE) and
self.payload.baseRepo is not None)
示例2: ready
def ready(self):
""" Check if the spoke is ready. """
return (
self._ready
and not threadMgr.get(THREAD_PAYLOAD_MD)
and not threadMgr.get(THREAD_SOFTWARE_WATCHER)
and not threadMgr.get(THREAD_CHECK_SOFTWARE)
)
示例3: completed
def completed(self):
retval = (threadMgr.get(constants.THREAD_EXECUTE_STORAGE) is None and
threadMgr.get(constants.THREAD_CHECK_STORAGE) is None and
self.storage.rootDevice is not None and
not self.errors)
if flags.automatedInstall:
return retval and self.data.bootloader.seen
else:
return retval
示例4: ready
def ready(self):
# By default, the software selection spoke is not ready. We have to
# wait until the installation source spoke is completed. This could be
# because the user filled something out, or because we're done fetching
# repo metadata from the mirror list, or we detected a DVD/CD.
return bool(not threadMgr.get(constants.THREAD_SOFTWARE_WATCHER) and
not threadMgr.get(constants.THREAD_PAYLOAD_MD) and
not threadMgr.get(constants.THREAD_CHECK_SOFTWARE) and
self.payload.baseRepo is not None)
示例5: completed
def completed(self):
processingDone = bool(not threadMgr.get(constants.THREAD_CHECK_SOFTWARE) and
not threadMgr.get(constants.THREAD_PAYLOAD) and
not self._errorMsgs and self.txid_valid)
# we should always check processingDone before checking the other variables,
# as they might be inconsistent until processing is finished
if self._kickstarted:
return processingDone and self.data.packages.seen
else:
return processingDone and self._get_selected_environment() is not None
示例6: wait_and_fetch_net_data
def wait_and_fetch_net_data(url, out_file, ca_certs=None):
"""
Function that waits for network connection and starts a thread that fetches
data over network.
:see: org_fedora_oscap.data_fetch.fetch_data
:return: the name of the thread running fetch_data
:rtype: str
"""
# get thread that tries to establish a network connection
nm_conn_thread = threadMgr.get(constants.THREAD_WAIT_FOR_CONNECTING_NM)
if nm_conn_thread:
# NM still connecting, wait for it to finish
nm_conn_thread.join()
if not nm.nm_is_connected():
raise OSCAPaddonNetworkError("Network connection needed to fetch data.")
fetch_data_thread = AnacondaThread(name=THREAD_FETCH_DATA,
target=fetch_data,
args=(url, out_file, ca_certs),
fatal=False)
# register and run the thread
threadMgr.add(fetch_data_thread)
return THREAD_FETCH_DATA
示例7: _check_discover
def _check_discover(self, *args):
""" After the zFCP discover thread runs, check to see whether a valid
device was discovered. Display an error message if not.
If the discover is not done, return True to indicate that the check
has to be run again, otherwise check the discovery and return False.
"""
# Discovery is not done, return True.
if threadMgr.get(constants.THREAD_ZFCP_DISCOVER):
return True
# Discovery has finished, run the check.
self._spinner.stop()
if self._discoveryError:
# Failure, display a message and leave the user on the dialog so
# they can try again (or cancel)
self._errorLabel.set_text(self._discoveryError)
self._discoveryError = None
self._conditionNotebook.set_current_page(2)
self._set_configure_sensitive(True)
else:
# Great success. Just return to the advanced storage window and let the
# UI update with the newly-added device
self.window.response(1)
return False
self._cancelButton.set_sensitive(True)
# Discovery and the check have finished, return False.
return False
示例8: restartThread
def restartThread(self, storage, ksdata, payload, instClass, fallback=False, checkmount=True):
"""Start or restart the payload thread.
This method starts a new thread to restart the payload thread, so
this method's return is not blocked by waiting on the previous payload
thread. If there is already a payload thread restart pending, this method
has no effect.
:param blivet.Blivet storage: The blivet storage instance
:param kickstart.AnacondaKSHandler ksdata: The kickstart data instance
:param packaging.Payload payload: The payload instance
:param installclass.BaseInstallClass instClass: The install class instance
:param bool fallback: Whether to fall back to the default repo in case of error
:param bool checkmount: Whether to check for valid mounted media
"""
log.debug("Restarting payload thread")
# If a restart thread is already running, don't start a new one
if threadMgr.get(THREAD_PAYLOAD_RESTART):
return
# Launch a new thread so that this method can return immediately
threadMgr.add(AnacondaThread(name=THREAD_PAYLOAD_RESTART, target=self._restartThread,
args=(storage, ksdata, payload, instClass, fallback, checkmount)))
示例9: _check_discover
def _check_discover(self, *args):
if threadMgr.get(constants.THREAD_ISCSI_DISCOVER):
return True
# When iscsi discovery is done, update the UI. We don't need to worry
# about the user escaping from the dialog because all the buttons are
# marked insensitive.
spinner = self.builder.get_object("waitSpinner")
spinner.stop()
if self._discoveryError:
# Failure. Display some error message and leave the user on the
# dialog to try again.
self.builder.get_object("discoveryErrorLabel").set_text(self._discoveryError)
self._discoveryError = None
self._conditionNotebook.set_current_page(2)
self._set_configure_sensitive(True)
else:
# Success. Now populate the node store and kick the user on over to
# that subscreen.
self._add_nodes(self._discoveredNodes)
self._iscsiNotebook.set_current_page(1)
self._okButton.set_sensitive(True)
# If some form of login credentials were used for discovery,
# default to using the same for login.
if self._authTypeCombo.get_active() != 0:
self._loginAuthTypeCombo.set_active(3)
# We always want to enable this button, in case the user's had enough.
self._cancelButton.set_sensitive(True)
return False
示例10: refresh
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
示例11: completed
def completed(self):
processingDone = not threadMgr.get(constants.THREAD_CHECK_SOFTWARE) and \
not self._errorMsgs and self.txid_valid
if flags.automatedInstall:
return processingDone and self.data.packages.seen
else:
return self._get_selected_environment() is not None and processingDone
示例12: completed
def completed(self):
""" Make sure our threads are done running and vars are set. """
processingDone = not threadMgr.get(THREAD_CHECK_SOFTWARE) and \
not self.errors and self.txid_valid
if flags.automatedInstall:
return processingDone and self.payload.baseRepo and self.data.packages.seen
else:
return self.payload.baseRepo and self.environment is not None and processingDone
示例13: completed
def completed(self):
processingDone = bool(not threadMgr.get(constants.THREAD_CHECK_SOFTWARE) and
not threadMgr.get(constants.THREAD_PAYLOAD) and
not self._errorMsgs and self.txid_valid)
# * we should always check processingDone before checking the other variables,
# as they might be inconsistent until processing is finished
# * we can't let the installation proceed until a valid environment has been set
if processingDone:
if self.environment is not None:
# if we have environment it needs to be valid
return self.environment_valid
# if we don't have environment we need to at least have the %packages
# section in kickstart
elif flags.automatedInstall and self.data.packages.seen:
return True
# no environment and no %packages section -> manual intervention is needed
else:
return False
else:
return 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: refresh
def refresh(self):
"""Refresh location info"""
# first check if a provider is available
if self._provider is None:
log.error("Geoloc: can't refresh - no provider")
return
# then check if a refresh is already in progress
if threadMgr.get(constants.THREAD_GEOLOCATION_REFRESH):
log.debug("Geoloc: refresh already in progress")
else: # wait for Internet connectivity
if network.wait_for_connectivity():
threadMgr.add(AnacondaThread(name=constants.THREAD_GEOLOCATION_REFRESH, target=self._provider.refresh))
else:
log.error("Geolocation refresh failed" " - no connectivity")