ó ,ÕWOc@s&ddlZdefd„ƒYZdS(iÿÿÿÿNtLoadercBs5eZdZdZdZdddd„Zd„ZRS(tmustachet.cCsòd|kr|j}n|dk r0||_n|dk rH||_n|d|j}t|tƒrŠtjj||ƒ}|j |ƒSxB|D]:}tjj||ƒ}tjj |ƒr‘|j |ƒSq‘Wt d|dj|ƒfƒ‚dS(sLReturns the template string from a file or throws IOError if it non existentRs"%s" not found in "%s"t:N( tNonet template_pathttemplate_encodingttemplate_extensiont isinstancet basestringtostpathtjoint_load_template_filetexiststIOError(tselft template_namet template_dirstencodingt extensiont file_namet file_pathR ((sG/home/pradeek/Projects/college/python/shift-todo-app/pystache/loader.pyt load_template s        cCsOt|dƒ}z.|jƒ}|jr<t||jƒ}nWd|jƒX|S(s-Loads and returns the template file from disktrN(topentreadRtunicodetclose(RRtfttemplate((sG/home/pradeek/Projects/college/python/shift-todo-app/pystache/loader.pyR $s   N(t__name__t __module__RRRRRR (((sG/home/pradeek/Projects/college/python/shift-todo-app/pystache/loader.pyRs (R tobjectR(((sG/home/pradeek/Projects/college/python/shift-todo-app/pystache/loader.pyts