/usr/lib/python2.6/site-packages/tablib/packages
NameSizeModeActions
odf/-0755rm
odf3/-0755rm
omnijson/-0755rm
openpyxl/-0755rm
openpyxl3/-0755rm
unicodecsv/-0755rm
xlrd/-0755rm
xlrd3/-0755rm
xlwt/-0755rm
xlwt3/-0755rm
yaml/-0755rm
yaml3/-0755rm
markup.py191360644editdlrm
markup.pyc220060644editdlrm
markup3.py191290644editdlrm
markup3.pyc221150644editdlrm
ordereddict.py41100644editdlrm
ordereddict.pyc46410644editdlrm
__init__.py00644editdlrm
__init__.pyc1430644editdlrm
Edit: /usr/lib/python2.6/site-packages/tablib/packages/markup.pyc (22006B)
}DVc@sdZdZdeefZddkZdd*dYZdd+dYZd d,d YZed d Zed d ZdZ dZ e dZ e Z dZdd-dYZeZde_de_de_dd.dYZdefdYZdefdYZdefdYZdefd YZd!efd"YZd#efd$YZd%efd&YZd'efd(YZed)jo eGHndS(/s 17 May 2007s1.7s This is markup.py - a Python module that attempts to make it easier to generate HTML/XML from a Python program in an intuitive, lightweight, customizable and pythonic way. The code is in the public domain. Version: %s as of %s. Documentation and further info is at http://markup.sourceforge.net/ Please send bug reports, feature requests, enhancement ideas or questions to nogradi at gmail dot com. Installation: drop markup.py somewhere into your Python path. iNtelementcBsAeZdZdddZdZdZdZdZRS(s1This class handles the addition of a new element.tlowercCs<||_|djo|i|_n|i|_dS(NR(tparentRttagtupper(tselfRtcaseR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt__init__s  cOs~t|djot|in|idj o8|iidj o%d|jo|ii|d%su%s />u%s>N(t iteritemsR tstriptescapeRtcontenttappend(RRtsingletbetweenRtouttkeytvalue((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRCs&         cCs|i|iijo|iiid|inf|i|iijot|in=|iidjo)|i|iijot |indS(s9Append a closing tag unless element has only opening tag.sR N( RRRR'R(RRRRR(R((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pytclose]s )cKs|i|iijp|i|iijo|i|itd|n:|idjo)|i|iijot |indS(sAppend an opening tag.R N( RRRRRRR RRR(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pytopengs,&N( t__name__t __module__t__doc__R RR RR.R/(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs    tpagec BseZdZdddddddZdZdZedZdZ d Z d Z d Z d ddddddddddd Z dZdZdZRS(srThis is our main class representing a document. Elements are added as attributes of an instance of this class.R Rs c FCs ddddddddd d d g }d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQgF}dRdSg} dTdUdVdWdXdYdZd[g} g|_g|_g|_||_||_t|_||_|d\jp |d]jo||_|it t i |i7_||_ |i t t i |i 7_ | | |_ |i t t i |i 7_ d\|_n|d^joc|| |_|it t i |i7_|| |_ |i t t i |i 7_ ||_n|d_jot|o|o||_||_ nD|o| p|o| o tnt|_t|_ ||_n t|d`S(asStuff that effects the whole document. mode -- 'strict_html' for HTML 4.01 (default) 'html' alias for 'strict_html' 'loose_html' to allow some deprecated elements 'xml' to allow arbitrary elements case -- 'lower' element names will be printed in lower case (default) 'upper' they will be printed in upper case onetags -- list or tuple of valid elements with opening tags only twotags -- list or tuple of valid elements with both opening and closing tags these two keyword arguments may be used to select the set of valid elements in 'xml' mode invalid elements will raise appropriate exceptions separator -- string to place between added elements, defaults to newline class_ -- a class that will be added to every element if definedtAREAtBASEtBRtCOLtFRAMEtHRtIMGtINPUTtLINKtMETAtPARAMtAtABBRtACRONYMtADDRESStBtBDOtBIGt BLOCKQUOTEtBODYtBUTTONtCAPTIONtCITEtCODEtCOLGROUPtDDtDELtDFNtDIVtDLtDTtEMtFIELDSETtFORMtFRAMESETtH1tH2tH3tH4tH5tH6tHEADtHTMLtItIFRAMEtINStKBDtLABELtLEGENDtLItMAPtNOFRAMEStNOSCRIPTtOBJECTtOLtOPTGROUPtOPTIONtPtPREtQtSAMPtSCRIPTtSELECTtSMALLtSPANtSTRONGtSTYLEtSUBtSUPtTABLEtTBODYtTDtTEXTAREAtTFOOTtTHtTHEADtTITLEtTRtTTtULtVARtBASEFONTtISINDEXtAPPLETtCENTERtDIRtFONTtMENUtStSTRIKEtUR thtmlt loose_htmltxmlN(theaderR'tfooterRt separatorRt_fullRRtmaptstringRRRRtCustomizationErrortrussellt ModeError( RRRRRRRt valid_onetagst valid_twotagstdeprecated_onetagstdeprecated_twotags((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRssR'$'!!                       cCsF|ido|ido t|nt|d|id|S(Nt__RR(t startswithtendswithtAttributeErrorRR(Rtattr((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt __getattr__s  cCse|io0|idjp|idjoddg}ng}|ii|i|i|i|S(NR Rss(RRRRRR'R(Rtend((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt__str__s*cCs&|ot|iS|iSdS(sReturn the document as a string. escape -- False print normally True replace < and > by < and > the default escape sequences in most browsersN(t_escapeR(RR&((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR scCs|i|dS(sThis is an alias to addcontent.N(t addcontent(Rttext((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pytaddscCs|ii|dS(s+Add some text to the bottom of the documentN(RR((RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt addfooterscCs|ii|dS(s(Add some text to the top of the documentN(RR((RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt addheaderscCs|ii|dS(s.Add some text to the main part of the documentN(R'R((RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRstenc Cst|_|idjp|idjo_| d jo d} n|ii| |id||i|d j o|idddd|n|d j o|i |n|d j o|i |n|d j o|i |n| d j o|i | n|ii | d j o|i| n |i|d j o|ii|n|d j o|ii|qnW|id joF| d jo%|d j od |} qd } n|ii| nd S( sThis method is used for complete documents with appropriate doctype, encoding, title, etc information. For an HTML/XML snippet omit this method. lang -- language, usually a two character string, will appear as in html mode (ignored in xml mode) css -- Cascading Style Sheet filename as a string or a list of strings for multiple css files (ignored in xml mode) metainfo -- a dictionary in the form { 'name':'content' } to be inserted into meta element(s) as (ignored in xml mode) bodyattrs --a dictionary in the form { 'key':'value', ... } which will be added as attributes of the element as (ignored in xml mode) script -- dictionary containing src:type pairs, title -- the title of the document as a string to be inserted into a title element as my title (ignored in xml mode) header -- some text to be inserted right after the element (ignored in xml mode) footer -- some text to be inserted right before the element (ignored in xml mode) charset -- a string defining the character set, will be inserted into a element (ignored in xml mode) encoding -- a string defining the encoding, will be put into to first line of the document as in xml mode (ignored in html mode) doctype -- the document type string, defaults to in html mode (ignored in xml mode)R Rs?tlangR"s Content-TypeR'stext/html; charset=%sRs$sN(RRRR RR(RtheadtmetatmetainfotcssttitletscriptsR.tbodyR'R( RRRRRRRtcharsettencodingtdoctypet bodyattrstscript((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pytinits>+                  c Csmt|to&|id|ddddddn4x0|D](}|id|ddddddq=WdS( s|This convenience function is only useful for html. It adds css stylesheet(s) to the document via the element.threftrelt stylesheetttypestext/csstmediatallN(t isinstancet basestringtlink(Rtfilelisttfile((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR2s &cCsTt|to7x=|iD]"\}}|id|d|qWn tddS(sThis convenience function is only useful for html. It adds meta information via the element, the argument is a dictionary of the form { 'name':'content' }.tnameR'sKMetainfo should be called with a dictionary argument of name:content pairs.N(RtdictR$Rt TypeError(RRRR'((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR<s  cCs[t|to>xD|iD])\}}|idd|dd|qWn tddS(sOnly useful in html, mydict is dictionary of src:type pairs will be rendered as ttsrcRstext/%ss6Script should be given a dictionary of src:type pairs.N(RRR$RR(RRRR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRGs  %N(R0R1R2R RRRRR RRRRRRRR(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR3osE     N t _onelinercBs#eZdZddZdZRS(sAn instance of oneliner returns a string corresponding to one element. This class can be used to write 'oneliners' that return a string immediately so there is no need to instantiate the page class.RcCs ||_dS(N(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRWscCsF|ido|ido t|nt|d|iddS(NRRR(RRRRRR (RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRZs  (R0R1R2RR(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRRs RRRc cs:t|djo d}n1t|djot|d}n td|i}tt|i}ttt|g|}xt|D]}h}xSt ||D]B\}}y||||s>t(RRtreplace(Rtnewline((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR&s      cCst|tod|jo|idd}nd|jo|idd}nd|jo|idd}nd|jo|idd}qn|S( sInverse of escape.s&Rs>Rs<Rs"s"(RRR(R((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pytunescapes    tdummycBseZdZRS(s'A dummy class for attaching attributes.(R0R1R2(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRssesZsfRcBseZdZdZRS(s%A dummy class that contains anything.cCstS(N(R(Rtitem((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyt __contains__s(R0R1R2R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRst MarkupErrorcBseZdZdZRS(s!All our exceptions subclass this.cCs|iS(N(tmessage(R((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R2R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRsRcBseZdZRS(cCsd||_dS(NsLThe element '%s' does not accept non-keyword arguments (has no closing tag).(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRst OpeningErrorcBseZdZRS(cCsd||_dS(Ns#The element '%s' can not be opened.(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRsR cBseZdZRS(cCsd||_dS(NsDThe element '%s' was called with more than one non-keyword argument.(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyR sRcBseZdZRS(cCsd||f|_dS(Ns1The element '%s' is not valid for your mode '%s'.(R(RRR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRsRcBseZdZRS(cCsd||_dS(Ns[The element '%s' is deprecated, instantiate markup.page with mode='loose_html' to allow it.(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRsRcBseZdZRS(cCsd||_dS(NsDMode '%s' is invalid, possible values: strict_html, loose_html, xml.(R(RR((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRsRcBseZdZRS(cCs d|_dS(NsZIf you customize the allowed elements, you must define both types 'onetags' and 'twotags'.(R(R((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRs(R0R1R(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyRst__main__((((((t__date__t __version__R2RRR3Rtonelinertupper_onelinerR RRR&RRRRtframesettstricttlooseRRRRRR RRRRR0(((s6/tmp/pip-build-lt8jXN/tablib/tablib/packages/markup.pyts: U