use GObject of gi.repository

This commit is contained in:
Patrick Ulbrich
2011-09-18 17:20:11 +02:00
parent 5d178a6f7e
commit a2686304f0
3 changed files with 5 additions and 8 deletions

View File

@@ -26,8 +26,7 @@ PACKAGE_NAME = "mailnag"
__builtins__.USE_GTK3 = True # make keyring.py use GTK3
import gobject
from gi.repository import GLib, GdkPixbuf, Gtk
from gi.repository import GLib, GdkPixbuf, Gtk, GObject
import os
import ConfigParser

View File

@@ -22,10 +22,8 @@
# MA 02110-1301, USA.
#
import gobject
if __builtins__["USE_GTK3"]:
from gi.repository import GLib, GdkPixbuf, Gtk
from gi.repository import GObject, GLib, GdkPixbuf, Gtk
else:
Gtk = __import__("gtk")
GLib = __import__("glib")

View File

@@ -28,7 +28,6 @@ import urllib2
import ConfigParser
import os
import subprocess
import gobject
PACKAGE_NAME = "mailnag"
@@ -37,9 +36,10 @@ PACKAGE_NAME = "mailnag"
__builtins__.USE_GTK3 = False # (also prevents keyring.py from using GTK3)
if __builtins__.USE_GTK3:
from gi.repository import GLib, GdkPixbuf, Gtk, Notify
from gi.repository import GObject, GLib, GdkPixbuf, Gtk, Notify
else:
Gtk = __import__("gtk")
from gi.repository import GObject
import pynotify
import time
@@ -696,7 +696,7 @@ def main():
if cfg.get('general', 'check_once') == '0': # wanna do more than one email check?
check_interval = int(cfg.get('general', 'check_interval'))
gobject.timeout_add_seconds(60 * check_interval, mailchecker.timeout)
GObject.timeout_add_seconds(60 * check_interval, mailchecker.timeout)
Gtk.main() # start Loop
cleanup()