;ò
ÎÑAHc           @   sŸ   d  Z  d k Z e i i ƒ  Z d k l Z d k Z d k	 Z	 d k
 l Z d „  Z y d k Z e Z Wn e j
 o d „  Z n Xd „  Z e i d ƒ d S(   sJ    IPython extension: Render templates from variables and paste to clipbard N(   s   Template(   s   itplnsc         C   sM   d k  } d k } | i ƒ  | i ƒ  | i |  i d d ƒ ƒ | i ƒ  d S(   st    Places contents of s to clipboard
    
    Needs pyvin32 to work:
    http://sourceforge.net/projects/pywin32/
    Ns   
s   
(	   s   win32clipboards   cls   win32cons   OpenClipboards   EmptyClipboards   SetClipboardTexts   ss   replaces   CloseClipboard(   s   ss   win32cons   cl(    (    sN   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_render.pys
   toclip_w32   s     		

c         C   s   d  S(   N(    (   s   s(    (    sN   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_render.pys   toclip   s    c         C   sM   t  i i |  ƒ o t |  ƒ i ƒ  }  n t |  t i ƒ } t
 | ƒ | Sd S(   s
   Render a template (Itpl format) from ipython variables

    Example:
    
    $ import ipy_render
    $ my_name = 'Bob'  # %store this for convenience
    $ t_submission_form = "Submission report, author: $my_name"  # %store also
    $ render t_submission_form
    
    => returns "Submission report, author: Bob" and copies to clipboard on win32

    # if template exist as a file, read it. Note: ;f hei vaan => f("hei vaan")
    $ ;render c:/templates/greeting.txt  
    
    Template examples (Ka-Ping Yee's Itpl library):
    
    Here is a $string.
    Here is a $module.member.
    Here is an $object.member.
    Here is a $functioncall(with, arguments).
    Here is an ${arbitrary + expression}.
    Here is an $array[3] member.
    Here is a $dictionary['member'].
    N(   s   oss   paths   isfiles   tmpls   opens   reads   itplnss   ips   user_nss   ress   toclip(   s   tmpls   res(    (    sN   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_render.pys   render"   s     
s   render(   s   __doc__s   IPython.ipapis   IPythons   ipapis   gets   ips   strings   Templates   syss   oss   IPython.Itpls   itplnss
   toclip_w32s   win32clipboards   toclips   ImportErrors   renders
   to_user_ns(
   s
   toclip_w32s   win32clipboards   renders   itplnss   ips   syss   Templates   IPythons   toclips   os(    (    sN   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_render.pys   ?   s   			
	!