From 261e0d119463c648baaf6c3d4be989ca710f9c05 Mon Sep 17 00:00:00 2001 From: Petr Nechaev Date: Wed, 29 Jul 2015 18:00:08 +0300 Subject: [PATCH 5/9] ambctl: remove unnecessary dependency on glib introspection Python binding "gobject" from pygobject is enough for the task. --- tools/ambctl.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/ambctl.py b/tools/ambctl.py index cb091a7..b0b9fd4 100644 --- a/tools/ambctl.py +++ b/tools/ambctl.py @@ -8,7 +8,8 @@ import fileinput import termios, fcntl, os import curses.ascii import traceback -from gi.repository import GObject, GLib +import gobject +import glib from dbus.mainloop.glib import DBusGMainLoop @@ -545,14 +546,14 @@ if args.command == "stdin": oldflags = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK) - io_stdin = GLib.IOChannel(fd) - io_stdin.add_watch(GLib.IO_IN, handle_keyboard, data) + io_stdin = glib.IOChannel(fd) + io_stdin.add_watch(glib.IO_IN, handle_keyboard, data) try: erase_line() display_prompt() sys.stdout.flush() - main_loop = GObject.MainLoop() + main_loop = gobject.MainLoop() main_loop.run() except KeyboardInterrupt: sys.exit() -- 1.9.1