ó
è?F[c           @   sà   d  e  f d „  ƒ  YZ d e  f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ	 d e f d „  ƒ  YZ
 d S(   t   Qualificationsc           B   s&   e  Z d d  „ Z d „  Z d „  Z RS(   c         C   s"   | d  k r g  } n  | |  _ d  S(   N(   t   Nonet   requirements(   t   selfR   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyt   __init__   s    	c         C   s   |  j  j | ƒ d  S(   N(   R   t   append(   R   t   req(    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyt   add   s    c         C   s~   i  } t  |  j ƒ d k s! t ‚ xV t |  j ƒ D]E \ } } | j ƒ  } x* | D]" } | | | d | d | f <qP Wq1 W| S(   Ni
   s   QualificationRequirement.%s.%si   (   t   lenR   t   AssertionErrort	   enumeratet   get_as_params(   R   t   paramst   nR   t	   reqparamst   rp(    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR       s    $N(   t   __name__t
   __module__R   R   R   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR       s   	t   Requirementc           B   s&   e  Z d  Z d e d „ Z d „  Z RS(   s0   
    Representation of a single requirement
    c         C   s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   t   qualification_type_idt
   comparatort   integer_valuet   required_to_preview(   R   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   /   s    			c         C   s¥   i |  j  d 6|  j d 6} |  j d k r] x_ t |  j d ƒ D] \ } } | | d | <q< Wn. |  j d k r‹ |  j d  k	 r‹ |  j | d	 <n  |  j r¡ d
 | d <n  | S(   Nt   QualificationTypeIdt
   Comparatort   Int   NotIni   s   IntegerValue.%dt   Existst   DoesNotExistt   IntegerValuet   truet   RequiredToPreview(   R   R   (   R   R   (   R   R   R
   R   R   R   (   R   R   t   iR   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   5   s    
	N(   R   R   t   __doc__R   t   FalseR   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   *   s   t&   PercentAssignmentsSubmittedRequirementc           B   s   e  Z d  Z e d „ Z RS(   sš   
    The percentage of assignments the Worker has submitted, over all assignments the Worker has accepted. The value is an integer between 0 and 100.
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   00000000000000000000R   R   R   (   t   superR#   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   H   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR#   C   s   t&   PercentAssignmentsAbandonedRequirementc           B   s   e  Z d  Z e d „ Z RS(   s»   
    The percentage of assignments the Worker has abandoned (allowed the deadline to elapse), over all assignments the Worker has accepted. The value is an integer between 0 and 100.
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   00000000000000000070R   R   R   (   R%   R&   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   P   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR&   K   s   t%   PercentAssignmentsReturnedRequirementc           B   s   e  Z d  Z e d „ Z RS(   s™   
    The percentage of assignments the Worker has returned, over all assignments the Worker has accepted. The value is an integer between 0 and 100.
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   000000000000000000E0R   R   R   (   R%   R(   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   X   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR(   S   s   t%   PercentAssignmentsApprovedRequirementc           B   s   e  Z d  Z e d „ Z RS(   sÌ   
    The percentage of assignments the Worker has submitted that were subsequently approved by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100.
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   000000000000000000L0R   R   R   (   R%   R*   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   `   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR*   [   s   t%   PercentAssignmentsRejectedRequirementc           B   s   e  Z d  Z e d „ Z RS(   sÌ   
    The percentage of assignments the Worker has submitted that were subsequently rejected by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100.
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   000000000000000000S0R   R   R   (   R%   R,   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   h   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR,   c   s   t   NumberHitsApprovedRequirementc           B   s   e  Z d  Z e d „ Z RS(   s®  
    Specifies the total number of HITs submitted by a Worker that have been approved. The value is an integer greater than or equal to 0.

    If specifying a Country and Subdivision, use a tuple of valid  ISO 3166 country code and ISO 3166-2 subdivision code, e.g. ('US', 'CA') for the US State of California.

    When using the 'In' and 'NotIn', locale should be a list of Countries and/or (Country, Subdivision) tuples.

    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   00000000000000000040R   R   R   (   R%   R.   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   u   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR.   k   s   t   LocaleRequirementc           B   s#   e  Z d  Z e d „ Z d „  Z RS(   s®   
    A Qualification requirement based on the Worker's location. The Worker's location is specified by the Worker to Mechanical Turk when the Worker creates his account.
    c      	   C   s8   t  t |  ƒ j d d d | d d  d | ƒ | |  _ d  S(   NR   t   00000000000000000071R   R   R   (   R%   R0   R   R   t   locale(   R   R   R2   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   }   s    +c         C   sñ   i |  j  d 6|  j d 6} |  j d k r“ x« t |  j d ƒ D]P \ } } t | t ƒ r~ | d | d | <| d | d | <q< | | d | <q< WnD t |  j t ƒ rÊ |  j d | d	 <|  j d | d
 <n |  j | d	 <|  j rí d | d <n  | S(   NR   R   R   R   i   i    s   LocaleValue.%d.Countrys   LocaleValue.%d.Subdivisions   LocaleValue.Countrys   LocaleValue.SubdivisionR   R   (   R   R   (   R   R   R
   R2   t
   isinstancet   tupleR   (   R   R   R    R2   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR      s     
	(   R   R   R!   R"   R   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR0   x   s   t   AdultRequirementc           B   s   e  Z d  Z e d „ Z RS(   sÅ   
    Requires workers to acknowledge that they are over 18 and that they agree to work on potentially offensive content. The value type is boolean, 1 (required), 0 (not required, the default).
    c      	   C   s/   t  t |  ƒ j d d d | d | d | ƒ d  S(   NR   t   00000000000000000060R   R   R   (   R%   R5   R   (   R   R   R   R   (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR   œ   s    (   R   R   R!   R"   R   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyR5   —   s   N(   t   objectR    R   R#   R&   R(   R*   R,   R.   R0   R5   (    (    (    s7   lib/python2.7/site-packages/boto/mturk/qualification.pyt   <module>   s   