[PATCH] Display newly created partitions without a mountpoint, too (#886039).
by Chris Lumens
Swap, for instance, does not have a mountpoint. So the first partition was
always getting displayed on the right hand side when swap was made. This
probably applies to other non-mountpoint formats too.
---
pyanaconda/ui/gui/spokes/custom.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 2d784d1..4361c8a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2051,7 +2051,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._devices = self.__storage.devices
if not self._error:
- self._do_refresh(mountpointToShow=mountpoint)
+ self._do_refresh(mountpointToShow=mountpoint or fstype)
else:
self._do_refresh()
self._updateSpaceDisplay()
@@ -2127,7 +2127,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if not page:
page = self._current_page
- log.debug("show first mountpoint: %s", page.pageTitle)
+ log.debug("show mountpoint: %s", page.pageTitle)
if not page.members:
self._clear_current_selector()
return
@@ -2137,7 +2137,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
return
for member in page.members:
- if member.get_property("mountpoint") == mountpoint:
+ if member.get_property("mountpoint").lower() == mountpoint.lower():
self.on_selector_clicked(member)
break
--
1.8.1.2
10 years, 9 months
[PATCH v2] git pre-commit hook
by David Shea
This removes all of the `git show' stuff so that the hook runs against the
working tree instead of the staged commit, but adds an error if a python file
in the commit does not match a file in the working tree.
I removed the --displayname parameter to runpylint.sh, but I kept the part
where it prints the filename instead of the module name.
10 years, 9 months
[master] Run pylint on everything
by David Shea
Just because it's not in pyanaconda doesn't mean we shouldn't hold it to the
same standards.
This also changes the pre-commit hook to run against the code staged to commit
instead of the code on the filesystem, which may be helpful.
10 years, 9 months
[PATCH] Don't require pressing escape twice to kill the media check window (#965625).
by Chris Lumens
Also, allow the user to cancel media check while it's working.
---
pyanaconda/ui/gui/spokes/source.glade | 1 +
pyanaconda/ui/gui/spokes/source.py | 14 +++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index 91d716d..554d673 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -91,6 +91,7 @@
<property name="type_hint">dialog</property>
<property name="decorated">False</property>
<property name="has_resize_grip">False</property>
+ <signal name="close" handler="on_close" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 7bcae6e..869bba2 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -25,7 +25,7 @@ import time
import logging
log = logging.getLogger("anaconda")
-import os.path
+import os, signal
from gi.repository import GLib
@@ -155,6 +155,7 @@ class MediaCheckDialog(GUIObject):
def __init__(self, data):
GUIObject.__init__(self, data)
self.progressBar = self.builder.get_object("mediaCheck-progressBar")
+ self._pid = None
def _checkisoEndsCB(self, pid, status):
doneButton = self.builder.get_object("doneButton")
@@ -168,6 +169,7 @@ class MediaCheckDialog(GUIObject):
self.progressBar.set_fraction(1.0)
doneButton.set_sensitive(True)
GLib.spawn_close_pid(pid)
+ self._pid = None
def _checkisoStdoutWatcher(self, fd, condition):
if condition == GLib.IOCondition.HUP:
@@ -187,7 +189,7 @@ class MediaCheckDialog(GUIObject):
return True
def run(self, devicePath):
- (retval, pid, _stdin, stdout, _stderr) = \
+ (retval, self._pid, _stdin, stdout, _stderr) = \
GLib.spawn_async_with_pipes(None, ["checkisomd5", "--gauge", devicePath], [],
GLib.SpawnFlags.DO_NOT_REAP_CHILD|GLib.SpawnFlags.SEARCH_PATH,
None, None)
@@ -195,13 +197,19 @@ class MediaCheckDialog(GUIObject):
return
# This function waits for checkisomd5 to end and then cleans up after it.
- GLib.child_watch_add(pid, self._checkisoEndsCB)
+ GLib.child_watch_add(self._pid, self._checkisoEndsCB)
# This function watches the process's stdout.
GLib.io_add_watch(stdout, GLib.IOCondition.IN|GLib.IOCondition.HUP, self._checkisoStdoutWatcher)
self.window.run()
+ def on_close(self, *args):
+ if self._pid:
+ os.kill(self._pid, signal.SIGKILL)
+
+ self.window.destroy()
+
def on_done_clicked(self, *args):
self.window.destroy()
--
1.8.1.2
10 years, 9 months
[rhel7] Fixup Eula class
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Related: rhbz#1000409
---
pyanaconda/kickstart.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 10a2bde..a736972 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -635,7 +635,7 @@ class Lang(commands.lang.F19_Lang):
localization.write_language_configuration(self, ROOT_PATH)
# no overrides needed here
-class Eula = commands.eula.F20_Eula
+Eula = commands.eula.F20_Eula
class LogVol(commands.logvol.F20_LogVol):
def execute(self, storage, ksdata, instClass):
--
1.8.3.1
10 years, 9 months
[rhel7-branch] fix bootloader installation to disk images
by David Lehman
Fixing the bug referenced in the follow-up message's subject uncovered
another issue that will keep freshly-installed disk images from booting
successfully, but it's a step in the right direction.
If anyone knows how to tell dracut to not resolve devices in order to
write out devexists-whatever systemd unit files, I'd love to hear
about it. Ideally, what I'd like is a way to push resolution of fstab
device specs to boot time (as opposed to initramfs creation time).
10 years, 9 months
[rhel7-branch] Rebase our language/locale handling code
by Vratislav Podzimek
There has been major changes of the language/locale handling code done in the
F20 cycle which significantly improve user experience of the installer and also
make our code cleaner, more deterministic and better documented.
On behalf of the bug #1006458 [1] all these 14 patches should be ported from
master to rhel7-branch. They contain a lot of changes, but they are just ports
of the master patches, so they should be okay.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1006458
Vratislav Podzimek (14):
Rewrite the localization module
Adapt to the new localization module
Fix the langcode parsing regexp
Specify also query script when getting locale's native name
Remove an unused argument of get_available_translations
Allow seting up locale without modifying ksdata
Rework the Welcome spoke to allow users choose from all locales
Get rid of the non-deterministic expand_langs and its usage
Match langs with stripped accents when filtering languages
Rework the Langsupport spoke to work with all locales
Share code between the Welcome and Langsupport spokes
More robust parsing of the layout and variant string specification
Normalize keyboard layout and variant strings from langtable
Center the Langsupport spoke's description
anaconda | 38 +-
anaconda.spec.in | 3 +-
pyanaconda/keyboard.py | 59 +-
pyanaconda/localization.py | 716 ++++++++++-----------
pyanaconda/packaging/yumpayload.py | 9 +-
pyanaconda/timezone.py | 36 +-
pyanaconda/ui/gui/hubs/progress.py | 53 +-
pyanaconda/ui/gui/spokes/langsupport.glade | 172 +++--
pyanaconda/ui/gui/spokes/langsupport.py | 204 +++---
.../ui/gui/spokes/lib/lang_locale_handler.py | 161 +++++
pyanaconda/ui/gui/spokes/welcome.glade | 336 +++++-----
pyanaconda/ui/gui/spokes/welcome.py | 260 +++-----
pyanaconda/ui/gui/utils.py | 40 ++
13 files changed, 1108 insertions(+), 979 deletions(-)
create mode 100644 pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
--
1.7.11.7
10 years, 9 months
[master][PATCH] Allow searching for keyboard layouts in English (#1009806)
by Vratislav Podzimek
Even though we have the keyboard layouts's descriptions translated it may be
easier to filter them using English especially when using ASCII-based layout and
a non-ascii language (e.g. Japanesse).
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/keyboard.py | 20 +++++++++++++++-----
pyanaconda/ui/gui/spokes/keyboard.py | 36 +++++++++++++++++++++---------------
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index e86771a..5124db4 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -530,7 +530,7 @@ class XklWrapper(object):
return self._switch_opt_infos.iterkeys()
- def get_layout_variant_description(self, layout_variant, with_lang=True):
+ def get_layout_variant_description(self, layout_variant, with_lang=True, xlated=True):
"""
Get description of the given layout-variant.
@@ -539,20 +539,30 @@ class XklWrapper(object):
:param with_lang: whether to include language of the layout-variant (if defined)
in the description or not
:type with_lang: bool
+ :param xlated: whethe to return translated or english version of the description
+ :type xlated: bool
:return: description of the layout-variant specification (e.g. 'Czech (qwerty)')
:rtype: str
"""
layout_info = self._layout_infos[layout_variant]
+ if xlated:
+ description = Xkb_(layout_info.desc).decode("utf-8")
+ else:
+ description = layout_info.desc
+
if with_lang and layout_info.lang:
# translate language and upcase its first letter, translate the
# layout-variant description
- xlated_lang = iso_(layout_info.lang)
- return "%s (%s)" % (iutil.upcase_first_letter(xlated_lang.decode("utf-8")),
- Xkb_(layout_info.desc).decode("utf-8"))
+ if xlated:
+ lang = iso_(layout_info.lang).decode("utf-8")
+ else:
+ lang = layout_info.lang
+
+ return "%s (%s)" % (iutil.upcase_first_letter(lang), description)
else:
- return layout_info.desc
+ return description
def get_switch_opt_description(self, switch_opt):
"""
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 7c575d8..2d2c904 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -61,23 +61,29 @@ class AddLayoutDialog(GUIObject):
self._chosen_layouts = []
def matches_entry(self, model, itr, user_data=None):
+ def have_word_match(str1, str2):
+ """Tells if all words from str1 exist in str2 or not."""
+
+ if str1 is None or str2 is None:
+ return False
+
+ str1 = str1.lower()
+ str1_words = str1.split()
+
+ try:
+ str2 = str2.lower()
+ for word in str1_words:
+ str2.index(word)
+ return True
+ except ValueError:
+ return False
+
value = model[itr][0]
- value = self._xkl_wrapper.get_layout_variant_description(value)
+ eng_value = self._xkl_wrapper.get_layout_variant_description(value, xlated=False)
+ xlated_value = self._xkl_wrapper.get_layout_variant_description(value)
entry_text = self._entry.get_text()
- if entry_text is not None:
- entry_text = entry_text.lower()
- entry_text_words = entry_text.split()
- else:
- return False
- try:
- if value:
- value = value.lower()
- for word in entry_text_words:
- value.index(word)
- return True
- return False
- except ValueError:
- return False
+
+ return have_word_match(entry_text, eng_value) or have_word_match(entry_text, xlated_value)
def compare_layouts(self, model, itr1, itr2, user_data=None):
"""
--
1.7.11.7
10 years, 9 months
[PATCH] Allow a proxy to be set before the method is saved
by David Shea
---
pyanaconda/ui/gui/spokes/source.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 7bcae6e..8b150c5 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -784,11 +784,11 @@ class SourceSpoke(NormalSpoke):
self._verifyIsoButton.set_sensitive(True)
def on_proxy_clicked(self, button):
- # If this method has no proxy, ignore the click
if not hasattr(self.data.method, "proxy"):
- return
+ old_proxy = None
+ else:
+ old_proxy = self.data.method.proxy
- old_proxy = self.data.method.proxy
dialog = ProxyDialog(self.data)
with enlightbox(self.window, dialog.window):
dialog.refresh()
--
1.8.3.1
10 years, 9 months
[master/rhel7-branch] Not so nice patch for a painful issue
by Vratislav Podzimek
Any suggestions how to fix this in a better way are more than welcome.
Vratislav Podzimek (1):
Make Software spoke ready even if there is no repo (#1010348)
pyanaconda/ui/tui/spokes/software.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
--
1.7.11.7
10 years, 9 months