def quit(self, widget): if self.services['timeout']: GObject.source_remove(self.services['timeout']) os.unlink(self.cfg_cls.LOCKFILE) Gtk.main_quit()