Exemplo n.º 1
0
Arquivo: test.py Projeto: utsdab/usr
def test_task_ops(task):
    print "retry"
    tq.retry(task)
    print "resume"
    tq.resume(task)
    print "skip"
    tq.skip(task)
    print "log"
    log = tq.log(task)
    print log
Exemplo n.º 2
0
    def processObject(self, obj):
        """Operate on the provided task object."""

        # fetch the log for task; result is in a dictionary, so extract for this (jid, tid)
        log = query.log(obj).get((obj.jid, obj.tid), "")

        # print a header if that is desired
        if not self.opts.noheader:
            hdr = self.formatter.format(obj)
            if self.parent.color:
                hdr = terminal.TerminalColor('yellow').colorStr(hdr)
            print hdr

        # make each line unique if that is desired
        if self.opts.unique:
            pre = '[%s %d %d] ' % (obj.Job.user, obj.jid, obj.tid)
            log = pre + log.replace('\n', '\n' + pre)

        if log:
            print log
Exemplo n.º 3
0
    def processObject(self, obj):
        """Operate on the provided task object."""

        # fetch the log for task; result is in a dictionary, so extract for this (jid, tid)
        log = query.log(obj).get((obj.jid, obj.tid), "")

        # print a header if that is desired
        if not self.opts.noheader:
            hdr = self.formatter.format(obj)
            if self.parent.color:
                hdr = terminal.TerminalColor('yellow').colorStr(hdr)
            print hdr

        # make each line unique if that is desired
        if self.opts.unique:
            pre = '[%s %d %d] ' % (obj.Job.user, obj.jid, obj.tid)
            log = pre + log.replace('\n', '\n' + pre)

        if log:
            print log