ha-Kc @sdZdZddd!ZddkZddkZddkZddkZddklZddjZ d djZ d efd YZ dS( sA baseclass for the SkeletonPage template Meta-Data ========== Author: Tavis Rudd , Version: $Revision: 1.13 $ Start Date: 2001/04/05 Last Revision Date: $Date: 2002/10/01 17:52:02 $ s!Tavis Rudd s$Revision: 1.13 $i iiN(tTemplateiit _SkeletonPagecBseZdZddZdZdZdZdZdZdZ d Z d Z d Z d Z dddd dZdZddZdddZhdZdZRS(s)A baseclass for the SkeletonPage templates?tswww.example.coms$Designed & Implemented by Tavis Rudds Tavis RuddscOsyti|||hhdd6dd6d6hdd6d6|_h|_g|_h|_h|_h|_h|_dS( NtCheetahtkeywordsstext/html; charset=iso-8859-1s Content-Types HTTP-EQUIVs+Cheetah: The Python-Powered Template Enginet generatortNAME( Rt__init__t _metaTagst _stylesheetst_stylesheetsOrdert_stylesheetLibst_javascriptLibst_javascriptTagst_bodyTagAttribs(tselftargstKWs((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pyR/s       cCs|i|iS(s~Return a formatted vesion of the self._metaTags dictionary, using the formatMetaTags function from Cheetah.Macros.HTML(tformatMetaTagsR(R((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytmetaTagsBsc Cs/d}x5|iiD]$\}}|dt|d7}qW|ip|S|d7}x|iD]}||ijo$d|d}|GH||7}qan|i|}d}d}x<|iD].\} } |t| dt| d7}qW|d }d |d |d }||7}qaW|d 7}|S(s2Return a formatted version of the self._stylesheetLibs and self._stylesheets dictionaries. The keys in self._stylesheets must be listed in the order that they should appear in the list self._stylesheetsOrder, to ensure that the style rules are defined in the correct order.Rs- s (R titemststrR R ( RtstylesheetTagsTxtttitletsrct identifiertwarningt attribsDicttcssCodet attribCodetktv((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytstylesheetTagsHs4       &  c Csg}xp|iiD]_\}}t|ttfpd|g}n|dt|ddt|ddg7}qWxp|iiD]_\}}t|ttfpd|g}n|dt|ddt|ddg7}qWdi|S( sReturn a formatted version of the javascriptTags and javascriptLibs dictionaries. Each value in javascriptTags should be a either a code string to include, or a list containing the JavaScript version number and the code string. The keys can be anything. The same applies for javascriptLibs, but the string should be the SRC filename rather than a code string.Rs s" type="text/javascript" src="is" /> (R t iteritemst isinstancetlistttupleRR tjoin(RtjavascriptTagsTxttkeytdetails((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytjavascriptTagsms   cCs|id|iS(s>Create a body tag from the entries in the dict bodyTagAttribs.tbody(t formHTMLTagR(R((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytbodyTagsic Cs|i|}| p| oySddk}|i|}|i\}} ~|p |}n|p | }nWqyNtid|iid\}} |p |}n|p | }nWqqXqXn|oH|oAdid|dt |dt |d |d t |d g S|o5did|dt |d |d t |d g S|o5did|dt |d |d t |d g Sdid|d |d t |d gSdS( sDynamically generate an image tag. Cheetah will try to convert the src argument to a WebKit serverSidePath relative to the servlet's location. If width and height aren't specified they are calculated using PIL or ImageMagick if available.iNsidentify -format "%w,%h" t,Rs s
���( t normalizePathtImagetopentsizetostpopentreadtsplitR&R( RRtalttwidththeighttborderR0timt calcWidtht calcHeight((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytimgTags>  "  $cCstidtitiS(s,Return a string representing the current yr.s%Y(ttimetstrftimet localtime(R((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pyt currentYrss %b %d, %YcCsti|titiS(s3Return a string representing the current localtime.(R?R@RA(Rt formatString((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pyt currentDatesicCsdt|t|fS(Ns6(R(RR8R9((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pytspacerscCsnd|ig}x?|iD]1\}}|d|idt|dg7}qW|iddi|S(s*returns a string containing an HTML tR(tlowerRRtappendR&(RttagNamet attributesttagTxttnametval((sE/usr/lib64/python2.6/site-packages/Cheetah/Templates/_SkeletonPage.pyR,s  ) c Csg}d|joJxG|diD]1\}}|dt|dt|dg7}q$Wnd|joJxG|diD]1\}}|dt|dt|dg7}q{Wndi|S(s9format a dict of metaTag definitions into an HTML versions HTTP-EQUIVs Rs