
	GOc           @   s;   d  d l  Z  d  d l Z d   Z e d k r7 e   n  d S(   iNc    
      C   s[  d  }  t j j t j j d d   rK t j j t j j d d   }  n9 t j j d  rr t j j d  }  n d GHt j d  x t j |   D] \ } } } x | D] } | j	 d  r t j
 j d | | f  t j j t j j | |   d } d | } t j |  } | j   } t d	 | d
   }	 |	 j |  Wd  QXq q Wq Wd  S(   Nt   conft   localesO   This script should be run from the Django Git tree or your project or app tree.i   s   .pos   processing file %s in %s
i    s   msguniq "%s.po"s   %s.pot   w(   t   Nonet   ost   patht   isdirt   joint   abspatht   syst   exitt   walkt   endswitht   stderrt   writet   splitextt   popent   readt   open(
   t   basedirt   dirpatht   dirnamest	   filenamest   ft   pft   cmdt   stdoutt   msgt   fp(    (    s3   ../Django//lib/python/django/bin/unique-messages.pyt   unique_messages   s"    !$%
t   __main__(   R   R	   R   t   __name__(    (    (    s3   ../Django//lib/python/django/bin/unique-messages.pyt   <module>   s   	