Allow main to also not be a generator

svn: r9628
This commit is contained in:
Doug Blank 2007-12-29 17:35:07 +00:00
parent 74c4e3e30b
commit 2c2266446e

View File

@ -31,6 +31,7 @@ import gtk
import gobject import gobject
import traceback import traceback
import time import time
import types
import pango import pango
import os import os
from gettext import gettext as _ from gettext import gettext as _
@ -281,6 +282,9 @@ class Gadget(object):
Runs the generator. Runs the generator.
""" """
if debug: print "%s _updater" % self.gui.title if debug: print "%s _updater" % self.gui.title
if type(self._generator) != types.GeneratorType:
self._idle_id = 0
return False
try: try:
retval = self._generator.next() retval = self._generator.next()
if retval == False: if retval == False:
@ -290,11 +294,9 @@ class Gadget(object):
self._idle_id = 0 self._idle_id = 0
return False return False
except Exception, e: except Exception, e:
#self._error = e print "Gadget gave an error"
traceback.print_exc() traceback.print_exc()
self._idle_id = 0 print "Continuing after gadget error..."
return False
except:
self._idle_id = 0 self._idle_id = 0
return False return False