示例#1
0
文件: internal.py 项目: thomasvs/dad
            def loaded(result):
                self.debug("loaded tracks for %r trackScores", len(kept))

                trackIdToScore = {}
                res = []

                for trackScore in kept:
                    trackIdToScore[trackScore.subjectId] = trackScore

                for succeeded, track in result:
                    if not succeeded:
                        log.warningFailure(track)
                    else:
                        trackScore = trackIdToScore[track.id]
                        res.append((track, trackScore.score, trackScore.userId))

                # res.sort(key=lambda r: r[0].id)
                if random:
                    import random as rm

                    rm.shuffle(res)

                return res
示例#2
0
 def eb(failure):
     log.warningFailure(failure)
     print 'ERROR: could not verify %s.%s: %r' % (
         sourceKlazz.__name__, attribute, failure)
示例#3
0
文件: internal.py 项目: thomasvs/dad
 def eb(failure, file):
     log.warningFailure(failure)
     self.warning("failure %r on file %r" % (log.getFailureMessage(failure), file))
     return failure