[ambctl] use gi.repository
authorKevron Rees <kevron.m.rees@intel.com>
Tue, 7 Apr 2015 15:26:00 +0000 (08:26 -0700)
committerKevron Rees <tripzero.kev@gmail.com>
Wed, 6 May 2015 20:37:16 +0000 (13:37 -0700)
tools/ambctl.py

index 9477723..cb091a7 100644 (file)
@@ -4,12 +4,11 @@ import argparse
 import dbus
 import sys
 import json
-import gobject
 import fileinput
 import termios, fcntl, os
-import glib
 import curses.ascii
 import traceback
+from gi.repository import GObject, GLib
 
 from dbus.mainloop.glib import DBusGMainLoop
 
@@ -546,14 +545,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(None, False)
+                       main_loop = GObject.MainLoop()
                        main_loop.run()
                except KeyboardInterrupt:
                        sys.exit()