コード例 #1
0
        i += 1
        bottom = _get_float(argv[i])
        i += 1
        right = _get_float(argv[i])
        i += 1
        top = _get_float(argv[i])

        if left is None or bottom is None or right is None or top is None:
            Usage("ERROR: You have to specify left, bottom, right and top .")
        if top < bottom:
            Usage("ERROR: 'top' must be bigger then 'bottom'")
        if right < left:
            Usage("ERROR: 'right' must be bigger then 'left'")
        big_bbox = Bbox.from_lbrt(left, bottom, right, top)
        print 'Manger is running!'
        Manager.from_big_bbox(big_bbox, redis)
        print 'Manger is finished!'
    elif role == 'jobworker':
        print 'JobWorker is running!'
        jobWorker = Worker.from_worker([Constants.QUEUE_JOBS])
        jobWorker.run(redis)
    elif role == 'resultworker':
        print 'ResultWorker is running!'
        resultWorker = Worker.from_worker([Constants.QUEUE_RESULTS])
        resultWorker.run(redis)
    else:
        Usage("ERROR: Sorry, given role is not implemented yet.")