peterknife / boto

Automatically exported from code.google.com/p/boto
0 stars 0 forks source link

MTurk Block Worker #457

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Boto is great.  But I need to be able to block (and unblock) Turk workers.  
(It's not evil.. I just have one test, and I don't want people doing it more 
than once.)

I added this code to connection.py and it works great.  I don't know if your 
policy is to have one function or two, in this case, but I wrote it as two.

Can you add this to your code?  (The Turk documentation says that the remark is 
optional, but the API disagreed. :-)

Thanks.

- Malcolm

    def block_worker(self, worker_id, reason):
        """
        Block a worker from working on my tasks.
        """
        params = {'WorkerId': worker_id, 'Reason': reason}

        return self._process_request('BlockWorker', params)

    def unblock_worker(self, worker_id, reason):
        """
        Unblock a worker from working on my tasks.
        """
        params = {'WorkerId': worker_id, 'Reason': reason}

        return self._process_request('UnblockWorker', params)

Original issue reported on code.google.com by malcolms...@gmail.com on 24 Sep 2010 at 12:14

GoogleCodeExporter commented 9 years ago
see http://github.com/boto/boto/commit/80018fb42f6e63a359fbb4cd31edd9d212f2b14d

Original comment by Mitch.Ga...@gmail.com on 24 Sep 2010 at 11:31