ó
è?F[c           @   s   d  d l  Z  d  d l m Z m Z d  d l m Z d  d l Z d  d l Z d  d l Z	 d  d l
 m Z d  d l  m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   AWSQueryConnectiont   AWSAuthConnection(   t   BotoServerError(   t   ItemSet(   t   handlert   ECSConnectionc           B   sq   e  Z d  Z d Z d
 d
 e d
 d
 d
 d
 d
 d d d
 d d
 d
 d „ Z d „  Z d d
 d „ Z d „  Z	 d	 „  Z
 RS(   sª   
    ECommerce Connection

    For more information on how to use this module see:

    http://blog.coredumped.org/2010/09/search-for-books-on-amazon-using-boto.html
    s
   2010-11-01s   ecs.amazonaws.comi    t   /c         C   sG   t  t |  ƒ j | | | | | | | | |	 |
 | | d | d | ƒd  S(   Nt   security_tokent   profile_name(   t   superR   t   __init__(   t   selft   aws_access_key_idt   aws_secret_access_keyt	   is_securet   portt   proxyt
   proxy_portt
   proxy_usert
   proxy_passt   hostt   debugt   https_connection_factoryt   pathR   R   (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyR
   *   s
    c         C   s   d g S(   Nt   ecs(    (   R   (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyt   _required_auth_capability5   s    c   	      C   sI  d | d <| | d <| r' | | d <n  |  j  d | d ƒ } | j ƒ  j d ƒ } t j j | ƒ | j d k r¿ t j j d | j | j	 f ƒ t j j d	 | ƒ t
 | j | j	 | ƒ ‚ n  | d k rã t |  | | | ƒ } n | } t j | |  ƒ } t j j | j d ƒ | ƒ | j sEt
 | j d
 j | j d   ƒ ‚ n  | S(   sQ   
        Utility method to handle calls to ECS and parsing of responses.
        t   AWSECommerceServicet   Servicet	   Operationt   ItemPages	   /onca/xmls   utf-8iÈ   s   %s %ss   %ss   {Code}: {Message}i    N(   t   make_requestt   Nonet   readt   decodet   botot   logR   t   statust   errort   reasonR   R   R   t
   XmlHandlert   xmlt   saxt   parseStringt   encodet   is_validt   formatt   errors(	   R   t   actiont   paramst   paget   itemSett   responset   bodyt   rst   h(    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyt   get_response8   s&    

 	%c         K   s   | | d <|  j  d | ƒ S(   s  
        Returns items that satisfy the search criteria, including one or more search
        indices.

        For a full list of search terms,
        :see: http://docs.amazonwebservices.com/AWSECommerceService/2010-09-01/DG/index.html?ItemSearch.html
        t   SearchIndext
   ItemSearch(   R7   (   R   t   search_indexR0   (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyt   item_searchW   s    
c         K   s   |  j  d | ƒ S(   sÈ   
        Returns items that satisfy the lookup query.

        For a full list of parameters, see:
        http://s3.amazonaws.com/awsdocs/Associates/2011-08-01/prod-adv-api-dg-2011-08-01.pdf
        t
   ItemLookup(   R7   (   R   R0   (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyt   item_lookupb   s    N(   t   __name__t
   __module__t   __doc__t
   APIVersionR   t   TrueR
   R   R7   R;   R=   (    (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyR      s   				(   R"   t   boto.connectionR    R   t   boto.exceptionR   t   timet   urllibt   xml.saxR(   t   boto.ecs.itemR   R   R   (    (    (    s0   lib/python2.7/site-packages/boto/ecs/__init__.pyt   <module>   s   