[PATCH] Mark language search string translatable. (#955229)
by Samantha N. Bueno
---
pyanaconda/ui/gui/spokes/welcome.glade | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade
index f0a4602..4f79b7c 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -367,7 +367,7 @@
<property name="invisible_char">●</property>
<property name="invisible_char_set">True</property>
<property name="secondary_icon_name">edit-clear-symbolic</property>
- <property name="placeholder_text">Type here to search.</property>
+ <property name="placeholder_text" translatable="yes">Type here to search.</property>
<signal name="changed" handler="on_entry_changed" swapped="no"/>
<signal name="icon-release" handler="on_clear_icon_clicked" swapped="no"/>
</object>
--
1.7.11.7
10 years, 2 months
[anaconda][PATCH] Allow hubs and standalone spokes decide if it is possible to continue
by Vratislav Podzimek
Related: rhbz#965797
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/hubs/__init__.py | 29 +++++++++++++++++++++++++++--
pyanaconda/ui/gui/spokes/__init__.py | 18 ++++++++++++++++--
2 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 37daf47..bb473b6 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -354,11 +354,36 @@ class Hub(GUIObject, common.Hub):
self._update_spoke_id = GLib.timeout_add_seconds(1, self._update_spokes)
- ### SIGNAL HANDLERS
+ @property
+ def continue_possible(self):
+ """
+ Indicates whether it is possible to continue to the next action (hub,
+ standalone spoke,...). When overridden, IT IS THE HUB'S RESPONSIBILITY
+ to inform user, where the problem is and how to fix it.
+
+ """
+
+ return True
+
+ ### SIGNAL HANDLING
+ def _checked_continue(self, cb):
+ """
+ Checks if continue is possible (from the hub's perspective and if yes,
+ runs the callback.
+
+ """
+
+ if self.continue_possible:
+ cb()
+
+ def _register_continue_event_cb(self, cb):
+ """Registers the callback for the continue event adding the check."""
+
+ self.continueButton.connect("clicked", lambda *args: self._checked_continue(cb))
def register_event_cb(self, event, cb):
if event == "continue" and hasattr(self, "continueButton"):
- self.continueButton.connect("clicked", lambda *args: cb())
+ self._register_continue_event_cb(cb)
elif event == "quit" and hasattr(self, "quitButton"):
self.quitButton.connect("clicked", lambda *args: cb())
diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py
index c1a35b3..bb85e1e 100644
--- a/pyanaconda/ui/gui/spokes/__init__.py
+++ b/pyanaconda/ui/gui/spokes/__init__.py
@@ -63,9 +63,23 @@ class StandaloneSpoke(Spoke, common.StandaloneSpoke):
Spoke.__init__(self, data)
common.StandaloneSpoke.__init__(self, data, storage, payload, instclass)
+ @property
+ def continue_possible(self):
+ """
+ Indicates whether it is possible to continue to the next action (hub,
+ standalone spoke,...). When overridden, IT IS THE SPOKES'S
+ RESPONSIBILITY to inform user, where the problem is and how to fix it.
+
+ """
+
+ return True
+
+
+ ### SIGNAL HANDLING
def _on_continue_clicked(self, cb):
- self.apply()
- cb()
+ if self.continue_possible:
+ self.apply()
+ cb()
def register_event_cb(self, event, cb):
if event == "continue":
--
1.7.11.7
10 years, 3 months
[master/rhel7-branch] A bit controversial one for the MountpointSelectors' usage
by Vratislav Podzimek
The following patch fixes the bug #975838 by moving the focus changes handling
from the MountpointSelector widget to the Page and spoke it appears in,
respectively. The controversy lies in making the MountpointSelector's behaviour
relying on the widget it is placed into. The MounpointSelector widget per se no
longer handles focus changes correctly and it looks like being selected/chosen
even if it loses focus. However, this is what we want -- to keep it look like
that when user clicks to the right part of the screen to change parameters of
the mount point being chosen. And since I doubt anybody will reuse the
MountpointSelector as a standalone widget without the Page and the Accordion I
think this change could be done.
I've recorded a video preview [1] showing the functionality with this patch
applied.
[1] http://vpodzime.fedorapeople.org/MountpointSelector_focus.webm
Let me know if I should add more comments to some places.
Vratislav Podzimek (1):
Handle focus changes of MountpointSelectors from outside (#975838)
pyanaconda/ui/gui/spokes/custom.py | 2 ++
pyanaconda/ui/gui/spokes/lib/accordion.py | 6 ++++++
widgets/src/MountpointSelector.c | 31 ++++++++-----------------------
3 files changed, 16 insertions(+), 23 deletions(-)
--
1.7.11.7
10 years, 5 months
[PATCH 1/2] DNFPayload: direct conf.persistdir to the sysimage.
by Ales Kozumplik
From: Ales Kozumplik <ales(a)redhat.com>
So we get the history on the target.
---
pyanaconda/packaging/dnfpayload.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index b019723..7ee3344 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -135,7 +135,6 @@ class DNFPayload(packaging.PackagePayload):
def _configure(self):
self._base = dnf.Base()
conf = self._base.conf
- conf.persistdir = DNF_CACHE_DIR
self._base.cache_c.prefix = DNF_CACHE_DIR
self._base.cache_c.suffix = 'default'
conf.logdir = '/tmp/payload-logs'
@@ -144,8 +143,9 @@ class DNFPayload(packaging.PackagePayload):
conf.errorlevel = 0
self._base.logging.setup_from_dnf_conf(conf)
- conf.installroot = constants.ROOT_PATH
conf.releasever = self._getReleaseVersion(None)
+ conf.installroot = constants.ROOT_PATH
+ conf.prepend_installroot('persistdir')
# NSS won't survive the forking we do to shield out chroot during
# transaction, disable it in RPM:
--
1.8.3.1
10 years, 6 months
[blivet][rhel7-branch][PATCH] Add tmpfs support (#918621)
by Martin Kolman
This patch adds support for working with tmpfs "mounts" (well they are not
really devices and don't really have a separate filesystem).
Adding lines to fstab works fine (being the main point of the feature request)
and other operations, such as mounting the filesystem, also work.
I've been even able to start an installation to a tmpfs mount, with:
part / --size=3000 --fstype=tmpfs
And it got to about 3/4 before crashing the VM. :)
BTW, regarding the feature request:
* in Fedora, the tmps mount to /tmp is done by a systemd unit
* this unit is also present in RHEL7, but it is disabled
* there doesn't seem to be any straightforward way to set a size of such mount
Therefore I've decided to handle this by extending blivet and the part kickstart
command to support tmpfs, because it appears to be much more flexible:
* you can easily set the size of the tmpfs mount with --size
* you can use --grow and --maxsize
* tmpfs options can be passed with --fsoptions
* an arbitrary number of tmpfs partitions can be created, not just /tmp
Martin Kolman (1):
Add tmpfs support (#918621)
blivet/__init__.py | 4 ++
blivet/deviceaction.py | 7 ++-
blivet/devices.py | 24 ++++++++++
blivet/formats/fs.py | 125 ++++++++++++++++++++++++++++++++++++++++++++++++-
4 files changed, 157 insertions(+), 3 deletions(-)
--
1.8.3.1
10 years, 6 months
[PATCH] Translate the "Quit" string at the end of liveinst.
by David Shea
---
pyanaconda/ui/gui/hubs/progress.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index e052ff6..79daeee 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -200,7 +200,7 @@ class ProgressHub(Hub):
continueText.set_text(_("%s is now successfully installed on your system and ready "
"for you to use! When you are ready, reboot your system to start using it!"))
continueText.set_line_wrap(True)
- self.continueButton.set_label("_Quit")
+ self.continueButton.set_label(_("_Quit"))
self._progressBar = self.builder.get_object("progressBar")
self._progressLabel = self.builder.get_object("progressLabel")
--
1.8.3.1
10 years, 6 months
[PATCH] Add additional checks for HFS+ ESP (#1010495)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
This checks to make sure any partition we use meets the normal
requirements for stage1 and is < 501.0MB and is not labeled "OSX"
---
pyanaconda/bootloader.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 55a93a2..07b8703 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1703,6 +1703,14 @@ class MacEFIGRUB(EFIGRUB):
super(MacEFIGRUB, self).install()
self.mactel_config()
+ def is_valid_stage1_device(self, device, early=False):
+ valid = super(MacEFIGRUB, self).is_valid_stage1_device(device, early)
+
+ # Make sure we don't pick the OSX root partition
+ if valid and device.size < 501.0 and device.format.label != "OSX":
+ return True
+
+ return False
class YabootBase(BootLoader):
def write_config_password(self, config):
--
1.8.3.1
10 years, 6 months
[master/rhel7-branch] Fix issue where spoke returns to hub early in text mode. (#979375)
by Samantha N. Bueno
Not sure how this wasn't hit earlier than it was. If in the storage
spoke in text mode, if you select any of the autopart options, you
would immediately be returned to the summary hub, without getting
to select a partition scheme.
Resolves: rhbz#979375
---
pyanaconda/ui/tui/spokes/storage.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index d73c2bc..79756b2 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -362,8 +362,7 @@ class AutoPartSpoke(NormalTUISpoke):
number = int(key)
self.clearPartType = PARTTYPES[self.parttypelist[number -1]]
self.apply()
- self.close()
- return False
+ return None
except (ValueError, KeyError, IndexError):
return key
--
1.7.11.7
10 years, 7 months
[master][PATCH] Grab journalctl logs if there is no /tmp/syslog
by Vratislav Podzimek
If we have our rsyslogd instance running and hooked to /tmp/syslog, we can
simply grab logs from there. Otherwise we need to grab journalctl's output and
filter it to omit our own log messages from there because there is no
/var/log/messages anymore.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/exception.py | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 7c80ca7..2296af4 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -32,6 +32,7 @@ import shutil
import signal
import time
import kickstart
+import re
import blivet.errors
from pyanaconda.ui.communication import hubQ
from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
@@ -195,9 +196,8 @@ def initExceptionHandling(anaconda):
"/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",
"/tmp/yum.log", ROOT_PATH + "/root/install.log",
"/proc/cmdline" ]
- if flags.flags.livecdInstall:
- fileList.extend(["/var/log/messages"])
- else:
+
+ if os.path.exists("/tmp/syslog"):
fileList.extend(["/tmp/syslog"])
if anaconda.opts and anaconda.opts.ksfile:
@@ -230,6 +230,11 @@ def initExceptionHandling(anaconda):
attchmnt_only=True)
conf.register_callback("type", lambda: "anaconda", attchmnt_only=True)
+ if "/tmp/syslog" not in fileList:
+ # no syslog, grab output from journalctl and put it also to the
+ # anaconda-tb file
+ conf.register_callback("journalctl", journalctl_callback, attchmnt_only=False)
+
handler = AnacondaExceptionHandler(conf, anaconda.intf.meh_interface,
ReverseExceptionDump, anaconda.intf.tty_num)
handler.install(anaconda)
@@ -246,6 +251,20 @@ def nmcli_dev_list_callback():
return iutil.execWithCapture("nmcli", ["device", "show"])
+def journalctl_callback():
+ """Callback to get logs from journalctl."""
+
+ # regex to filter log messages from anaconda's process (we have that in our
+ # logs)
+ anaconda_log_line = re.compile(r"\[%d\]:" % os.getpid())
+ ret = ""
+ for line in iutil.execReadlines("journalctl", []):
+ if anaconda_log_line.search(line) is None:
+ # not an anaconda's message
+ ret += line + "\n"
+
+ return ret
+
def test_exception_handling():
"""
Function that can be used for testing exception handling in anaconda. It
--
1.7.11.7
10 years, 7 months
[master/rhel7-branch][PATCH] Pass layout and variant in specific format to Gkbd (#1011155)
by Vratislav Podzimek
For some reason, the Gkbd requires to get layout and variant in a specific
format nothing else uses. We need to make parse_layout_variant function public
to use it from the Keyboard spoke.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/keyboard.py | 12 ++++++------
pyanaconda/ui/gui/spokes/keyboard.py | 4 +++-
tests/pyanaconda_tests/keyboard_test.py | 16 ++++++++--------
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 3cc540f..1911198 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -83,7 +83,7 @@ class InvalidLayoutVariantSpec(Exception):
pass
-def _parse_layout_variant(layout_variant_str):
+def parse_layout_variant(layout_variant_str):
"""
Parse layout and variant from the string that may look like 'layout' or
'layout (variant)'.
@@ -136,7 +136,7 @@ def normalize_layout_variant(layout_str):
"""
- layout, variant = _parse_layout_variant(layout_str)
+ layout, variant = parse_layout_variant(layout_str)
return _join_layout_variant(layout, variant)
def populate_missing_items(keyboard):
@@ -612,7 +612,7 @@ class XklWrapper(object):
try:
#we can get 'layout' or 'layout (variant)'
- (layout, variant) = _parse_layout_variant(layout)
+ (layout, variant) = parse_layout_variant(layout)
except InvalidLayoutVariantSpec as ilverr:
raise XklWrapperError("Failed to add layout: %s" % ilverr)
@@ -640,7 +640,7 @@ class XklWrapper(object):
"""
#we can get 'layout' or 'layout (variant)'
- (layout, variant) = _parse_layout_variant(layout)
+ (layout, variant) = parse_layout_variant(layout)
layouts_variants = zip(self._rec.layouts, self._rec.variants)
@@ -674,7 +674,7 @@ class XklWrapper(object):
new_variants = list()
for layout_variant in layouts_list:
- (layout, variant) = _parse_layout_variant(layout_variant)
+ (layout, variant) = parse_layout_variant(layout_variant)
new_layouts.append(layout)
new_variants.append(variant)
@@ -855,7 +855,7 @@ class LocaledWrapper(object):
variants = []
for layout_variant in layouts_variants:
- (layout, variant) = _parse_layout_variant(layout_variant)
+ (layout, variant) = parse_layout_variant(layout_variant)
layouts.append(layout)
variants.append(variant)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 849981e..f7c8c99 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -504,9 +504,11 @@ class KeyboardSpoke(NormalSpoke):
if not layout_row:
return
+ layout, variant = keyboard.parse_layout_variant(layout_row[0])
+ lay_var_spec = "%s\t%s" % (layout, variant)
dialog = Gkbd.KeyboardDrawing.dialog_new()
Gkbd.KeyboardDrawing.dialog_set_layout(dialog, self._xkl_wrapper.configreg,
- layout_row[0])
+ lay_var_spec)
dialog.set_size_request(750, 350)
dialog.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
with enlightbox(self.window, dialog):
diff --git a/tests/pyanaconda_tests/keyboard_test.py b/tests/pyanaconda_tests/keyboard_test.py
index 1b8974d..8bad3f6 100644
--- a/tests/pyanaconda_tests/keyboard_test.py
+++ b/tests/pyanaconda_tests/keyboard_test.py
@@ -26,34 +26,34 @@ class ParsingAndJoiningTests(unittest.TestCase):
"""Should correctly parse keyboard layout and variant string specs."""
# valid layout variant specs
- layout, variant = keyboard._parse_layout_variant("cz (qwerty)")
+ layout, variant = keyboard.parse_layout_variant("cz (qwerty)")
self.assertEqual(layout, "cz")
self.assertEqual(variant, "qwerty")
- layout, variant = keyboard._parse_layout_variant("cz (dvorak-ucw)")
+ layout, variant = keyboard.parse_layout_variant("cz (dvorak-ucw)")
self.assertEqual(layout, "cz")
self.assertEqual(variant, "dvorak-ucw")
# a valid layout variant spec with no variant specified
- layout, variant = keyboard._parse_layout_variant("cz")
+ layout, variant = keyboard.parse_layout_variant("cz")
self.assertEqual(layout, "cz")
self.assertEqual(variant, "")
# an invalid layout variant spec (missing layout)
with self.assertRaises(keyboard.InvalidLayoutVariantSpec):
- layout, variant = keyboard._parse_layout_variant("")
+ layout, variant = keyboard.parse_layout_variant("")
# another invalid layout variant spec (invalid layout)
with self.assertRaises(keyboard.InvalidLayoutVariantSpec):
- layout, variant = keyboard._parse_layout_variant("&*&%$")
+ layout, variant = keyboard.parse_layout_variant("&*&%$")
# another invalid layout variant spec (square brackets)
with self.assertRaises(keyboard.InvalidLayoutVariantSpec):
- layout, variant = keyboard._parse_layout_variant("cz [qwerty]")
+ layout, variant = keyboard.parse_layout_variant("cz [qwerty]")
# another invalid layout variant spec (invalid variant)
with self.assertRaises(keyboard.InvalidLayoutVariantSpec):
- layout, variant = keyboard._parse_layout_variant("cz (&*&*)")
+ layout, variant = keyboard.parse_layout_variant("cz (&*&*)")
def layout_variant_joining_test(self):
"""Should correctly join keyboard layout and variant to a string spec."""
@@ -70,7 +70,7 @@ class ParsingAndJoiningTests(unittest.TestCase):
specs = ("cz", "cz (qwerty)")
for spec in specs:
- (layout, variant) = keyboard._parse_layout_variant(spec)
+ (layout, variant) = keyboard.parse_layout_variant(spec)
self.assertEqual(spec, keyboard._join_layout_variant(layout, variant))
def layout_variant_normalize_test(self):
--
1.7.11.7
10 years, 7 months