ó
àÆ÷Xc           @  s  d  d l  m Z d  d l Z d  d l Z d  d l Z e j d k r˜ d Z d e j k re e j d n d Z e r~ e d 7Z n  e e 7Z e e j d <n  d  d l	 Z	 d  d l	 m
 Z
 d  d l Z	 d  d	 l m Z e j d
 ƒ Z d „  Z d „  Z e d k re ƒ  n  d S(   iÿÿÿÿ(   t   print_functionNt   win32s   cxx=,device=cput   THEANO_FLAGSt    t   ,(   t   config(   t   get_module_caches   theano.bin.theano-cachec         C  s˜   |  r# t  d d j t j ƒ ƒ n  t  d ƒ t  d ƒ t  d ƒ t  d ƒ t  d ƒ t  d ƒ t  d	 ƒ t  d
 ƒ t  d ƒ t  d ƒ t j |  ƒ d  S(   Ns   command "%s" not recognizedt    s/   Type "theano-cache" to print the cache locations+   Type "theano-cache help" to print this helps,   Type "theano-cache clear" to erase the caches3   Type "theano-cache list" to print the cache contents8   Type "theano-cache unlock" to unlock the cache directorysI   Type "theano-cache cleanup" to delete keys in the old format/code versionsB   Type "theano-cache purge" to force deletion of the cache directorysM   Type "theano-cache basecompiledir" to print the parent of the cache directorysT   Type "theano-cache basecompiledir list" to print the content of the base compile dirs{   Type "theano-cache basecompiledir purge" to remove everything in the base compile dir, that is, erase ALL cache directories(   t   printt   joint   syst   argvt   exit(   t   exit_status(    (    s0   /tmp/pip-build-X4mzal/theano/bin/theano_cache.pyt
   print_help   s    









c          C  s³  t  t j ƒ d k r% t t j ƒ nŠt  t j ƒ d k rt j d d k r] t d d ƒ n  t j d d k r$t d t d t	 ƒ ƒ }  |  j
 d	 d
 d t d t ƒ g  t t j |  j ƒ ƒ D] } | j d ƒ r½ | ^ q½ } | rt j d t j ƒ t j d t  | ƒ d j | ƒ f ƒ qq¯t j d d k rJt j j j ƒ  q¯t j d d k r’t j j j ƒ  t d t d t	 ƒ ƒ }  |  j ƒ  q¯t j d d k rÂt j j j ƒ  t d ƒ q¯t j d d k rèt j j j ƒ  q¯t j d d k rt t j j ƒ q¯t d d ƒ n‘ t  t j ƒ d k r¢t j d d k r¢t j d d k rlt j j j ƒ  q¯t j d d k r’t j j j ƒ  q¯t d d ƒ n t d d ƒ d  S(   Ni   i   t   helpR   i    t   cleart	   init_argst
   do_refresht   unversioned_min_ageiÿÿÿÿt   clear_base_filest   delete_if_problemt   tmps³   There remain elements in the cache dir that you may need to erase manually. The cache dir is:
  %s
You can also call "theano-cache purge" to remove everything from that directory.s   Remaining elements (%s): %ss   , t   listt   cleanupt   unlocks   Lock successfully removed!t   purget   basecompilediri   (    t   lenR
   R   R   R   t
   compiledirR   R   t   dictt   FalseR   t   Truet   sortedt   ost   listdirt   dirnamet
   startswitht   _loggert   warningt   debugR	   t   theanot   goft   print_compiledir_contentR   t	   clear_oldt   compilelockt   force_unlockt   compiledir_purget   base_compiledirt   basecompiledir_lst   basecompiledir_purge(   t   cachet   itemt   items(    (    s0   /tmp/pip-build-X4mzal/theano/bin/theano_cache.pyt   main,   sL    	#(t   __main__(   t
   __future__R    t   loggingR"   R
   t   platformt   config_for_theano_cache_scriptt   environt   theano_flagsR)   R   t   theano.gof.compiledirt   theano.gof.ccR   t	   getLoggerR&   R   R6   t   __name__(    (    (    s0   /tmp/pip-build-X4mzal/theano/bin/theano_cache.pyt   <module>   s&   "
		6