All pastes #759071 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-02 20:17 UTC
rendered paste body
        d = self.queryOffset(userId)
        d.addCallback(self.getSpans, scheds, x)
        return d

    def getSpans(self, rows, scheds, x):
        mktimestamp = lambda x: DateTime(2005, 5, 1 + x / 48, (x % 48) / 2, (x % 2) * 30) - DateTimeDelta(0,rows[0][0])
        for sched in scheds:
            spans.append((mktimestamp(sched[0]), mktimestamp(sched[1])))            
        return spans