/usr/lib/python2.6/site-packages/tablib/packages/odf3
NameSizeModeActions
anim.py18720644editdlrm
anim.pyc27240644editdlrm
attrconverters.py682100644editdlrm
attrconverters.pyc573550644editdlrm
chart.py26360644editdlrm
chart.pyc46240644editdlrm
config.py14200644editdlrm
config.pyc13910644editdlrm
dc.py22250644editdlrm
dc.pyc14640644editdlrm
dr3d.py14480644editdlrm
dr3d.pyc15240644editdlrm
draw.py55900644editdlrm
draw.pyc103430644editdlrm
easyliststyle.py37730644editdlrm
easyliststyle.pyc23120644editdlrm
element.py204730755editdlrm
element.pyc222500644editdlrm
elementtypes.py99330755editdlrm
elementtypes.pyc87290644editdlrm
form.py32700644editdlrm
form.pyc63900644editdlrm
grammar.py1933880644editdlrm
grammar.pyc1064580644editdlrm
load.py39630755editdlrm
load.pyc34090644editdlrm
manifest.py13890755editdlrm
manifest.pyc13440644editdlrm
math.py10680644editdlrm
math.pyc4590644editdlrm
meta.py21380644editdlrm
meta.pyc32430644editdlrm
namespaces.py39430644editdlrm
namespaces.pyc33140644editdlrm
number.py31370644editdlrm
number.pyc57430644editdlrm
odf2moinmoin.py181920644editdlrm
odf2moinmoin.pyc187740644editdlrm
odf2xhtml.py650580755editdlrm
odf2xhtml.pyc646200644editdlrm
odfmanifest.py35700755editdlrm
odfmanifest.pyc40720644editdlrm
office.py33460644editdlrm
office.pyc58950644editdlrm
opendocument.py259070644editdlrm
opendocument.pyc255300644editdlrm
presentation.py27160644editdlrm
presentation.pyc45550644editdlrm
script.py11060644editdlrm
script.pyc4840644editdlrm
style.py46720644editdlrm
style.pyc90620644editdlrm
svg.py17900644editdlrm
svg.pyc24060644editdlrm
table.py94080644editdlrm
table.pyc205930644editdlrm
teletype.py51810644editdlrm
teletype.pyc44600644editdlrm
text.py172150644editdlrm
text.pyc391260644editdlrm
thumbnail.py317360755editdlrm
thumbnail.pyc318640644editdlrm
userfield.py53940755editdlrm
userfield.pyc51590644editdlrm
xforms.py12330644editdlrm
xforms.pyc8730644editdlrm
__init__.py00644editdlrm
__init__.pyc1480644editdlrm
Edit: /usr/lib/python2.6/site-packages/tablib/packages/odf3/opendocument.pyc (25530B)
}DVc@sdZddkZddkZddkZddkZddkZddklZddkTddk l Z l Z ddk Tddk l Z ddklZdd klZdd klZeZd Zd d >ZdZdZeiddjpthdd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6Zd0fd1YZd2fd3YZd4Zd5Z d6Z!d7Z"d8Z#d9Z$d:Z%d;Z&d<Z'dS(=s,Use OpenDocument to generate your documents.iN(tStringIOi(t*(tmanifesttmeta(telement(t make_NCName(t InputSource(t manifestlists' iiiis.odts'application/vnd.oasis.opendocument.texts.otts0application/vnd.oasis.opendocument.text-templates.odgs+application/vnd.oasis.opendocument.graphicss.otgs4application/vnd.oasis.opendocument.graphics-templates.odps/application/vnd.oasis.opendocument.presentations.otps8application/vnd.oasis.opendocument.presentation-templates.odss.application/vnd.oasis.opendocument.spreadsheets.otss7application/vnd.oasis.opendocument.spreadsheet-templates.odcs(application/vnd.oasis.opendocument.charts.otcs1application/vnd.oasis.opendocument.chart-templates.odis(application/vnd.oasis.opendocument.images.otis1application/vnd.oasis.opendocument.image-templates.odfs*application/vnd.oasis.opendocument.formulas.otfs3application/vnd.oasis.opendocument.formula-templates.odms.application/vnd.oasis.opendocument.text-masters.oths+application/vnd.oasis.opendocument.text-webt OpaqueObjectcBseZddZRS(cCs||_||_||_dS(N(t mediatypetfilenametcontent(tselfR R R ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt__init__Ds  N(t__name__t __module__tNoneR (((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRCst OpenDocumentcBsFeZdZd!ZedZd!dZdZdZ dZ ddZ dZ d Z d Zd Zd Zd ZdZdZd!d!dZd!dZdZd!dZd!dZdZdZedZdZdZdZdZ dZ!dZ"dZ#dZ$d Z%RS("s A class to hold the content of an OpenDocument document Use the xml method to write the XML source to the screen or to a file d = OpenDocument(mimetype) fd.write(d.xml()) cCs{||_g|_g|_d|_td|i|_||i_|ih|_t |_ |ii |i |o |i i t i dt nt|_|ii |it|_|ii |it|_|ii |it|_|ii |it|_|ii |it|_|ii |it|_|ii |idS(Nttmimetypettext(Rt childobjectst_extratfoldertDocumentttopnodet ownerDocumentt clear_cachestPicturestMetaRt addElementt Generatort TOOLSVERSIONtScriptstscriptst FontFaceDeclst fontfacedeclstSettingstsettingstStyleststylestAutomaticStylestautomaticstylest MasterStylest masterstylestBodytbody(R Rt add_generator((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyR Rs4                cCsf|djo |i}n|i|x8|iD]-}|itiijo|i|q1q1WdS(N( RRt build_cachest childNodestnodeTypeRtNodet ELEMENT_NODEtrebuild_caches(R tnodete((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyR5ps   cCsh|_h|_h|_dS(N(t element_dictt _styles_dictt_styles_ooo_fix(R ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRws  cCs|i|ijog|i|iRt parentNodeR<tOFFICENSR9R:RB(R RRDtnewname((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt__register_stylenames %  RcCskt}|it|iid||p |iSt|d}|i|i|idS(Nitw(Rtwritet _XMLPROLOGUER.ttoXmltgetvaluetfiletclose(R R txmltf((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRMs   cCs=|it}|it|iid||iS(sq Generates the full document as an XML file Always written as a bytestream in UTF-8 encoding i(t_OpenDocument__replaceGeneratorRRKRLRRMRN(R RQ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRQs    cCs<t}|itt}|id||iio|iid|n|iio|iid|nt }|i |i |i |i g}t|djoE|id|x|D]}|id|qW|id|n|id||i id||id||iS(se Generates the content.xml file Always written as a bytestream in UTF-8 encoding iii(RRKRLtDocumentContenttwrite_open_tagR"t hasChildNodesRMR$R)t_used_auto_stylesR(R*R.tlentwrite_close_tagRN(R RQtxtat stylelistts((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt contentxmls(    !cCs3t}|it|iid||iS(sx Generates the manifest.xml file The self.manifest isn't avaible unless the document is being saved i(RRKRLRRMRN(R RQ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt __manifestxmls  cCsS|it}|i|it}|it|id||iS(s Generates the meta.xml file i( RSt DocumentMetaRRRRKRLRMRN(R RZRQ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pytmetaxmls    cCsIt}|i|it}|it|id||iS(s! Generates the settings.xml file i(tDocumentSettingsRR&RRKRLRMRN(R RZRQ((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt settingsxmls    c Csx|iD]}|itiijoxtdftdftdftdftdftdftdftdftdft dff D]]}|i |d|do<|i |d|d}||jo|i |qqqW|i ||}q q W|S( s Finds references to style objects in master-styles and add the style name to the style list if not already there. Recursive s style-namestext-style-namesdata-style-nameslist-style-namespage-layout-namesdefault-cell-style-nameii( R1R2RR3R4tDRAWNStPRESENTATIONNSR>tTABLENSRAR@R=t_parseoneelement(R ttopt stylenamelistR7RCt stylename((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRgs(            cCstg}x |D]}|i||}q Wg}x>|iiD]0}|itd|jo|i|q<q<W|S(s Loop through the masterstyles elements, and find the automatic styles that are used. These will be added to the automatic-styles element in styles.xml RD(RgR*R1R@R>R=(R tsegmentsRiRhR\R7((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyRWs cCst}|itt}|id||iio|iid|n|iid|t }|id|x-|i |i gD]}|id|qW|i d||i io|i id|n|i d||i S(s Generates the styles.xml file iii(RRKRLtDocumentStylesRUR$RVRMR(R)RWR,RYRN(R RQRZR[R]((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt stylesxml s"    cCs|djo|djoti|\}}n|djo1d}y||id}Wqd}qXnti|}dtid|f}t||f|i|s  c Csddkl}ddkl}l}x|d|d|d|dfD]}||joqIny|i|}||_|} | i|id| i ||| i |i t } | i t|| i| |`WqItj o } qIXqIWdS( Ni(t LoadParseri(t make_parserthandlers settings.xmlsmeta.xmls content.xmls styles.xml(tloadRtxml.saxRRtreadt_parsingt setFeaturetfeature_namespacestsetContentHandlertsetErrorHandlert ErrorHandlerRt setByteStreamRtparsetKeyError( tzRRt objectpathRRRtxmlfiletxmlparttparsertinpsrctv((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyt__loadxmlpartsEs&#      c Csti|}|id}t|dt}|id}t|}t|||dxt|iD]\}}|d djo;t |djo(|i |d|d|i|qq|d jo|i |i|qq|d!joqq|d djoit |djoV|ddjoEt|ddt}|i |d|d t||||qq|d djoqq|dddjo(|i it|d|dd"qq|i it|d|d|i|qqW|i|it} |d djo| di|_n|d djo| di|_n|d djo| di|_n|d djo| di|_np|d djo| di|_nK|d djo| di|_n&|d d jo| di|_n|S(#sO Load an ODF file into memory Returns a reference to the structure RR/sMETA-INF/manifest.xmlRi s Pictures/s full-paths media-typesThumbnails/thumbnail.pngs settings.xmlsmeta.xmls content.xmls styles.xmlisObject i iRi's'application/vnd.oasis.opendocument.textii+s+application/vnd.oasis.opendocument.graphicsi/s/application/vnd.oasis.opendocument.presentationi.s.application/vnd.oasis.opendocument.spreadsheeti(s(application/vnd.oasis.opendocument.charts(application/vnd.oasis.opendocument.imagei*s*application/vnd.oasis.opendocument.formula(s settings.xmlsmeta.xmls content.xmls styles.xmlN(RRRRRRRRRRXRyRRRR=RRRPRR-t firstChildRtgraphicsRRRRtformula( todffileRRRt manifestpartRtmentrytmvaluetsubdoctb((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pyR[sP  $(  5(1 ((RRRsRRotcopytioRt namespacesRRRtofficeRtattrconvertersRtxml.sax.xmlreaderRt odfmanifestRR t __version__RLRRtRut version_infotAssertionErrorRRRRRRRRRRRR(((sA/tmp/pip-build-lt8jXN/tablib/tablib/packages/odf3/opendocument.pytsX<