These four patches fix some hidden and unrevealed issues in the storage spokes.
Vratislav Podzimek (4): Use enumerate() instead of getting indices of iterated items Define default autopart type as a constant Order the autopart types in the same way in GUI and TUI Translate autopart type descriptions in the TUI
pyanaconda/constants.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++---- pyanaconda/ui/tui/spokes/storage.py | 29 ++++++++++++++--------------- 3 files changed, 24 insertions(+), 19 deletions(-)
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/tui/spokes/storage.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 807f4d2..baf1674 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -454,9 +454,8 @@ class AutoPartSpoke(NormalTUISpoke): # Default to clearing everything. self.clearPartType = CLEARPART_TYPE_ALL
- for parttype in self.parttypelist: - c = CheckboxWidget(title="%i) %s" % (self.parttypelist.index(parttype) + 1, - _(parttype)), + for i, parttype in enumerate(self.parttypelist): + c = CheckboxWidget(title="%i) %s" % (i + 1, _(parttype)), completed=(PARTTYPES[parttype] == self.clearPartType)) self._window += [c, ""]
@@ -520,10 +519,8 @@ class PartitionSchemeSpoke(NormalTUISpoke): NormalTUISpoke.refresh(self, args)
schemelist = self.partschemes.keys() - for sch in schemelist: - box = CheckboxWidget(title="%i) %s" %(schemelist.index(sch) \ - + 1, sch), completed=(schemelist.index(sch) \ - == self._selection)) + for i, sch in enumerate(schemelist): + box = CheckboxWidget(title="%i) %s" %(i + 1, sch), completed=(i == self._selection)) self._window += [box, ""]
message = _("Select a partition scheme configuration.")
Also preserve the chosen autopart type between runs of the PartitionScheme TUI spoke.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/constants.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++---- pyanaconda/ui/tui/spokes/storage.py | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py index eff9966..db786b5 100644 --- a/pyanaconda/constants.py +++ b/pyanaconda/constants.py @@ -164,3 +164,5 @@ TAR_SUFFIX = (".tar", ".tbz", ".tgz", ".txz", ".tar.bz2", "tar.gz", "tar.xz")
# cmdline arguments that append instead of overwrite CMDLINE_APPEND = ["modprobe.blacklist"] + +DEFAULT_AUTOPART_TYPE = AUTOPART_TYPE_LVM diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py index 6a9f8a8..5cabcf0 100644 --- a/pyanaconda/ui/gui/spokes/lib/accordion.py +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py @@ -26,6 +26,7 @@ from pyanaconda.product import productName, productVersion from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show from pykickstart.constants import AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_BTRFS from pykickstart.constants import AUTOPART_TYPE_LVM, AUTOPART_TYPE_LVM_THINP +from pyanaconda.constants import DEFAULT_AUTOPART_TYPE
from gi.repository.AnacondaWidgets import MountpointSelector from gi.repository import Gtk @@ -327,10 +328,13 @@ class CreateNewPage(Page): self._createBox.attach(label, 0, 4, 2, 1) label.set_mnemonic_widget(combo)
- store.append([_("Standard Partition"), AUTOPART_TYPE_PLAIN]) - store.append([_("BTRFS"), AUTOPART_TYPE_BTRFS]) - default = store.append([_("LVM"), AUTOPART_TYPE_LVM]) - store.append([_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP]) + for item in ([_("Standard Partition"), AUTOPART_TYPE_PLAIN], + [_("BTRFS"), AUTOPART_TYPE_BTRFS], + [_("LVM"), AUTOPART_TYPE_LVM], + [_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP]): + itr = store.append(item) + if item[1] == DEFAULT_AUTOPART_TYPE: + default = itr
combo.set_margin_left(18) combo.set_margin_right(18) diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index baf1674..032676a 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -39,7 +39,7 @@ from blivet.devicelibs.dasd import format_dasd, make_unformatted_dasd_list from pyanaconda.flags import flags from pyanaconda.kickstart import doKickstartStorage from pyanaconda.threads import threadMgr, AnacondaThread -from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT +from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT, DEFAULT_AUTOPART_TYPE from pyanaconda.constants_text import INPUT_PROCESSED from pyanaconda.i18n import _, P_, N_ from pyanaconda.bootloader import BootLoaderError @@ -501,15 +501,17 @@ class PartitionSchemeSpoke(NormalTUISpoke): title = N_("Partition Scheme Options") category = SystemCategory
- # set default FS to LVM, for consistency with graphical behavior - _selection = 1 - def __init__(self, app, data, storage, payload, instclass): NormalTUISpoke.__init__(self, app, data, storage, payload, instclass) - self.partschemes = OrderedDict([("Standard Partition", AUTOPART_TYPE_PLAIN), - ("LVM", AUTOPART_TYPE_LVM), - ("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP), - ("BTRFS", AUTOPART_TYPE_BTRFS)]) + self.partschemes = OrderedDict() + pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE + for i, item in enumerate([("Standard Partition", AUTOPART_TYPE_PLAIN), + ("LVM", AUTOPART_TYPE_LVM), + ("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP), + ("BTRFS", AUTOPART_TYPE_BTRFS)]): + self.partschemes[item[0]] = item[1] + if item[1] == pre_select: + self._selection = i
@property def indirect(self):
On Wed, May 28, 2014 at 10:31:08AM +0200, Vratislav Podzimek wrote:
Also preserve the chosen autopart type between runs of the PartitionScheme TUI spoke.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
pyanaconda/constants.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++---- pyanaconda/ui/tui/spokes/storage.py | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py index eff9966..db786b5 100644 --- a/pyanaconda/constants.py +++ b/pyanaconda/constants.py @@ -164,3 +164,5 @@ TAR_SUFFIX = (".tar", ".tbz", ".tgz", ".txz", ".tar.bz2", "tar.gz", "tar.xz")
# cmdline arguments that append instead of overwrite CMDLINE_APPEND = ["modprobe.blacklist"]
+DEFAULT_AUTOPART_TYPE = AUTOPART_TYPE_LVM diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py index 6a9f8a8..5cabcf0 100644 --- a/pyanaconda/ui/gui/spokes/lib/accordion.py +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py @@ -26,6 +26,7 @@ from pyanaconda.product import productName, productVersion from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show from pykickstart.constants import AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_BTRFS from pykickstart.constants import AUTOPART_TYPE_LVM, AUTOPART_TYPE_LVM_THINP +from pyanaconda.constants import DEFAULT_AUTOPART_TYPE
from gi.repository.AnacondaWidgets import MountpointSelector from gi.repository import Gtk @@ -327,10 +328,13 @@ class CreateNewPage(Page): self._createBox.attach(label, 0, 4, 2, 1) label.set_mnemonic_widget(combo)
store.append([_("Standard Partition"), AUTOPART_TYPE_PLAIN])
store.append([_("BTRFS"), AUTOPART_TYPE_BTRFS])
default = store.append([_("LVM"), AUTOPART_TYPE_LVM])
store.append([_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP])
for item in ([_("Standard Partition"), AUTOPART_TYPE_PLAIN],
[_("BTRFS"), AUTOPART_TYPE_BTRFS],
[_("LVM"), AUTOPART_TYPE_LVM],
[_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP]):
May as well use a tuple of tuples here instead of lists since they aren't ever changed, are they?
itr = store.append(item)
if item[1] == DEFAULT_AUTOPART_TYPE:
default = itr combo.set_margin_left(18) combo.set_margin_right(18)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index baf1674..032676a 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -39,7 +39,7 @@ from blivet.devicelibs.dasd import format_dasd, make_unformatted_dasd_list from pyanaconda.flags import flags from pyanaconda.kickstart import doKickstartStorage from pyanaconda.threads import threadMgr, AnacondaThread -from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT +from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT, DEFAULT_AUTOPART_TYPE from pyanaconda.constants_text import INPUT_PROCESSED from pyanaconda.i18n import _, P_, N_ from pyanaconda.bootloader import BootLoaderError @@ -501,15 +501,17 @@ class PartitionSchemeSpoke(NormalTUISpoke): title = N_("Partition Scheme Options") category = SystemCategory
- # set default FS to LVM, for consistency with graphical behavior
- _selection = 1
- def __init__(self, app, data, storage, payload, instclass): NormalTUISpoke.__init__(self, app, data, storage, payload, instclass)
self.partschemes = OrderedDict([("Standard Partition", AUTOPART_TYPE_PLAIN),
("LVM", AUTOPART_TYPE_LVM),
("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP),
("BTRFS", AUTOPART_TYPE_BTRFS)])
self.partschemes = OrderedDict()
pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE
for i, item in enumerate([("Standard Partition", AUTOPART_TYPE_PLAIN),
("LVM", AUTOPART_TYPE_LVM),
("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP),
("BTRFS", AUTOPART_TYPE_BTRFS)]):
Does the order really matter? We shouldn't have to maintain this list in multiple places if it doesn't, or if we can change the other order to match.
On Wed, 2014-05-28 at 11:59 -0700, Brian C. Lane wrote:
On Wed, May 28, 2014 at 10:31:08AM +0200, Vratislav Podzimek wrote:
Also preserve the chosen autopart type between runs of the PartitionScheme TUI spoke.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
pyanaconda/constants.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++---- pyanaconda/ui/tui/spokes/storage.py | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py index eff9966..db786b5 100644 --- a/pyanaconda/constants.py +++ b/pyanaconda/constants.py @@ -164,3 +164,5 @@ TAR_SUFFIX = (".tar", ".tbz", ".tgz", ".txz", ".tar.bz2", "tar.gz", "tar.xz")
# cmdline arguments that append instead of overwrite CMDLINE_APPEND = ["modprobe.blacklist"]
+DEFAULT_AUTOPART_TYPE = AUTOPART_TYPE_LVM diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py index 6a9f8a8..5cabcf0 100644 --- a/pyanaconda/ui/gui/spokes/lib/accordion.py +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py @@ -26,6 +26,7 @@ from pyanaconda.product import productName, productVersion from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show from pykickstart.constants import AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_BTRFS from pykickstart.constants import AUTOPART_TYPE_LVM, AUTOPART_TYPE_LVM_THINP +from pyanaconda.constants import DEFAULT_AUTOPART_TYPE
from gi.repository.AnacondaWidgets import MountpointSelector from gi.repository import Gtk @@ -327,10 +328,13 @@ class CreateNewPage(Page): self._createBox.attach(label, 0, 4, 2, 1) label.set_mnemonic_widget(combo)
store.append([_("Standard Partition"), AUTOPART_TYPE_PLAIN])
store.append([_("BTRFS"), AUTOPART_TYPE_BTRFS])
default = store.append([_("LVM"), AUTOPART_TYPE_LVM])
store.append([_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP])
for item in ([_("Standard Partition"), AUTOPART_TYPE_PLAIN],
[_("BTRFS"), AUTOPART_TYPE_BTRFS],
[_("LVM"), AUTOPART_TYPE_LVM],
[_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP]):
May as well use a tuple of tuples here instead of lists since they aren't ever changed, are they?
No, they never change, but we use lists everytime we append rows to Gtk stores, so I wanted to keep it that way also here.
itr = store.append(item)
if item[1] == DEFAULT_AUTOPART_TYPE:
default = itr combo.set_margin_left(18) combo.set_margin_right(18)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index baf1674..032676a 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -39,7 +39,7 @@ from blivet.devicelibs.dasd import format_dasd, make_unformatted_dasd_list from pyanaconda.flags import flags from pyanaconda.kickstart import doKickstartStorage from pyanaconda.threads import threadMgr, AnacondaThread -from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT +from pyanaconda.constants import THREAD_STORAGE, THREAD_STORAGE_WATCHER, THREAD_DASDFMT, DEFAULT_AUTOPART_TYPE from pyanaconda.constants_text import INPUT_PROCESSED from pyanaconda.i18n import _, P_, N_ from pyanaconda.bootloader import BootLoaderError @@ -501,15 +501,17 @@ class PartitionSchemeSpoke(NormalTUISpoke): title = N_("Partition Scheme Options") category = SystemCategory
- # set default FS to LVM, for consistency with graphical behavior
- _selection = 1
- def __init__(self, app, data, storage, payload, instclass): NormalTUISpoke.__init__(self, app, data, storage, payload, instclass)
self.partschemes = OrderedDict([("Standard Partition", AUTOPART_TYPE_PLAIN),
("LVM", AUTOPART_TYPE_LVM),
("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP),
("BTRFS", AUTOPART_TYPE_BTRFS)])
self.partschemes = OrderedDict()
pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE
for i, item in enumerate([("Standard Partition", AUTOPART_TYPE_PLAIN),
("LVM", AUTOPART_TYPE_LVM),
("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP),
("BTRFS", AUTOPART_TYPE_BTRFS)]):
Does the order really matter? We shouldn't have to maintain this list in multiple places if it doesn't, or if we can change the other order to match.
We might as well put that tuple of tuples as a constants into pyanaconda/storage_utils.py and use it in both GUI and TUI. I'll send a new patch that could be squashed with the two from here before pushing.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/tui/spokes/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 032676a..45aa87c 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -506,9 +506,9 @@ class PartitionSchemeSpoke(NormalTUISpoke): self.partschemes = OrderedDict() pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE for i, item in enumerate([("Standard Partition", AUTOPART_TYPE_PLAIN), + ("BTRFS", AUTOPART_TYPE_BTRFS), ("LVM", AUTOPART_TYPE_LVM), - ("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP), - ("BTRFS", AUTOPART_TYPE_BTRFS)]): + ("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP)]): self.partschemes[item[0]] = item[1] if item[1] == pre_select: self._selection = i
They are translated in the GUI.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/tui/spokes/storage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 45aa87c..40b7c35 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -505,10 +505,10 @@ class PartitionSchemeSpoke(NormalTUISpoke): NormalTUISpoke.__init__(self, app, data, storage, payload, instclass) self.partschemes = OrderedDict() pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE - for i, item in enumerate([("Standard Partition", AUTOPART_TYPE_PLAIN), - ("BTRFS", AUTOPART_TYPE_BTRFS), - ("LVM", AUTOPART_TYPE_LVM), - ("LVM Thin Provisioning", AUTOPART_TYPE_LVM_THINP)]): + for i, item in enumerate([(_("Standard Partition"), AUTOPART_TYPE_PLAIN), + (_("BTRFS"), AUTOPART_TYPE_BTRFS), + (_("LVM"), AUTOPART_TYPE_LVM), + (_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP)]): self.partschemes[item[0]] = item[1] if item[1] == pre_select: self._selection = i
Vratislav Podzimek píše v St 28. 05. 2014 v 10:31 +0200:
These four patches fix some hidden and unrevealed issues in the storage spokes.
Vratislav Podzimek (4): Use enumerate() instead of getting indices of iterated items Define default autopart type as a constant Order the autopart types in the same way in GUI and TUI Translate autopart type descriptions in the TUI
pyanaconda/constants.py | 2 ++ pyanaconda/ui/gui/spokes/lib/accordion.py | 12 ++++++++---- pyanaconda/ui/tui/spokes/storage.py | 29 ++++++++++++++--------------- 3 files changed, 24 insertions(+), 19 deletions(-)
These all look good to me, thanks & ACK! :)
Instead of hiding a serious issue, we should let the installer crash and ask user to report it as a bug.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/tui/spokes/storage.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 40b7c35..c1699fd 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -550,10 +550,4 @@ class PartitionSchemeSpoke(NormalTUISpoke): """ Apply our selections. """
schemelist = self.partschemes.values() - try: - self.data.autopart.type = schemelist[self._selection] - except IndexError: - # we shouldn't ever see this, but just in case, don't crash. - # when autopart.type is detected as None in AutoPartSpoke.apply(), - # it'll automatically just be set to LVM - pass + self.data.autopart.type = schemelist[self._selection]
This is to be squashed with commits for ordering and translating autopart choices.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/storage_utils.py | 5 +++++ pyanaconda/ui/gui/spokes/lib/accordion.py | 10 +++------- pyanaconda/ui/tui/spokes/storage.py | 11 ++++------- 3 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/storage_utils.py b/pyanaconda/storage_utils.py index 6478282..525cbab 100644 --- a/pyanaconda/storage_utils.py +++ b/pyanaconda/storage_utils.py @@ -83,6 +83,11 @@ MOUNTPOINT_DESCRIPTIONS = {"Swap": N_("The 'swap' area on your computer is used "bootloader configuration on some PPC platforms.") }
+AUTOPART_CHOICES = ((N_("Standard Partition"), AUTOPART_TYPE_PLAIN), + (N_("BTRFS"), AUTOPART_TYPE_BTRFS), + (N_("LVM"), AUTOPART_TYPE_LVM), + (N_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP)) + AUTOPART_DEVICE_TYPES = {AUTOPART_TYPE_LVM: DEVICE_TYPE_LVM, AUTOPART_TYPE_LVM_THINP: DEVICE_TYPE_LVM_THINP, AUTOPART_TYPE_PLAIN: DEVICE_TYPE_PARTITION, diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py index 5cabcf0..844f725 100644 --- a/pyanaconda/ui/gui/spokes/lib/accordion.py +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py @@ -24,9 +24,8 @@ from pyanaconda.i18n import _ from pyanaconda.product import productName, productVersion from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show -from pykickstart.constants import AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_BTRFS -from pykickstart.constants import AUTOPART_TYPE_LVM, AUTOPART_TYPE_LVM_THINP from pyanaconda.constants import DEFAULT_AUTOPART_TYPE +from pyanaconda.storage_utils import AUTOPART_CHOICES
from gi.repository.AnacondaWidgets import MountpointSelector from gi.repository import Gtk @@ -328,11 +327,8 @@ class CreateNewPage(Page): self._createBox.attach(label, 0, 4, 2, 1) label.set_mnemonic_widget(combo)
- for item in ([_("Standard Partition"), AUTOPART_TYPE_PLAIN], - [_("BTRFS"), AUTOPART_TYPE_BTRFS], - [_("LVM"), AUTOPART_TYPE_LVM], - [_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP]): - itr = store.append(item) + for item in (AUTOPART_CHOICES): + itr = store.append([_(item[0]), item[1]]) if item[1] == DEFAULT_AUTOPART_TYPE: default = itr
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index c1699fd..3093f89 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -27,8 +27,8 @@ from pyanaconda.ui.tui.categories.system import SystemCategory from pyanaconda.ui.tui.spokes import NormalTUISpoke from pyanaconda.ui.tui.simpleline import TextWidget, CheckboxWidget from pyanaconda.ui.tui.tuiobject import YesNoDialog +from pyanaconda.storage_utils import AUTOPART_CHOICES
-from pykickstart.constants import AUTOPART_TYPE_LVM, AUTOPART_TYPE_BTRFS, AUTOPART_TYPE_PLAIN, AUTOPART_TYPE_LVM_THINP from blivet import storageInitialize, arch from blivet.size import Size from blivet.errors import StorageError, DasdFormatError @@ -44,7 +44,7 @@ from pyanaconda.constants_text import INPUT_PROCESSED from pyanaconda.i18n import _, P_, N_ from pyanaconda.bootloader import BootLoaderError
-from pykickstart.constants import CLEARPART_TYPE_ALL, CLEARPART_TYPE_LINUX, CLEARPART_TYPE_NONE +from pykickstart.constants import CLEARPART_TYPE_ALL, CLEARPART_TYPE_LINUX, CLEARPART_TYPE_NONE, AUTOPART_TYPE_LVM from pykickstart.errors import KickstartValueError
from collections import OrderedDict @@ -505,10 +505,7 @@ class PartitionSchemeSpoke(NormalTUISpoke): NormalTUISpoke.__init__(self, app, data, storage, payload, instclass) self.partschemes = OrderedDict() pre_select = self.data.autopart.type or DEFAULT_AUTOPART_TYPE - for i, item in enumerate([(_("Standard Partition"), AUTOPART_TYPE_PLAIN), - (_("BTRFS"), AUTOPART_TYPE_BTRFS), - (_("LVM"), AUTOPART_TYPE_LVM), - (_("LVM Thin Provisioning"), AUTOPART_TYPE_LVM_THINP)]): + for i, item in enumerate(AUTOPART_CHOICES): self.partschemes[item[0]] = item[1] if item[1] == pre_select: self._selection = i @@ -522,7 +519,7 @@ class PartitionSchemeSpoke(NormalTUISpoke):
schemelist = self.partschemes.keys() for i, sch in enumerate(schemelist): - box = CheckboxWidget(title="%i) %s" %(i + 1, sch), completed=(i == self._selection)) + box = CheckboxWidget(title="%i) %s" %(i + 1, _(sch)), completed=(i == self._selection)) self._window += [box, ""]
message = _("Select a partition scheme configuration.")
On Thu, May 29, 2014 at 09:59:08AM +0200, Vratislav Podzimek wrote:
This is to be squashed with commits for ordering and translating autopart choices.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
pyanaconda/storage_utils.py | 5 +++++ pyanaconda/ui/gui/spokes/lib/accordion.py | 10 +++------- pyanaconda/ui/tui/spokes/storage.py | 11 ++++------- 3 files changed, 12 insertions(+), 14 deletions(-)
Ack, thanks!
anaconda-patches@lists.fedorahosted.org