~kiddo/specto/pygi

« back to all changes in this revision

Viewing changes to spectlib/watch.py

  • Committer: Jean-François Fortin Tam
  • Date: 2011-04-14 03:44:34 UTC
  • Revision ID: nekohayo@gmail.com-20110414034434-v1awb67svwkd025e
First pass at porting from PyGTK to PyGI

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import time
26
26
import gobject
27
27
import thread
28
 
import gtk
 
28
from gi.repository import Gtk
29
29
from cgi import escape
30
30
 
31
31
try:
106
106
                        self.dbus_name,
107
107
                        self.dbus_path)
108
108
            else:
109
 
                gobject.source_remove(self.timer_id)
 
109
                GObject.source_remove(self.timer_id)
110
110
        except:
111
111
            self.error = True
112
112
            self.set_error(_("There was an error stopping the watch"))
158
158
                thread.start_new_thread(self.check, ())
159
159
                
160
160
                while self.lock.locked():
161
 
                    while gtk.events_pending():
162
 
                        gtk.main_iteration()
 
161
                    while Gtk.events_pending():
 
162
                        Gtk.main_iteration()
163
163
                    time.sleep(0.05)
164
164
        except:
165
165
            self.set_error(_("There was an error checking the watch"))
193
193
                self.specto.mark_watch_status("idle", self.id)
194
194
            try:
195
195
                self.lock.release()
196
 
                self.timer_id = gobject.timeout_add(self.refresh, self.start_checking)
 
196
                self.timer_id = GObject.timeout_add(self.refresh, self.start_checking)
197
197
            except:
198
 
                self.timer_id = gobject.timeout_add(self.refresh, self.check)
 
198
                self.timer_id = GObject.timeout_add(self.refresh, self.check)
199
199
        except:
200
200
            self.set_error(_("There was an error checking the watch"))
201
201