def run(self): """ Until told to quit, retrieve the next task and execute it, calling the callback if any. """ if self._db == None: self._db = ptvDB.ptvDB(self._polling_callback) while self.__isDying == False: logging.debug("Polling") self._db.poll_multiple(ptvDB.A_AUTOTUNE) for i in range(0, self._poll_timeout / 2): if self.__isDying: logging.debug("Quitting DB") break time.sleep(2) logging.debug("db finishing") self._db.finish()
def __init__(self, handle): activity.Activity.__init__(self, handle) self.glade_prefix = utils.get_glade_prefix() self._session_tag = self._get_session_tag() self._feedlist = None #feed_id, feed_info['title'], feed_info['url'] logging.debug("Activity ID: %s" % (str(self._session_tag), )) toolbox = activity.ActivityToolbox(self) self.set_toolbox(toolbox) toolbox.show() logging.debug("Loading DB") self._db = ptvDB.ptvDB() newdb = self._db.maybe_initialize_db() if newdb: self._import_defaults() self._update_thread = None self.set_canvas(self._build_ui()) #self.connect('destroy', self.do_quit) self.newsreader_tube = None #shared activity self.initiating = None # I initiated the activity # get the Presence Service self.pservice = presenceservice.get_instance() # Buddy object for you self.owner = self.pservice.get_owner() self.connect('shared', self._shared_cb) self.connect('joined', self._joined_cb) self.connect('feed-polled', self._feed_polled_cb) gobject.idle_add(self._post_show_init, toolbox)
def __init__(self, handle): activity.Activity.__init__(self, handle) self.glade_prefix = utils.get_glade_prefix() self._session_tag = self._get_session_tag() self._feedlist = None #feed_id, feed_info['title'], feed_info['url'] logging.debug("Activity ID: %s" % (str(self._session_tag),)) toolbox = activity.ActivityToolbox(self) self.set_toolbox(toolbox) toolbox.show() logging.debug("Loading DB") self._db = ptvDB.ptvDB() newdb = self._db.maybe_initialize_db() if newdb: self._import_defaults() self._update_thread = None self.set_canvas(self._build_ui()) #self.connect('destroy', self.do_quit) self.newsreader_tube = None #shared activity self.initiating = None # I initiated the activity # get the Presence Service self.pservice = presenceservice.get_instance() # Buddy object for you self.owner = self.pservice.get_owner() self.connect('shared', self._shared_cb) self.connect('joined', self._joined_cb) self.connect('feed-polled', self._feed_polled_cb) gobject.idle_add(self._post_show_init, toolbox)