
${Lc           @   s   d  d k  Z  d  d k Z d  d k Z d  d k l Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d S(   iN(   t   settingsc          C   sW   y< d d k  l }  l } |  d j o t | f St | f SWn t j
 o d SXd  S(   Ni(   t   vert   sveri   i   i    (   i   i   i    (   NN(   t   translate.__version__R   R   t   Truet   Falset   ImportErrort   None(   R   R   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_translate   s    c       	   C   s]   yB y d d k  l }  Wn# t j
 o d d k l }  n Xt SWn t j
 o t SXd  S(   Ni(   t   dbapi2(   t   sqlite3R	   R   t	   pysqlite2R   R   (   R	   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_sqlite)   s    c          C   sB   d d k  l }  l } |  d j o t |   f St |   f Sd  S(   Ni(   t   VERSIONt   get_versioni   i   i    (   i   i   i    (   t   djangoR   R   R   R   (   R   R   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_django4   s    c        
   C   sB   y3 t  i d d t t i  d t t i  t SWn t SXd S(   s   test for unzip commandt   unzipt   stdoutt   stderrN(   t
   subprocesst   callt   filet   ost   devnullR   R   (    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt
   test_unzip?   s
    +c          C   s^   d d  k  }  d   t i D } | p d d d g } n t |  i d d | d t  d	 j S(
   Nic         s   s   x |  ] } | d  Vq Wd S(   i    N(    (   t   .0t   lang(    (    s"   /var/www/Pootle/pootle/depcheck.pys	   <genexpr>I   s   	 t   aft   art   frt   iso_639t	   languagest   alli    (   t   gettextR    t	   LANGUAGESt   lent   findR   (   R"   R    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_iso_codesG   s
    c       	   C   sW   y< d d k  l }  l } |  d j o t | f St | f SWn t j
 o d SXd  S(	   Ni(   t   LXML_VERSIONt   __version__i   i   i   i    (   i   i   i   i    (   NN(   t
   lxml.etreeR'   R(   R   R   R   R   (   R'   R(   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt	   test_lxmlQ   s    c          C   s/   y d d  k  }  t SWn t j
 o t SXd  S(   Ni(   t   LevenshteinR   R   R   (   R+   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_levenshtein[   s
    c          C   sB   d d k  l }  g  } |    D] } | | i i d  d q ~ S(   Ni(   t   _get_available_indexerst   .(   t   translate.search.indexingR-   t
   __module__t   split(   R-   t   _[1]t   indexer(    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_indexerb   s    c          C   sY   y d d  k  }  t SWn> t j
 o2 y d d  k } t SWn t j
 o n Xt SXd  S(   Ni(   t   aeidonR   R   t   gaupolR   (   R5   R6   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_gaupolf   s    c          C   s/   y d d  k  }  t SWn t j
 o t SXd  S(   Ni(   t   MySQLdbR   R   R   (   R8   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_mysqldbu   s
    c           C   s   t  i d j S(   s9   test that we are not using sqlite3 as the django databaseR
   (   R    t   DATABASE_ENGINE(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_db}   s    c           C   s   t  i i d  S(   s"   test if cache backend is memcachedt	   memcached(   R    t   CACHE_BACKENDt
   startswith(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt
   test_cache   s    c          C   s/   y d d  k  }  t SWn t j
 o t SXd  S(   Ni(   t   memcacheR   R   R   (   R@   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_memcache   s
    c          C   s$   d d k  l }  |  i i d i   S(   s)   test if we can connect to memcache serveri(   t   cachei    (   t   django.core.cacheRB   t   _cachet   serverst   connect(   RB   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_memcached   s    c          C   s/   y d d k  }  t SWn t j
 o t SXd S(   s(   test that cached_db session is availableiN(   t*   django.contrib.sessions.backends.cached_dbR   R   R   (   R   (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_cached_db_session   s
    c           C   s   t  i i d  d d j S(   s,   test that session backend is set to memcahceR.   iRB   t	   cached_db(   s   cacheRJ   (   R    t   SESSION_ENGINER1   (    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_session   s    c           C   s   t  i S(   N(   R    t   DEBUG(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt
   test_debug   s    c           C   s-   d t  i j p d t  i j p d t  i j S(   s   test that webserver is apachet   apachet   _apachet   mod_wsgi(   t   syst   modules(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_webserver   s    c           C   s   t  i S(   N(   R    t   LIVE_TRANSLATION(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_livetranslation   s    c           C   s   t  t i  S(   N(   t   boolR    t   DEFAULT_FROM_EMAIL(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_from_email   s    c           C   s   t  t i  S(   N(   RW   R    t   CONTACT_EMAIL(    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   test_contact_email   s    (   R   RR   R   t   django.confR    R   R   R   R   R&   R*   R,   R4   R7   R9   R;   R?   RA   RG   RI   RL   RN   RT   RV   RY   R[   (    (    (    s"   /var/www/Pootle/pootle/depcheck.pyt   <module>   s0   	
				
	
														