#2 could just be a master fix, but it doesn't hurt anything to put it on f18-beta-branch as well. The other three fix bugs which perhaps do not block beta yet, but should.
- Chris
--- pyanaconda/storage/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index d3b334c..5e4e58c 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -2156,7 +2156,7 @@ class Storage(object): members = container.parents
self.__cleanUpMemberDevices(members) - raise + raise StorageError(e)
if factory.encrypted and factory.encrypt_leaves: fmt = getFormat(luks_fmt_type,
--- pyanaconda/ui/gui/spokes/custom.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 6f00864..66f3085 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -2143,6 +2143,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): message_type=Gtk.MessageType.ERROR, buttons=Gtk.ButtonsType.CLOSE, message_format=str(self._error)) + dlg.set_decorated(False)
with enlightbox(self.window, dlg): dlg.run()
Spokes are imported very early (when the UI is being constructed), which is before a language has been chosen. Thus, any strings at the top of the file will be set up with the original translation, not the translation the user selects. The fix is to simply translate them when they are needed and not before. --- pyanaconda/ui/gui/spokes/custom.py | 98 +++++++++++++++--------------- pyanaconda/ui/gui/spokes/datetime_spoke.py | 4 +- pyanaconda/ui/gui/spokes/keyboard.py | 4 +- pyanaconda/ui/gui/spokes/source.py | 14 ++--- 4 files changed, 60 insertions(+), 60 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 66f3085..d8ca246 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -80,15 +80,15 @@ NOTEBOOK_LABEL_PAGE = 0 NOTEBOOK_DETAILS_PAGE = 1 NOTEBOOK_LUKS_PAGE = 2
-new_install_name = _("New %s %s Installation") % (productName, productVersion) -unrecoverable_error_msg = _("Storage configuration reset due to unrecoverable " - "error. Click for details.") -device_configuration_error_msg = _("Device reconfiguration failed. Click for " - "details.") +new_install_name = N_("New %s %s Installation") % (productName, productVersion) +unrecoverable_error_msg = N_("Storage configuration reset due to unrecoverable " + "error. Click for details.") +device_configuration_error_msg = N_("Device reconfiguration failed. Click for " + "details.")
-empty_mountpoint_msg = _("Please enter a valid mountpoint.") -invalid_mountpoint_msg = _("That mount point is invalid. Try something else?") -mountpoint_in_use_msg = _("That mount point is already in use. Try something else?") +empty_mountpoint_msg = N_("Please enter a valid mountpoint.") +invalid_mountpoint_msg = N_("That mount point is invalid. Try something else?") +mountpoint_in_use_msg = N_("That mount point is already in use. Try something else?")
MOUNTPOINT_OK = 0 MOUNTPOINT_INVALID = 1 @@ -100,10 +100,10 @@ mountpoint_validation_msgs = {MOUNTPOINT_OK: "", MOUNTPOINT_IN_USE: mountpoint_in_use_msg, MOUNTPOINT_EMPTY: empty_mountpoint_msg}
-DEVICE_TEXT_LVM = _("LVM") -DEVICE_TEXT_MD = _("RAID") -DEVICE_TEXT_PARTITION = _("Standard Partition") -DEVICE_TEXT_BTRFS = _("BTRFS") +DEVICE_TEXT_LVM = N_("LVM") +DEVICE_TEXT_MD = N_("RAID") +DEVICE_TEXT_PARTITION = N_("Standard Partition") +DEVICE_TEXT_BTRFS = N_("BTRFS")
# FIXME: use these everywhere instead of the AUTOPART_TYPE constants DEVICE_TYPE_LVM = 0 @@ -215,7 +215,7 @@ class AddDialog(GUIObject): self.mountpoint = self.builder.get_object("addMountPointEntry").get_text() self._error = validate_mountpoint(self.mountpoint, self.mountpoints, strict=False) - self._warningLabel.set_text(mountpoint_validation_msgs[self._error]) + self._warningLabel.set_text(_(mountpoint_validation_msgs[self._error])) self.window.show_all() if self._error: return @@ -750,7 +750,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # ensures it's only added once. if not new_devices: page = CreateNewPage(self.on_create_clicked) - page.pageTitle = new_install_name + page.pageTitle = _(new_install_name) self._accordion.addPage(page, cb=self.on_page_clicked)
if page.pageTitle not in page_order: @@ -768,7 +768,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if device in self.bootLoaderDevices: mounts[device.format.type] = device
- new_root = Root(mounts=mounts, swaps=swaps, name=new_install_name) + new_root = Root(mounts=mounts, swaps=swaps, name=_(new_install_name)) ui_roots.insert(0, new_root)
# Add in all the existing (or autopart-created) operating systems. @@ -777,7 +777,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # Also, only include devices in an old page if the format is intact. if not [d for d in root.swaps + root.mounts.values() if d in self._devices and d.disks and - (root.name == new_install_name or d.format.exists)]: + (root.name == _(new_install_name) or d.format.exists)]: continue
page = Page() @@ -786,7 +786,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): for (mountpoint, device) in root.mounts.iteritems(): if device not in self._devices or \ not device.disks or \ - (root.name != new_install_name and not device.format.exists): + (root.name != _(new_install_name) and not device.format.exists): continue
selector = page.addDevice(self._mountpointName(mountpoint) or device.format.name, Size(spec="%f MB" % device.size), mountpoint, self.on_selector_clicked) @@ -795,7 +795,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
for device in root.swaps: if device not in self._devices or \ - (root.name != new_install_name and not device.format.exists): + (root.name != _(new_install_name) and not device.format.exists): continue
selector = page.addDevice("Swap", @@ -864,15 +864,15 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def add_new_selector(self, device): """ Add an entry for device to the new install Page. """ - page = self._accordion._find_by_title(new_install_name).get_child() + page = self._accordion._find_by_title(_(new_install_name)).get_child() devices = [device] if not hasattr(page, "_members"): # remove the CreateNewPage and replace it with a regular Page - expander = self._accordion._find_by_title(new_install_name) + expander = self._accordion._find_by_title(_(new_install_name)) expander.remove(expander.get_child())
page = Page() - page.pageTitle = new_install_name + page.pageTitle = _(new_install_name) expander.add(page)
# pull in all the existing swap devices @@ -898,7 +898,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): def _update_btrfs_selectors(self): """ Update all btrfs selectors' size properties. """ # we're only updating selectors in the new root. problem? - page = self._accordion._find_by_title(new_install_name).get_child() + page = self._accordion._find_by_title(_(new_install_name)).get_child() if not hasattr(page, "_members"): return
@@ -985,7 +985,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if mountpoint is not None and mountpoint != old_mountpoint: error = validate_mountpoint(mountpoint, self.__storage.mountpoints.keys()) if error: - self._error = mountpoint_validation_msgs[error] + self._error = _(mountpoint_validation_msgs[error]) self.window.set_info(Gtk.MessageType.WARNING, self._error) self.window.show_all() self._populate_right_side(selector) @@ -1001,11 +1001,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): error = None if device_type != AUTOPART_TYPE_PLAIN and mountpoint == "/boot/efi": error = (_("/boot/efi must be on a device of type %s") - % DEVICE_TEXT_PARTITION) + % _(DEVICE_TEXT_PARTITION)) elif device_type != AUTOPART_TYPE_PLAIN and \ fs_type_short in partition_only_format_types: error = (_("%s must be on a device of type %s") - % (fs_type, DEVICE_TEXT_PARTITION)) + % (fs_type, _(DEVICE_TEXT_PARTITION))) elif mountpoint and encrypted and mountpoint.startswith("/boot"): error = _("%s cannot be encrypted") % mountpoint elif encrypted and fs_type_short in partition_only_format_types: @@ -1097,14 +1097,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): except ErrorRecoveryFailure as e: self._error = e self.window.set_info(Gtk.MessageType.WARNING, - unrecoverable_error_msg) + _(unrecoverable_error_msg)) self.window.show_all() self._reset_storage() except StorageError as e: log.error("newDevice failed: %s" % e) self._error = e self.window.set_info(Gtk.MessageType.WARNING, - device_configuration_error_msg) + _(device_configuration_error_msg)) self.window.show_all()
# in this case we have removed the old device so we now have @@ -1135,7 +1135,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self.clear_errors() self._error = e self.window.set_info(Gtk.MessageType.WARNING, - unrecoverable_error_msg) + _(unrecoverable_error_msg)) self.window.show_all() self._reset_storage() else: @@ -1194,14 +1194,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): except ErrorRecoveryFailure as e: self._error = e self.window.set_info(Gtk.MessageType.WARNING, - unrecoverable_error_msg) + _(unrecoverable_error_msg)) self.window.show_all() self._reset_storage() except StorageError as e: log.error("newDevice failed: %s" % e) self._error = e self.window.set_info(Gtk.MessageType.WARNING, - device_configuration_error_msg) + _(device_configuration_error_msg)) self.window.show_all()
self._devices = self.__storage.devices @@ -1284,7 +1284,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): for page in self._accordion.allPages: for _selector in getattr(page, "_members", []): if _selector._device in (device, old_device): - if page.pageTitle == new_install_name: + if page.pageTitle == _(new_install_name): new_selector = _selector continue
@@ -1470,14 +1470,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): device_type_text = typeCombo.get_active_text() log.info("getting device type for %s" % device_type_text) device_type = None - if device_type_text == DEVICE_TEXT_LVM: - device_type = DEVICE_TYPE_LVM - elif device_type_text == DEVICE_TEXT_MD: - device_type = DEVICE_TYPE_MD - elif device_type_text == DEVICE_TEXT_PARTITION: - device_type = DEVICE_TYPE_PARTITION - elif device_type_text == DEVICE_TEXT_BTRFS: - device_type = DEVICE_TYPE_BTRFS + if device_type_text == _(DEVICE_TEXT_LVM): + device_type = _(DEVICE_TYPE_LVM) + elif device_type_text == _(DEVICE_TEXT_MD): + device_type = _(DEVICE_TYPE_MD) + elif device_type_text == _(DEVICE_TEXT_PARTITION): + device_type = _(DEVICE_TYPE_PARTITION) + elif device_type_text == _(DEVICE_TEXT_BTRFS): + device_type = _(DEVICE_TYPE_BTRFS) else: log.error("unknown device type: '%s'" % device_type_text)
@@ -1590,10 +1590,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): md_pos = None md_included = False for idx, itr in enumerate(typeCombo.get_model()): - if itr[0] == DEVICE_TEXT_BTRFS: + if itr[0] == _(DEVICE_TEXT_BTRFS): btrfs_pos = idx btrfs_included = True - elif itr[0] == DEVICE_TEXT_MD: + elif itr[0] == _(DEVICE_TEXT_MD): md_pos = idx md_included = True
@@ -1601,7 +1601,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): include_md = (use_dev.type == "mdarray" or len(self._clearpartDevices) > 1) if include_md and not md_included: - typeCombo.append_text(DEVICE_TEXT_MD) + typeCombo.append_text(_(DEVICE_TEXT_MD)) elif md_included and not include_md: typeCombo.remove(md_pos)
@@ -1609,7 +1609,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): include_btrfs = (use_dev.format.type not in partition_only_format_types + ["swap"]) if include_btrfs and not btrfs_included: - typeCombo.append_text(DEVICE_TEXT_BTRFS) + typeCombo.append_text(_(DEVICE_TEXT_BTRFS)) elif btrfs_included and not include_btrfs: typeCombo.remove(btrfs_pos)
@@ -1618,13 +1618,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): partition_pos = None lvm_pos = None for idx, itr in enumerate(typeCombo.get_model()): - if itr[0] == DEVICE_TEXT_BTRFS: + if itr[0] == _(DEVICE_TEXT_BTRFS): btrfs_pos = idx - elif itr[0] == DEVICE_TEXT_MD: + elif itr[0] == _(DEVICE_TEXT_MD): md_pos = idx - elif itr[0] == DEVICE_TEXT_PARTITION: + elif itr[0] == _(DEVICE_TEXT_PARTITION): partition_pos = idx - elif itr[0] == DEVICE_TEXT_LVM: + elif itr[0] == _(DEVICE_TEXT_LVM): lvm_pos = idx
raid_level = None @@ -1735,7 +1735,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): log.error("error recovery failure") self._error = e self.window.set_info(Gtk.MessageType.ERROR, - unrecoverable_error_msg) + _(unrecoverable_error_msg)) self.window.show_all() self._reset_storage() except StorageError as e: @@ -1836,7 +1836,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
log.debug("removing device '%s' from page %s" % (device, root_name))
- if root_name == new_install_name: + if root_name == _(new_install_name): if device.exists: # This is an existing device that was added to the new page. # All we want to do is revert any changes to the device and diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index f3249bb..7ad523f 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -53,7 +53,7 @@ SERVER_QUERY = 2
DEFAULT_TZ = "America/New_York"
-POOL_SERVERS_NOTE = _("Note: pool servers may not be available all the time") +POOL_SERVERS_NOTE = N_("Note: pool servers may not be available all the time")
class NTPconfigDialog(GUIObject): builderObjects = ["ntpConfigDialog", "addImage", "serversStore"] @@ -228,7 +228,7 @@ class NTPconfigDialog(GUIObject): itr = self._serversStore.append([server, SERVER_QUERY, True])
if "pool" in server: - self._poolsNote.set_text(POOL_SERVERS_NOTE) + self._poolsNote.set_text(_(POOL_SERVERS_NOTE))
#do not block UI while starting thread (may take some time) self._refresh_server_working(itr) diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 714d07d..81d59e2 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -37,7 +37,7 @@ from pyanaconda import flags __all__ = ["KeyboardSpoke"]
# %s will be replaced by key combination like Alt+Shift -LAYOUT_SWITCHING_INFO = _("%s to switch layouts.") +LAYOUT_SWITCHING_INFO = N_("%s to switch layouts.")
def _show_layout(column, renderer, model, itr, wrapper): value = wrapper.name_to_show_str[model[itr][0]] @@ -363,7 +363,7 @@ class KeyboardSpoke(NormalSpoke): first_option = self.data.keyboard.switch_options[0] desc = self._xkl_wrapper.switch_to_show_str[first_option]
- self._layoutSwitchLabel.set_text(LAYOUT_SWITCHING_INFO % desc) + self._layoutSwitchLabel.set_text(_(LAYOUT_SWITCHING_INFO) % desc) else: self._layoutSwitchLabel.set_text(_("Layout switching not " "configured.")) diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index af24439..f1271bb 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -47,9 +47,9 @@ __all__ = ["SourceSpoke"]
MOUNTPOINT = "/mnt/install/isodir"
-BASEREPO_SETUP_MESSAGE = _("Setting up installation source...") -METADATA_DOWNLOAD_MESSAGE = _("Downloading package metadata...") -METADATA_ERROR_MESSAGE = _("Error downloading package metadata...") +BASEREPO_SETUP_MESSAGE = N_("Setting up installation source...") +METADATA_DOWNLOAD_MESSAGE = N_("Downloading package metadata...") +METADATA_ERROR_MESSAGE = N_("Error downloading package metadata...")
class ProxyDialog(GUIObject): builderObjects = ["proxyDialog"] @@ -515,7 +515,7 @@ class SourceSpoke(NormalSpoke): communication.send_not_ready("SoftwareSelectionSpoke") communication.send_not_ready(self.__class__.__name__) communication.send_message(self.__class__.__name__, - BASEREPO_SETUP_MESSAGE) + _(BASEREPO_SETUP_MESSAGE)) # this sleep is lame, but without it the message above doesn't seem # to get processed by the hub in time, and is never shown. # FIXME this should get removed when we figure out how to ensure @@ -537,12 +537,12 @@ class SourceSpoke(NormalSpoke): else: self._error = False communication.send_message(self.__class__.__name__, - METADATA_DOWNLOAD_MESSAGE) + _(METADATA_DOWNLOAD_MESSAGE)) self.payload.gatherRepoMetadata() self.payload.release() if not self.payload.baseRepo: communication.send_message(self.__class__.__name__, - METADATA_ERROR_MESSAGE) + _(METADATA_ERROR_MESSAGE)) communication.send_ready(self.__class__.__name__) self._error = True else: @@ -629,7 +629,7 @@ class SourceSpoke(NormalSpoke): if storageThread: storageThread.join()
- communication.send_message(self.__class__.__name__, METADATA_DOWNLOAD_MESSAGE) + communication.send_message(self.__class__.__name__, _(METADATA_DOWNLOAD_MESSAGE))
payloadThread = threadMgr.get("AnaPayloadThread") if payloadThread:
--- pyanaconda/ui/gui/spokes/storage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 95ac1b7..9c6f10e 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -266,7 +266,8 @@ class InstallOptions3Dialog(InstallOptions1Dialog): builderObjects = ["options3_dialog"] mainWidgetName = "options3_dialog"
- def refresh(self, required_space, disks_size, disk_free, fs_free, autopart): + def refresh(self, required_space, disks_size, disk_free, fs_free, autopart + autoPartType): self.custom = not autopart sw_text = self._get_sw_needs_text(required_space) label_text = (_("%s\nYou don't have enough space available to install "
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 95ac1b7..9c6f10e 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -266,7 +266,8 @@ class InstallOptions3Dialog(InstallOptions1Dialog): builderObjects = ["options3_dialog"] mainWidgetName = "options3_dialog"
- def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
- def refresh(self, required_space, disks_size, disk_free, fs_free, autopart
autoPartType): self.custom = not autopart sw_text = self._get_sw_needs_text(required_space) label_text = (_("%s\nYou don't have enough space available to install "
Missed a comma, will fix before pushing.
- Chris
On Mon, 2012-11-05 at 14:54 -0500, Chris Lumens wrote:
#2 could just be a master fix, but it doesn't hurt anything to put it on f18-beta-branch as well. The other three fix bugs which perhaps do not block beta yet, but should.
ACK
- Chris
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches@lists.fedorahosted.org