Esempio n. 1
0
 def get(self, node):
     started = getattr(node, "started", None)
     finished = getattr(node, "finished", None)
     if finished is None:
         return False, None
     elif started is None:
         return True, timefmt.datetime_to_str(finished)
     else:
         delta = finished - started
         return True, "%s after %s" % (
                     timefmt.timedelta_to_str(delta),
                     timefmt.datetime_to_str(started) )
Esempio n. 2
0
    def ui_dictify(self, result=None):
        if result is None:
            result = {}

        when = self.when
        if self.when:
            when = timefmt.datetime_to_str(self.when)
        result["when"] = when

        return BaseTask.ui_dictify(self, result)