Ñò
ÝT~Kc           @   s:   d  d k  Z  d  d k Z d  d k Z g  Z d d „ Z d S(   iÿÿÿÿNt   templatec         C   sâ  t  i } | d j o t  i i ƒ  } n t  i i ƒ  } |  i d ƒ d j  o
 h  } n: d d k } |  i d d ƒ \ }  } t | i	 | ƒ ƒ } x­ | D]3 } t
 i i | |  ƒ } t
 i i | ƒ o Pq˜ q˜ W| i d | |  ƒ | t j oN | i d | ƒ x* | D]" } | i d	 t
 i i | ƒ ƒ qWt i | ƒ n d St
 i i | ƒ } t
 i i t i d d
 d ƒ }	 |	 t i j o t i i |	 ƒ n t
 i i t
 i i | ƒ ƒ \ }
 } | d } y. y t d | ƒ } Wn t | ƒ } n XWn+ t j
 o } | i d | | | | ƒ SXt  i i |  ƒ } | d j o |  | d <n | i | ƒ | i d | t
 i i | ƒ | ƒ | d j o | i | | d | ƒ St  i i ƒ  } t
 i i | |
 ƒ } | i | | | | ƒ | Sd S(   sA    select a template module based on file extension and execute it R    t   ?i    iÿÿÿÿNi   s   Unable to locate %s %ss   %s search path:s       %st   planett   shellt   _s/   Skipping %s '%s' after failing to load '%s': %st   plugint   __file__s   Processing %s %s using %st   filter(   R   t   loggert   configt   template_directoriest   filter_directoriest   findt   cgit   splitt   dictt	   parse_qslt   ost   patht   joint   existst   errort   logged_modest   infot   realpatht   appendt   syst   splitextt   basenamet
   __import__t	   Exceptiont   template_optionst   updatet   debugt   runt   Nonet
   output_dir(   t   template_filet   doct   modet   logt   dirst   extra_optionsR   t   template_dirt   template_resolvedt	   shellpatht   baset   extt   module_namet   modulet   instt   optionsR$   t   output_file(    (    s'   /net/bzr/venus/planet/shell/__init__.pyR"      s`    	
  	  $
	 (   R   R   R   R   R"   (    (    (    s'   /net/bzr/venus/planet/shell/__init__.pyt   <module>   s   
