[PATCH] Fix pylint errors
by David Shea
Ignore a warning about argument lists and fix which object is used to
call Window.destroy
---
pyanaconda/ui/gui/__init__.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index da2808a..a643660 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -220,6 +220,7 @@ class ErrorDialog(GUIObject):
mainWidgetName = "errorDialog"
uiFile = "main.glade"
+ # pylint: disable-msg=W0221
def refresh(self, msg):
buf = self.builder.get_object("errorTextBuffer")
buf.set_text(msg, -1)
@@ -404,7 +405,7 @@ class GraphicalUserInterface(UserInterface):
with enlightbox(self._currentAction.window, dlg.window):
dlg.refresh(message)
dlg.run()
- dlg.destroy()
+ dlg.window.destroy()
@gtk_action_wait
def showDetailedError(self, message, details):
--
1.8.5.3
10 years, 3 months
[[PATCH rhel7-branch] 1/5] Add a scrollbar to the error dialog (#1021506).
by Chris Lumens
The error message might potentially be very long, like in the case of file
conflicts. So just support always being able to pop up a scrollbar if needed.
---
pyanaconda/ui/gui/__init__.py | 23 ++++++++++-----
pyanaconda/ui/gui/main.glade | 66 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index a928852..c995117 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -211,6 +211,19 @@ class QuitDialog(GUIObject):
rc = self.window.run()
return rc
+class ErrorDialog(GUIObject):
+ builderObjects = ["errorDialog", "errorTextBuffer"]
+ mainWidgetName = "errorDialog"
+ uiFile = "main.glade"
+
+ def refresh(self, msg):
+ buf = self.builder.get_object("errorTextBuffer")
+ buf.set_text(msg, -1)
+
+ def run(self):
+ rc = self.window.run()
+ return rc
+
class GraphicalUserInterface(UserInterface):
"""This is the standard GTK+ interface we try to steer everything to using.
It is suitable for use both directly and via VNC.
@@ -387,14 +400,10 @@ class GraphicalUserInterface(UserInterface):
###
@gtk_action_wait
def showError(self, message):
- dlg = Gtk.MessageDialog(flags=Gtk.DialogFlags.MODAL,
- message_type=Gtk.MessageType.ERROR,
- buttons=Gtk.ButtonsType.NONE,
- message_format=message)
- dlg.set_decorated(False)
- dlg.add_button(_("_Exit Installer"), 0)
+ dlg = ErrorDialog(None)
- with enlightbox(self._currentAction.window, dlg):
+ with enlightbox(self._currentAction.window, dlg.window):
+ dlg.refresh(message)
dlg.run()
dlg.destroy()
diff --git a/pyanaconda/ui/gui/main.glade b/pyanaconda/ui/gui/main.glade
index ab79345..8971d81 100644
--- a/pyanaconda/ui/gui/main.glade
+++ b/pyanaconda/ui/gui/main.glade
@@ -1,6 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkTextBuffer" id="errorTextBuffer"/>
+ <object class="GtkDialog" id="errorDialog">
+ <property name="width_request">450</property>
+ <property name="height_request">350</property>
+ <property name="can_focus">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <property name="decorated">False</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox2">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="errorButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="exitButton">
+ <property name="label" translatable="yes">_Exit Installer</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="errorTextView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="buffer">errorTextBuffer</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
<object class="GtkDialog" id="quitDialog">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
--
1.8.3.1
10 years, 3 months
[PATCH] Don't show the language twice for keyboard layouts.
by David Shea
The last fix for this went missing, so let's try again.
Resolves: rhbz#1021849
---
pyanaconda/keyboard.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index a20e7de..8189082 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -509,14 +509,20 @@ class XklWrapper(object):
"""
layout_info = self._layout_infos[layout_variant]
+
if with_lang and layout_info.lang:
+ lang = iutil.upcase_first_letter(iso_(layout_info.lang).decode("utf-8"))
+ else:
+ lang = None
+
+ description = Xkb_(layout_info.desc).decode("utf-8")
+
+ if with_lang and lang and not description.startswith(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"))
+ return "%s (%s)" % (lang, description)
else:
- return layout_info.desc
+ return description
def get_switch_opt_description(self, switch_opt):
"""
--
1.8.5.3
10 years, 3 months
[master][PATCH] Log exceptions before running exception handling
by Vratislav Podzimek
Our exception handling code is quite complicated (especiall in text mode) and
it may happen the exception is never processed. Log the exception ASAP so that
we have the most important information somewhere in any case.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/exception.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index b6bde73..48046c6 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -33,6 +33,7 @@ import time
import re
import errno
import glob
+import traceback
import blivet.errors
from pyanaconda.errors import CmdlineError
from pyanaconda.ui.communication import hubQ
@@ -81,6 +82,8 @@ class AnacondaExceptionHandler(ExceptionHandler):
"""
log.debug("running handleException")
+ exception_lines = traceback.format_exception(*dump_info.exc_info)
+ log.debug("\n".join(exception_lines))
ty = dump_info.exc_info.type
value = dump_info.exc_info.value
--
1.8.5.3
10 years, 3 months
[PATCH] Fix exitHandler loop deactivation
by Brian C. Lane
---
anaconda | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/anaconda b/anaconda
index 99782a4..83156ef 100755
--- a/anaconda
+++ b/anaconda
@@ -55,7 +55,7 @@ def exitHandler(rebootData, storage, exitCode=None):
devicetree.teardownAll()
for name in devicetree.diskImages:
dev = devicetree.getDeviceByName(name)
- for loop in device.parents:
+ for loop in dev.parents:
loop.controllable = True
dev.deactivate(recursive=True)
--
1.8.4.2
10 years, 3 months
[PATCH] Another dracut pylint change.
by David Shea
Remove an unused variable, and instead of wrapping str(x) in a lambda
just pass str as the callable.
---
dracut/driver-updates | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dracut/driver-updates b/dracut/driver-updates
index 71d6e25..39bdebe 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -605,7 +605,6 @@ def select_iso():
:rtype: (str, str)
"""
- dev_prefix = "/dev/"
blkid_out_regex = re.compile(r'^/dev/([^:]+):\s+LABEL="([^"]+)"\s+UUID="([^"]+)"\s+TYPE="([^"]+)"')
_ret, out = run_cmd(["blkid"])
devices = []
@@ -616,8 +615,7 @@ def select_iso():
header = " %-10s %-6s %-15s %s" % ("DEVICE", "TYPE", "LABEL", "UUID")
iso_dev = selection_menu(devices, "Driver disk device selection\n" + header,
- lambda dev_info: str(dev_info),
- multi_choice=False)
+ str, multi_choice=False)
if not iso_dev:
return (None, None)
--
1.8.5.3
10 years, 3 months
[PATCH] Put Xorg on tty6 in accordance with Ancient Anaconda Tradition (#980062)
by Will Woods
Previously Xorg and logind were fighting over tty6. logind got there
first, so it won the race and Xorg ended up on tty7. commit 0a302ce moved Xorg to vt7 so we could avoid the race.
More recently, lorax commit dff1542 reconfigures logind to reserve tty2
instead of tty6. So now tty6 is free again.
So until we're ready to move Xorg to tty1 and start it up like a normal
system does, we might as well leave it where it was before.
This reverts commit 0a302ce1d00929e0f835925454caa63f24c10288.
Conflicts:
anaconda
---
anaconda | 2 +-
pyanaconda/ui/gui/__init__.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/anaconda b/anaconda
index 2d681e9..99782a4 100755
--- a/anaconda
+++ b/anaconda
@@ -596,7 +596,7 @@ def setupDisplay(anaconda, options, addons=None):
try:
subprocess.Popen(["Xorg", "-br",
"-logfile", "/tmp/X.log",
- ":1", "vt7", "-s", "1440", "-ac",
+ ":1", "vt6", "-s", "1440", "-ac",
"-nolisten", "tcp", "-dpi", "96",
"-noreset"],
close_fds=True,
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index c022ee4..80d4afc 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -258,7 +258,7 @@ class GraphicalUserInterface(UserInterface):
@property
def tty_num(self):
- return 7
+ return 6
@property
def meh_interface(self):
--
1.8.5.3
10 years, 3 months
[anaconda] pylint some more stuff
by David Shea
When I did that last dracut script patch, pylint run from the commit hook
complained about a lot of stuff I didn't change, which was odd, because
shouldn't we be checking that script already? Well, here we are.
10 years, 3 months
[blivet:rhel7/master 0/2] sanity check LUKS devices (v2)
by Anne Mulhern
Updated to be more Pythonic, but otherwise no change from previous version
mulhern (2):
Verify that LUKS devices have some encryption key (#1023442)
Some simple tests for _verifyLUKSDevicesHaveKey (#1023442)
blivet/__init__.py | 18 +++++++++++++++
tests/sanity_check_test.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+)
create mode 100644 tests/sanity_check_test.py
--
1.8.3.1
10 years, 3 months
[rhel7-branch/master][PATCH] Prefer IPv4 addresses when showing VNC/SSH IP
by Martin Kolman
Previously, we just iterated over all interfaces and added all found IPs to a list,
then iterated over that list and returned the first non-local IP address.
Like this, sometimes we would show the user a IPv6 address even if there are
other non-local IPv4 addresses available.
So I've changed it to first go over all IPv4 addresses and return an IPv6 address
only if no IPv4 one is found.
Why prioritize IPv4 addresses ?
* the referenced bug is asking for it :)
* they are not such pain to type as IPv6 addresses
* less likely to cause line breaks due to length
* there is the hostname anyway
And why not show both ? Both screen are pretty cluttered already if
the computer has a long hostname, so adding another address string
would not really help. And we can still do this is someone comes with
a convincing use case.
Martin Kolman (1):
Give priority to IPv4 addresses when showing VNC & SSH IP (#1056420)
pyanaconda/network.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--
1.8.5.3
10 years, 3 months