本文整理汇总了Python中pyanaconda.ui.gui.spokes.NormalSpoke.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python NormalSpoke.initialize方法的具体用法?Python NormalSpoke.initialize怎么用?Python NormalSpoke.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyanaconda.ui.gui.spokes.NormalSpoke
的用法示例。
在下文中一共展示了NormalSpoke.initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
"""
The initialize method that is called after the instance is created.
The difference between __init__ and this method is that this may take
a long time and thus could be called in a separated thread.
:see: pyanaconda.ui.common.UIObject.initialize
"""
NormalSpoke.initialize(self)
self.initialize_start()
self._storage_playground = None
config.log_dir = "/tmp"
self.client = osinstall.BlivetGUIAnacondaClient()
box = self.builder.get_object("BlivetGuiViewport")
self.label_actions = self.builder.get_object("summary_label")
self.button_reset = self.builder.get_object("resetAllButton")
self.button_undo = self.builder.get_object("undoLastActionButton")
config.default_fstype = self._storage.default_fstype
self.blivetgui = osinstall.BlivetGUIAnaconda(self.client, self, box)
# this needs to be done when the spoke is already "realized"
self.entered.connect(self.blivetgui.ui_refresh)
# set up keyboard shurtcuts for blivet-gui (and unset them after
# user lefts the spoke)
self.entered.connect(self.blivetgui.set_keyboard_shortcuts)
self.exited.connect(self.blivetgui.unset_keyboard_shortcuts)
self.initialize_done()
示例2: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self.initialize_start()
self.pages = [SearchPage(self.storage, self.builder),
MultipathPage(self.storage, self.builder),
OtherPage(self.storage, self.builder),
ZPage(self.storage, self.builder)]
self._notebook = self.builder.get_object("advancedNotebook")
if not arch.is_s390():
self._notebook.remove_page(-1)
self.builder.get_object("addZFCPButton").destroy()
self.builder.get_object("addDASDButton").destroy()
if not has_fcoe():
self.builder.get_object("addFCOEButton").destroy()
if not iscsi.available:
self.builder.get_object("addISCSIButton").destroy()
self._store = self.builder.get_object("diskStore")
self._addDisksButton = self.builder.get_object("addDisksButton")
# report that we are done
self.initialize_done()
示例3: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
"""
The initialize method that is called after the instance is created.
The difference between __init__ and this method is that this may take
a long time and thus could be called in a separated thread.
:see: pyanaconda.ui.common.UIObject.initialize
"""
NormalSpoke.initialize(self)
self.success = False
self.complete = False
self.data.addons.org_centos_cloud.env = "firstboot"
self.button = self.builder.get_object("button1")
self.progressbar = self.builder.get_object("progressbar1")
if self.data.addons.org_centos_cloud.state == "False":
# Addon is disabled
self.complete = True
elif self.data.addons.org_centos_cloud.state == "True":
#print("--disable")
if self.data.addons.org_centos_cloud.arguments == "--allinone":
pass # call run packstack --allinone or activate click button
elif self.data.addons.org_centos_cloud.arguments: # --answer-file
pass # call packstack --answer-file ()
else:
self.complete = False
示例4: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
from pyanaconda.ui.gui.utils import setViewportBackground
NormalSpoke.initialize(self)
# Wouldn't it be nice if glade knew how to do this?
label = self.builder.get_object("summary_button").get_children()[0]
markup = "<span foreground='blue'><u>%s</u></span>" % label.get_text()
label.set_use_markup(True)
label.set_markup(markup)
specializedButton = self.builder.get_object("addSpecializedButton")
# It's uh... uh... it's down there somewhere, let me take another look.
label = specializedButton.get_children()[0].get_children()[0].get_children()[1]
markup = "<span size='large'><b>%s</b></span>" % label.get_text()
label.set_use_markup(True)
label.set_markup(markup)
specializedButton.show_all()
self.local_disks_box = self.builder.get_object("local_disks_box")
self.specialized_disks_box = self.builder.get_object("specialized_disks_box")
threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE_WATCHER,
target=self._initialize))
示例5: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
"""
The initialize method that is called after the instance is created.
The difference between __init__ and this method is that this may take
a long time and thus could be called in a separated thread.
:see: pyanaconda.ui.common.UIObject.initialize
"""
NormalSpoke.initialize(self)
import logging
self.log = logging.getLogger("anaconda")
self.log.info("Rocks was here")
# self.builder.connect_signals(self)
# Get the Main Window, and connect the "destroy" event
# self.window = self.builder.get_object("RollsWindow")
self.rollUrl = self.builder.get_object("rollUrl")
self.rollUrl.set_text(self.defaultUrl)
self.listStore = self.builder.get_object("listRoll")
self.selectStore = self.builder.get_object("selectedRolls")
self.rollSelectCombo = self.builder.get_object("rollSelectCombo")
sys.path.append("/opt/rocks/lib/python2.7/site-packages")
import rocks.media
import rocks.installcgi
self.media = rocks.media.Media()
self.install = rocks.installcgi.InstallCGI(rootdir="/tmp/rocks")
示例6: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self._enableButton = self.builder.get_object("enableKdumpCheck")
self._reservationTypeLabel = self.builder.get_object("reservationTypeLabel")
self._autoButton = self.builder.get_object("autoButton")
self._manualButton = self.builder.get_object("manualButton")
self._currentlyReservedLabel = self.builder.get_object("currentlyReservedLabel")
self._currentlyReservedMB = self.builder.get_object("currentlyReservedMB")
self._toBeReservedLabel = self.builder.get_object("toBeReservedLabel")
self._toBeReservedSpin = self.builder.get_object("toBeReservedSpin")
self._totalMemLabel = self.builder.get_object("totalMemLabel")
self._totalMemMB = self.builder.get_object("totalMemMB")
self._usableMemLabel = self.builder.get_object("usableMemLabel")
self._usableMemMB = self.builder.get_object("usableMemMB")
self._config_buffer = self.builder.get_object("advancedConfigBuffer")
# Set an initial value and adjustment on the spin button
lower, upper, step = getMemoryBounds()
adjustment = Gtk.Adjustment(lower, lower, upper, step, step, 0)
self._toBeReservedSpin.set_adjustment(adjustment)
self._toBeReservedSpin.set_value(lower)
# Initialize the advanced config area with the contents of /etc/kdump.conf
try:
with open(CONFIG_FILE, "r") as fobj:
self._config_buffer.set_text(fobj.read())
except IOError:
self._config_buffer.set_text("")
示例7: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self._done = False
init_dep_injection()
facts = inj.require(inj.FACTS)
backend = managergui.Backend()
self._registergui = registergui.RegisterScreen(backend, facts,
callbacks=[self.finished])
self._action_area = self.builder.get_object("RHSMSpokeWindow-action_area1")
self._register_box = self._registergui.dialog_vbox6
# FIXME: close_window handling is kind of a mess. Standlone subman gui,
# the firstboot screens, and initial-setup need it to do different
# things. Potentially a 'Im done with this window now' signal, with
# each attaching different handlers.
self._registergui.close_window_callback = self._close_window_callback
# we have a ref to _register_box, but need to remove it from
# the regustergui.window (a GtkDialog), and add it to the main
# box in the action area of our initial-setup screen.
self._registergui.window.remove(self._register_box)
self._action_area.pack_end(self._register_box, True, True, 0)
self._action_area.show()
self._register_box.show_all()
self._registergui.initialize()
示例8: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self.local_disks_box = self.builder.get_object("local_disks_box")
self.specialized_disks_box = self.builder.get_object("specialized_disks_box")
threadMgr.add(AnacondaThread(name=constants.THREAD_STORAGE_WATCHER,
target=self._initialize))
示例9: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self.initialize_start()
# set X keyboard defaults
# - this needs to be done early in spoke initialization so that
# the spoke status does not show outdated keyboard selection
keyboard.set_x_keyboard_defaults(self.data, self._xkl_wrapper)
# make sure the x_layouts list has at least one keyboard layout
if not self.data.keyboard.x_layouts:
self.data.keyboard.x_layouts.append(DEFAULT_KEYBOARD)
self._add_dialog = AddLayoutDialog(self.data)
self._add_dialog.initialize()
if flags.can_touch_runtime_system("hide runtime keyboard configuration "
"warning", touch_live=True):
self.builder.get_object("warningBox").hide()
# We want to store layouts' names but show layouts as
# 'language (description)'.
layoutColumn = self.builder.get_object("layoutColumn")
layoutRenderer = self.builder.get_object("layoutRenderer")
override_cell_property(layoutColumn, layoutRenderer, "text", _show_layout,
self._xkl_wrapper)
self._store = self.builder.get_object("addedLayoutStore")
self._add_data_layouts()
self._selection = self.builder.get_object("layoutSelection")
self._switching_dialog = ConfigureSwitchingDialog(self.data)
self._switching_dialog.initialize()
self._layoutSwitchLabel = self.builder.get_object("layoutSwitchLabel")
if not flags.can_touch_runtime_system("test X layouts", touch_live=True):
# Disable area for testing layouts as we cannot make
# it work without modifying runtime system
widgets = [self.builder.get_object("testingLabel"),
self.builder.get_object("testingWindow"),
self.builder.get_object("layoutSwitchLabel")]
# Use testingLabel's text to explain why this part is not
# sensitive.
widgets[0].set_text(_("Testing layouts configuration not "
"available."))
for widget in widgets:
widget.set_sensitive(False)
hubQ.send_not_ready(self.__class__.__name__)
hubQ.send_message(self.__class__.__name__,
_("Getting list of layouts..."))
threadMgr.add(AnacondaThread(name=THREAD_KEYBOARD_INIT,
target=self._wait_ready))
示例10: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
"""
The initialize method that is called after the instance is created.
The difference between __init__ and this method is that this may take
a long time and thus could be called in a separated thread.
:see: pyanaconda.ui.common.UIObject.initialize
"""
NormalSpoke.initialize(self)
示例11: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
# 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.add_check(self.pw, self._checkPasswordEmpty)
# the password confirmation needs to be checked whenever either of the password
# fields change. attach to the confirm field so that errors focus on confirm,
# and check changes to the password field in on_password_changed
self._confirm_check = self.add_check(self.confirm, self._checkPasswordConfirm)
# Keep a reference for these checks, since they have to be manually run for the
# click Done twice check.
self._pwStrengthCheck = self.add_check(self.pw, self._checkPasswordStrength)
self._pwASCIICheck = self.add_check(self.pw, self._checkPasswordASCII)
self.add_check(self.confirm, self._checkPasswordEmpty)
# Counters for checks that ask the user to click Done to confirm
self._waiveStrengthClicks = 0
self._waiveASCIIClicks = 0
# Password validation data
self._pwq_error = None
self._pwq_valid = True
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()
示例12: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
from pyanaconda.threads import threadMgr, AnacondaThread
NormalSpoke.initialize(self)
self._grabObjects()
# I shouldn't have to do this outside GtkBuilder, but it really doesn't
# want to let me pass in user data.
self._autodetectButton.connect("toggled", self.on_source_toggled, self._autodetectBox)
self._isoButton.connect("toggled", self.on_source_toggled, self._isoBox)
self._networkButton.connect("toggled", self.on_source_toggled, self._networkBox)
threadMgr.add(AnacondaThread(name=constants.THREAD_SOURCE_WATCHER, target=self._initialize))
示例13: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
self._daysStore = self.builder.get_object("days")
self._monthsStore = self.builder.get_object("months")
self._yearsStore = self.builder.get_object("years")
self._regionsStore = self.builder.get_object("regions")
self._citiesStore = self.builder.get_object("cities")
self._tzmap = self.builder.get_object("tzmap")
# we need to know it the new value is the same as previous or not
self._old_region = None
self._old_city = None
self._regionCombo = self.builder.get_object("regionCombobox")
self._cityCombo = self.builder.get_object("cityCombobox")
self._monthCombo = self.builder.get_object("monthCombobox")
self._dayCombo = self.builder.get_object("dayCombobox")
self._yearCombo = self.builder.get_object("yearCombobox")
self._daysFilter = self.builder.get_object("daysFilter")
self._daysFilter.set_visible_func(self.existing_date, None)
self._citiesFilter = self.builder.get_object("citiesFilter")
self._citiesFilter.set_visible_func(self.city_in_region, None)
self._hoursLabel = self.builder.get_object("hoursLabel")
self._minutesLabel = self.builder.get_object("minutesLabel")
self._amPmUp = self.builder.get_object("amPmUpButton")
self._amPmDown = self.builder.get_object("amPmDownButton")
self._amPmLabel = self.builder.get_object("amPmLabel")
self._radioButton24h = self.builder.get_object("timeFormatRB")
self._ntpSwitch = self.builder.get_object("networkTimeSwitch")
self._regions_zones = get_all_regions_and_timezones()
self._months_nums = dict()
# Set the initial sensitivity of the AM/PM toggle based on the time-type selected
self._radioButton24h.emit("toggled")
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()
threadMgr.add(AnacondaThread(name=constants.THREAD_DATE_TIME,
target=self._initialize))
示例14: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
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()
示例15: initialize
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import initialize [as 别名]
def initialize(self):
NormalSpoke.initialize(self)
# place holders for the text boxes
self.pw = self.builder.get_object("pw")
self.confirm = self.builder.get_object("confirm")
self.lock = self.builder.get_object("lock")
# 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?
# - Is there any data in the confirm box?
self.add_check(self.pw, self._checkPasswordEmpty)
# The password confirmation needs to be checked whenever either of the password
# fields change. Separate checks are created for each field so that edits on either
# will trigger a new check and so that the last edited field will get focus when
# Done is clicked. The checks are saved here so that either check can trigger the
# other check in order to reset the status on both when either field is changed.
# The check_data field is used as a flag to prevent infinite recursion.
self._confirm_check = self.add_check(self.confirm, self._checkPasswordConfirm)
self._password_check = self.add_check(self.pw, self._checkPasswordConfirm)
# Keep a reference for this check, since it has to be manually run for the
# click Done twice check.
self._pwStrengthCheck = self.add_check(self.pw, self._checkPasswordStrength)
self.add_check(self.confirm, self._checkPasswordEmpty)
# Counter for the click Done twice check override
self._waivePasswordClicks = 0
# Password validation data
self._pwq_error = None
self._pwq_valid = True
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)