Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     self.proxies = WeakKeyDictionary()
     self._px_root = self
     self._real_px_target = None
     self._px_didstart = False
     self._px_dostart = False
     self._propagate_started = True
     BaseTask.__init__(self, *args, **kwargs)
Ejemplo n.º 2
0
    def _px_start(self):
        try:
            self._propagate_started = False

            BaseTask.start(self)
            if (self._px_target.can_activate
                    and not getattr(self._px_target, "started", None)):
                self._px_target.start()
                self._px_didstart = True
            self._px_dostart = False
        finally:
            self._propagate_started = True
Ejemplo n.º 3
0
    def search_texts(self):
        types, texts = BaseTask.search_texts(self)
        texts.add(timefmt.approx_delta(datetime.datetime.now().date(),
            self.date))
        texts.add(self.date.strftime('%A'))
        texts.add(timefmt.date_to_str(self.date))

        return types, texts
Ejemplo n.º 4
0
    def unfinish(self):
        temp_target = self._find_target()
        assert temp_target is not None, "cannot unfinish if my target is gone!"

        result = temp_target.unfinish()
        if not result:
            return result

        assert BaseTask.unfinish(self), ("was unable to unfinish reference!"
                    " tree state is probably bad!")
        assert not self.finished
        self.proxies = WeakKeyDictionary()
        self._px_dostart = False

        self.load_finished(temp_target)
        return True
Ejemplo n.º 5
0
 def start(self):
     BaseTask.start(self)
     if self.root.loading_in_progress:
         self.load_finished = self._post_started
     else:
         self._post_started()
Ejemplo n.º 6
0
 def ui_dictify(self, result=None):
     if result is None:
         result = {}
     result["target"] = self._px_target.id if self._px_target else None
     return BaseTask.ui_dictify(self, result)
Ejemplo n.º 7
0
 def finish(self):
     BaseTask.finish(self)
     self._finish_cleanup()
Ejemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     self.thealarm = self.alarm(self.derp)
     BaseTask.__init__(self, *args, **kwargs)