[master][PATCH] Import Xkl only when really needed
Martin Kolman
mkolman at redhat.com
Thu Nov 28 12:17:21 UTC 2013
On Thu, 2013-11-28 at 10:12 +0100, Vratislav Podzimek wrote:
> This prevents a traceback when using only the anaconda-core and anaconda-tui
> packages that doesn't require the libxklavier package. There's no point in
> having libxklavier and importing Xkl without X server running, it does nothing
> and fails to initialize.
>
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
> pyanaconda/keyboard.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
> index 21505a2..0fe7d6e 100644
> --- a/pyanaconda/keyboard.py
> +++ b/pyanaconda/keyboard.py
> @@ -49,7 +49,7 @@ from pyanaconda.safe_dbus import DBUS_SYSTEM_BUS_ADDR, DBusPropertyError
> from pyanaconda.constants import DEFAULT_VC_FONT, DEFAULT_KEYBOARD, THREAD_XKL_WRAPPER_INIT
> from pyanaconda.threads import threadMgr, AnacondaThread
>
> -from gi.repository import Xkl, Gio, GLib
> +from gi.repository import Gio, GLib
>
> import logging
> log = logging.getLogger("anaconda")
> @@ -393,7 +393,7 @@ class XklWrapper(object):
> return XklWrapper._instance
>
> def __init__(self):
> - from gi.repository import GdkX11
> + from gi.repository import GdkX11, Xkl
>
> #initialize Xkl-related stuff
> display = GdkX11.x11_get_default_xdisplay()
Looks good.
More information about the anaconda-patches
mailing list