Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyc

�
��ZYc@sQdZdZdZddlZddlZddlZddlZddlZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZyddlZWnek
r�nXddlmZmZmZmZmZddlmZddlmZej�Zd	Zyed
��Wn�ek
r�Zyddl m!Z"dZWnUek
r�Zyddl#m!Z"dZWn%ek
r�Zd
Z$ee$��nXnXnXy2ddl%Z%ddl&Z%ddl'm(Z(m)Z)Wnee*fk
rZ+e,Z%nXyddl-Z.WnZek
r�y/ddl/Z/de0fd��YZ.e/e._/Wnek
r�e,Z.nXnXedkr�ddl1Z1e1j2�Z3e4e"j5e6�r�e"j5Z7n	e"j7Z7de7fd��YZ8nej9d�Z:ej9d�Z;ej9d�Z<ej9d�Z=dZ>de>Z?dddddfZ@dZAdZBid d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36eBd46d5d66d7d86d9d:6d;d<6d=d>6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6dMdN6ZCZDid d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36eBd46d;d<6d5d66d7d86d9d:6d=d>6d?d@6dAdB6dCdD6dEdF6dIdJ6ZEZFidOdP6ZGZHid"d#6d0d16eBd46d5d66dIdJ6ZIZJid dQ6d"dR6d$dS6d&dT6d(dU6d*dV6d,dW6d.dX6d0dY6d2dZ6eBd[6d;d\6d5d]6d7d^6d9d_6d=d`6d?da6dAdb6dCdc6dEdd6dGde6dIdf6dKdg6dMdh6ZKid dQ6d"dR6d$dS6d&dT6d(dU6d*dV6d,dW6d.dX6d0dY6d2dZ6eBd[6d;d\6d5d]6d7d^6d9d_6d=d`6d?da6dAdb6dCdc6dEdd6dIdf6ZLidOdi6ZMid"dR6d0dY6eBd[6d5d]6dIdf6ZNe,e,eDdj�Z5e,e,eDdk�ZOdl�ZPeDdm�ZQdn�ZRdo�ZSej9dp�ZTdq�ZUdre0fds��YZVeVddt�ZWdue0fdv��YZXdwejYfdx��YZYdyejZfdz��YZ[d{ej\fd|��YZ\dS(}s%
Open Document Format (ODF) Writer.

s1.0atreStructuredTexti����N(tminidom(tfrontendtnodestutilstwriterst	languages(t
standalone(t
referencests
Ignoring lxml(tElementTreetelementtreesmMust install either a version of Python containing ElementTree (Python version >=2.5) or install ElementTree.(tOdtPygmentsProgFormattertOdtPygmentsLaTeXFormattertPILcBseZRS((t__name__t
__module__(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRLst_ElementInterfaceWrappercBs&eZdd�Zd�Zd�ZRS(cCs!tj|||�dt|<dS(N(t_ElementInterfacet__init__tNonet_parents(tselfttagtattrib((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRhscCs|t|<dS(N(R(Rtparent((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	setparentkscCst|S(N(R(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	getparentmsN(RRRRRR(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRgs	s( +)s(\t+)s^ +s {2,}srststyle-table-s%s0tborders
border-topsborder-leftsborder-rights
border-bottomsDocutils.org/odf_odts0urn:oasis:names:tc:opendocument:xmlns:office:1.0s/urn:oasis:names:tc:opendocument:xmlns:chart:1.0tcharts http://purl.org/dc/elements/1.1/tdcs!http://www.w3.org/2001/xml-eventstdoms.urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0tdr3ds1urn:oasis:names:tc:opendocument:xmlns:drawing:1.0tdraws;urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0tfos.urn:oasis:names:tc:opendocument:xmlns:form:1.0tforms"http://www.w3.org/1998/Math/MathMLtmaths.urn:oasis:names:tc:opendocument:xmlns:meta:1.0tmetas3urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0tnumbertoffices!http://openoffice.org/2004/officetoooshttp://openoffice.org/2004/calctooocs!http://openoffice.org/2004/writertooows6urn:oasis:names:tc:opendocument:xmlns:presentation:1.0tpresentations0urn:oasis:names:tc:opendocument:xmlns:script:1.0tscripts/urn:oasis:names:tc:opendocument:xmlns:style:1.0tstyles8urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0tsvgs/urn:oasis:names:tc:opendocument:xmlns:table:1.0ttables.urn:oasis:names:tc:opendocument:xmlns:text:1.0ttextshttp://www.w3.org/2002/xformstxformsshttp://www.w3.org/1999/xlinktxlinks http://www.w3.org/2001/XMLSchematxsds)http://www.w3.org/2001/XMLSchema-instancetxsis2urn:oasis:names:tc:opendocument:xmlns:manifest:1.0tmanifestsxmlns:chartsxmlns:dcs	xmlns:doms
xmlns:dr3ds
xmlns:drawsxmlns:fos
xmlns:forms
xmlns:maths
xmlns:metasxmlns:numbersxmlns:officesxmlns:presentations	xmlns:ooos
xmlns:ooocs
xmlns:ooowsxmlns:scriptsxmlns:styles	xmlns:svgsxmlns:tables
xmlns:textsxmlns:xformssxmlns:xlinks	xmlns:xsds	xmlns:xsisxmlns:manifestcCsg|dkri}nt|||�\}}tdkrTtj||d|�}nt||�}|S(Ntlxmltnsmap(Rtfix_nstWhichElementTreetetreetElementR(RRR7tnsdicttel((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR;s	cCs�|dkri}nt|||�\}}tdkrWtj|||d|�}n)t||�}|j|�|j|�|S(NR6R7(RR8R9R:t
SubElementRtappendR(RRRR7R<R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR>s	

cCsUt||�}i}x3|j�D]%\}}t||�}|||<q"W||fS(N(tadd_nst	iteritems(RRR<tnstagtnsattribtkeytvaltnskey((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR8+scCsctdkr_|jd�\}}|j|�}|dkrLtd|�nd||f}n|S(NR6t:sInvalid namespace prefix: %ss{%s}%s(R9tsplittgetRtRuntimeError(RR<RBtnametns((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR@3scCsXtj�}tjdkr1|j|dd�n
|j|�|j�}|j�|S(Niitencodingtunicode(ii(tStringIOtsystversion_infotwritetgetvaluetclose(tett	outstreamts1((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytToString<s

cCs�|jdd�}|jdd�}|jdd�}d}xJ|D]B}t|�td�kr{|d	t|�f7}qC||7}qCW|S(
Nt&s&amp;t<s&lt;t>s&gt;R	ss&#x%X;(treplacetord(R0tasciitchar((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytescape_cdataGs
s\b(\w*)\b\W*cCsz|d7}g}d}tj||�}xK|dk	ru|j�d}|j|�|j�}tj||�}q+W|S(Nt i(tWORD_SPLIT_PAT1tsearchRtgroupsR?tend(tlinetwordstpos1tmotword((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytsplit_wordsWs

t
TableStylecBsYeZddd�Zd�Zd�Zeee�Zd�Zd�Z	eee	�Z
RS(cCs||_||_dS(N(Rtbackgroundcolor(RRRm((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRks	cCs|jS(N(tborder_(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_border_nscCs
||_dS(N(Rn(RR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytset_border_pscCs|jS(N(tbackgroundcolor_(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_backgroundcolor_sscCs
||_dS(N(Rq(RRm((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytset_backgroundcolor_usN(RRRRRoRptpropertyRRrRsRm(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRljs				s0.0007in solid #000000t	ListLevelcBsMeZeed�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cCs||_||_||_dS(N(tlevelt
sibling_leveltnested_level(RRvRwRx((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�s		cCs
||_dS(N(Rw(RRw((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytset_sibling�R	cCs|jS(N(Rw(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_sibling�R	cCs
||_dS(N(Rx(RRx((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
set_nested�R	cCs|jS(N(Rx(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
get_nested�R	cCs
||_dS(N(Rv(RRv((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	set_level�R	cCs|jS(N(Rv(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	get_level�R	(
RRtTrueRRyRzR{R|R}R~(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRus					tWritercBseZdZdZdLZdeZejej	j
ej�d�ej	j
ej	je
�e��ZdZejej	j
ej�d�ej	j
ej	je
�e��ZddMdedgied	6d
d6fdd
gidd6fddgied	6dd6dd6ejd6fddgied	6dd6dd6ejd6fddgidMd	6ejd6fddgied	6dd6dd6ejd6fddgied	6dd6dd6ejd6fd d!gied	6dd6d"d6ejd6fd#d$gied	6dd6d"d6ejd6fd%d&gied	6dd6d'd6ejd6fd(d)gied	6dd6d'd6ejd6fd*d+gied	6dd6d,d6ejd6fd-d.gied	6dd6d,d6ejd6fd/d0gied	6dd6d1d6ejd6fd2d3gied	6dd6d1d6ejd6fd4d5gid6d	6d7d6fd8d9gid6d	6d:d6fffZid;d<6ZdNZd>ZdOZd@�ZdA�ZdB�ZdC�Ze j!dD�Z"dE�Z#dF�Z$dG�Z%dH�Z&dI�Z'dJ�Z(dK�Z)RS(Ps'application/vnd.oasis.opendocument.texts.odttodttstylestdummystemplate.txtsODF-Specific Optionss$Specify a stylesheet.  Default: "%s"s--stylesheettdefaultt
stylesheettdests}Specify a configuration/mapping file relative to the current working directory for additional ODF options.  In particular, this file may contain a section named "Formats" that maps default style names to names to be used in the resulting output file allowing for adhering to external standards. For more info and the format of the configuration/mapping file, see the odtwriter doc.s--odf-config-files<file>tmetavarsyObfuscate email addresses to confuse harvesters while still keeping email links usable with standards-compliant browsers.s--cloak-email-addressest
store_truetactiontcloak_email_addressest	validators!Do not obfuscate email addresses.s--no-cloak-email-addresseststore_falsesLSpecify the thickness of table borders in thousands of a cm.  Default is 35.s--table-border-thicknesss/Add syntax highlighting in literal code blocks.s--add-syntax-highlightingtadd_syntax_highlightings@Do not add syntax highlighting in literal code blocks. (default)s--no-syntax-highlightings'Create sections for headers.  (default)s--create-sectionstcreate_sectionss#Do not create sections for headers.s
--no-sectionss
Create links.s--create-linkstcreate_linkssDo not create links.  (default)s
--no-linkssFGenerate endnotes at end of document, not footnotes at bottom of page.s--endnotes-end-doctendnotes_end_docsPGenerate footnotes at bottom of page, not endnotes at end of document. (default)s--no-endnotes-end-docsPGenerate a bullet list table of contents, not an ODF/oowriter table of contents.s--generate-list-toctgenerate_oowriter_tocsHGenerate an ODF/oowriter table of contents, not a bullet list. (default)s--generate-oowriter-tocs�Specify the contents of an custom header line.  See odf_odt writer documentation for details about special field character sequences.s--custom-odt-headerR	t
custom_headers�Specify the contents of an custom footer line.  See odf_odt writer documentation for details about special field character sequences.s--custom-odt-footert
custom_footertxmlcharrefreplacetoutput_encoding_error_handlertstylesheet_pathsodf_odt writerRcCstjj|�t|_dS(N(RR�Rt
ODFTranslatorttranslator_class(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR&scCsu|jj|_|j|j�|_|jj|j�|jj|j�|jj�|j�|j	d|_
dS(Ntwhole(tdocumenttsettingsR�tvisitortretrieve_stylest	EXTENSIONt	walkaboutt
add_doc_titletassemble_my_partstpartstoutput(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	translate*s

cCs�tjj|�tj�}tj|dtj�}|j|d|j	dtj
�|jj�}|j|d|�|j
�}|j|d|�|j�}|j|d|�|j�}d}d}|jjr	|jjjdd�}|jd�}|d	j�}xV|d
D]J}t|�dkrM|j�rM|j�}Pqt|�d
krPqqW|dkr	ytj|�}	Wntk
r�|}	nX|	jd�}	t|	�d
kr�|	d
jd�}	|	d	}n|dkr|jjjd
�qq	n|j|jj�||�\}
}}|
rHt j!|�}n|j|d|�|j"|�|j#|�|j$�|j%d	�|j&�}
|j$�|
|j'd<|jj(j)|j'd<t*j+|j'd<dS(sEAssemble the `self.parts` dictionary.  Extend in subclasses.
        twtmimetypet
compress_typescontent.xmlsMETA-INF/manifest.xmlsmeta.xmlt_t-iiit.s�invalid language-region.
  Could not find region with locale.normalize().
  Please specify both language and region (ll-RR).
  Examples: es-MX (Spanish, Mexico),
  en-AU (English, Australia).s
styles.xmlR�RMtversionN(,RR�tassemble_partsttempfiletNamedTemporaryFiletzipfiletZipFiletZIP_DEFLATEDt
write_zip_strt	MIME_TYPEt
ZIP_STOREDR�tcontent_astexttcreate_manifesttcreate_metatget_stylesheetRt
language_codeR\RHtlowertlentisalphatuppertlocalet	normalizet	NameErrorR�treportertwarningtupdate_stylesheettget_dom_stylesheetR:ttostringtstore_embedded_filestcopy_from_stylesheetRTtseektreadR�R�toutput_encodingtdocutilst__version__(RtftzfiletcontentRWR�tregion_codetlanguage_idstsubtagtrcodetupdatedtnew_dom_stylestupdated_nodeR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�3sd



	!





cCset}t�}|dk	s'|dk	rX|jd�}|dkrQtd��n|jd�}|sutd��nx�|D]�}|jjd�}	|	dks�|	dkr||jd�}
|
dkr�td	��n|dk	r||
jd
<||
jd<t}|j	|
�n|dk	rQ||
jd<||
jd
<t}|j	|
�qQq|q|Wn|||fS(s@Update xml style sheet element with language and region/country.s8{urn:oasis:names:tc:opendocument:xmlns:office:1.0}styless5Cannot find 'styles' element in styles.odt/styles.xmls>{urn:oasis:names:tc:opendocument:xmlns:style:1.0}default-styles1Cannot find 'default-style' element in styles.xmls7{urn:oasis:names:tc:opendocument:xmlns:style:1.0}familyt	paragraphtgraphics@{urn:oasis:names:tc:opendocument:xmlns:style:1.0}text-propertiess3Cannot find 'text-properties' element in styles.xmlsE{urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0}languagesA{urn:oasis:names:tc:opendocument:xmlns:style:1.0}language-complexsD{urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0}countrys@{urn:oasis:names:tc:opendocument:xmlns:style:1.0}country-complexN(
tFalsetsetRtfindRJtfindallRRIRtadd(Rtstylesheet_rootR�R�R�tmodified_nodestn1tn2_nodestnodetfamilytn3((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�wsB			
			



cCsMtjtj��}tj||�}d|_||_|j||�dS(Ni��i��li��lH(ttimet	localtimeR�tZipInfot
external_attrR�twritestr(RR�RKtbytesR�R�tzinfo((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s
		cCs�|jj�}xj|D]b\}}|dkr4qny|j||�Wqtk
rw}|jjjd|f�qXqWdS(NsCan't open file %s.(R�tget_embedded_file_listRRRtOSErrorR�R�R�(RR�tembedded_filestsourcetdestinationte((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��scCs;|jj}tj|d�}|jd�}|j�|S(s.
        modeled after get_stylesheet
        trssettings.xml(R�R�R�R�R�RT(Rt
stylespathR�RW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_settings�s

cCs|jj�}|S(sXGet the stylesheet from the visitor.
        Ask the visitor to setup the page.
        (R�t
setup_page(RRW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��scCs�|jj}tj|d�}|jd�}|j|d|�|j�}x?|D]7}|jd�rS|j|�}|j||�qSqSW|j	�dS(sLCopy images, settings, etc from the stylesheet doc into target doc.
        R�ssettings.xmls	Pictures/N(
R�R�R�R�R�R�tnamelistt
startswithR�RT(Rt
outzipfileR�t	inzipfileRWR�RKtimageobj((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s
cCsdS(N((R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��scCsBtdkr'tddtdt�}ntddtdt�}tj|�}t|ddi|jd6dd	6dt�t|ddid
d6dd	6dt�t|ddid
d6dd	6dt�t|ddid
d6d
d	6dt�t|ddid
d6dd	6dt�t	|�}t
j|�}|jd�}|S(NR6smanifest:manifestR7R<Rsmanifest:file-entrysmanifest:media-typet/smanifest:full-pathstext/xmlscontent.xmls
styles.xmlssettings.xmlsmeta.xmls  (
R9R;tMANIFEST_NAMESPACE_DICTtMANIFEST_NAMESPACE_ATTRIBR:R
R>R�tMANNSDRXRtparseStringttoprettyxml(RtroottdocRW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s@			





cCsztdkr'tddtdt�}ntddtdt�}tj|�}t|ddt�}t|ddt�}dtf|_	t
jjd	d
�}t|ddt�}||_	t
jdt
j��}t|d
dt�}||_	t|ddt�}||_	t|ddt�}||_	t|ddt�}d|_	t|ddt�}d|_	t|ddt�}d|_	|jj�}t|ddt�}|r�||_	n	d|_	|jj�}|jd�}|dk	r.t|�}	x/|	D]$}
t|ddt�}|
|_	qWn|jd�}|dk	rjt|ddt�}||_	nt|�}|S(NR6soffice:document-metaR7R<Rsoffice:metasmeta:generatorsDocutils/rst2odf.py/%stUSERR	smeta:initial-creators%Y-%m-%dT%H:%M:%Ssmeta:creation-dates
dc:creatorsdc:datesdc:languagesen-USsmeta:editing-cyclest1smeta:editing-durationtPT00M01Ssdc:titles
[no title]tkeywordssmeta:keywordtdescriptionsdc:description(R9R;tMETA_NAMESPACE_DICTtMETA_NAMESPACE_ATTRIBR:R
R>tMETNSDtVERSIONR0tostenvironRIR�tstrftimeR�R�t	get_titlet
get_meta_dictRRkRX(RRRtel1RWts2ttitlet	meta_dictt
keywordstrRtkeywordR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�sZ											
(R�N(R�(R(*RRR�R�t	supportedtdefault_stylesheetRt
relative_pathRtpathtjointgetcwdtdirnamet__file__tdefault_stylesheet_pathtdefault_templatetdefault_template_pathRR�Rtvalidate_booleantvalidate_nonnegative_intRt
settings_spectsettings_defaultstrelative_path_settingstconfig_sectiontconfig_section_dependenciesRR�R�R�R�R�R�R�R�R�R�R�R�R�(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s�
$$
	






























				D	3		
				%R�c[Bs�eZdRZd[�Zd\�Zd]�Zd^�Zd_�Zd`�Zda�Z	db�Z
dSdc�Zdd�Zde�Z
df�Zdg�Zdh�Zedi�\ZZZejdj�Zdk�Zdl�Zdm�Zdn�Zdo�Zdp�Zdq�Zdr�Zds�Z dt�Z!du�Z"dTdTdv�Z$dTdw�Z%dx�Z&dy�Z'dz�Z(d{�Z)d|�Z*d}�Z+d~�Z,d�Z-d��Z.d��Z/d��Z0d��Z1d��Z2d��Z3d��Z4d��Z5d��Z6d��Z7d��Z8d��Z9d��Z:d��Z;d��Z<d��Z=d��Z>d��Z?d��Z@d��ZAd��ZBd��ZCd��ZDd��ZEd��ZFd��ZGd��ZHd��ZId��ZJd��ZKd��ZLd��ZMd��ZNd��ZOd��ZPd��ZQd��ZRd��ZSd��ZTd��ZUd��ZVd��ZWd��ZXd��ZYd��ZZd��Z[d��Z\d��Z]d��Z^d��Z_d��Z`d��Zad��Zbd��Zcd��Zdd��Zed��Zfd��Zgd��Zhd��Zid��Zjd��Zkd��Zld��Zmd��Znd��Zod��Zpd��Zqd��Zrd��Zsd��Ztd��Zud��Zvd��Zwd��Zxd��Zyd�d�d�d�d�d�d�d�d�g	Zzd��Z{d��Z|d��Z}d��Z~d��Zd��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�dTd��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�e�Z�e�Z�d��Z�d��Z�d��Z�d��Z�d��Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d	�Z�d
�Z�d�Z�d�Z�d
�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d�Z�dd�Z�d�Z�d�Z�d�Z�d�Z�d�Z�d �Z�d!�Z�d"�Z�d#�Z�d$�Z�d%�Z�d&�Z�d'�Z�d(�Z�d)�Z�d*�Z�d+�Z�d,�Z�d-�Z�d.�Z�d/�Z�d0�Z�d1�Z�d2�Z�dd0d3�Z�d4�Z�dd5�Z�d6�Z�d7�Z�d8�Z�d9�Z�d:�Z�d;�Z�d<�Z�d=�Z�d>�Z�d?�Z�d@�Z�dA�Z�dB�Z�dC�Z�dD�Z�e�Z�dE�Z�e�Z�dF�Z�e�Z�dG�Z�e�Z�dH�Z�e�Z�dI�Z�e�Z�dJ�Z�e�Z�dK�Z�e�Z�dL�Z�e�Z�dTdM�Z�dN�Z�dO�Z�dP�ZdQ�ZRS(Utattributiontblockindentt
blockquotesblockquote-bulletitemsblockquote-bulletlistsblockquote-enumitemsblockquote-enumlistt
bulletitemt
bulletlisttcaptiontlegendtcenteredtextbodyt	codeblockscodeblock-indentedscodeblock-classnamescodeblock-commentscodeblock-functionnamescodeblock-keywordscodeblock-namescodeblock-numberscodeblock-operatorscodeblock-stringtemphasistenumitemtenumlisttepigraphsepigraph-bulletitemsepigraph-bulletlistsepigraph-enumitemsepigraph-enumlisttfootertfootnotetcitationtheadert
highlightsshighlights-bulletitemshighlights-bulletlistshighlights-enumitemshighlights-enumlistthorizontallinet
inlineliteralt	quotationtrubrictstrongstable-titlettextbodyt
tocbulletlistttocenumlistRtsubtitletheading1theading2theading3theading4theading5theading6theading7sadmon-attention-hdrsadmon-attention-bodysadmon-caution-hdrsadmon-caution-bodysadmon-danger-hdrsadmon-danger-bodysadmon-error-hdrsadmon-error-bodysadmon-generic-hdrsadmon-generic-bodysadmon-hint-hdrsadmon-hint-bodysadmon-important-hdrsadmon-important-bodysadmon-note-hdrsadmon-note-bodys
admon-tip-hdrsadmon-tip-bodysadmon-warning-hdrsadmon-warning-bodyttableoptionstableoption.%cstableoption.%c%dsTable%ds
Table%d.%csTable%d.%c%dt
lineblock1t
lineblock2t
lineblock3t
lineblock4t
lineblock5t
lineblock6timagetfigureframecCsftjj||�|j|_|jj|_tj|j|j�|_i|_	|jj
rddlm}|�}|j|jj
�xw|j
d�D]c\}}||jkr�|jjjd|f�ntjjdkr�|jd�|j	|<q�q�Wnd|_d|_tdkr7td	d
t�}ntd	dt�}tjd|�|_||_t|d
�t|d�t|d�}||_ t|d�}|j!|�}||_||_"|j#d�g|_$g|_%d|_&t'd�d|_(d|_)t*|_+d|_-d|_.d|_/d|_0d|_1i|_2g|_3d|_4d|_5g|_6g|_7t*|_8t*|_9d|_:t*|_;d|_<d|_=d|_>i|_?g|_@d|_Ad|_Bg|_Ct*|_Dt*|_Eg|_Fi|_Gd|_Hd|_Id|_Jd|_Kd|_Ld|_Md|_Nd|_Ot*|_Pg|_QdS(Ni����(tConfigParsertFormatss,Style "%s" is not a style used by odtwriter.isutf-8iR6soffice:document-contentR7Rtelementsoffice:scriptssoffice:font-face-declssoffice:automatic-stylessoffice:bodyR@tAitpythonR	(RRtGenericNodeVisitorRR�R�Rtget_languageR�tlanguaget
format_maptodf_config_fileRTR�titemstused_stylesR�R�RPRQtmajortdecodet
section_levelt
section_countR9R;tCONTENT_NAMESPACE_DICTtCONTENT_NAMESPACE_ATTRIBR:R
tcontent_treetcurrent_elementR>tautomatic_stylestgenerate_content_elementtbody_text_elementtrststyletparagraph_style_stacktlist_style_stackttable_countR]tcolumn_countttrace_levelR�toptiontablestyles_generatedRt
field_namet
field_elementRtimage_counttimage_style_countt
image_dicttembedded_file_listtsyntaxhighlightingtsyntaxhighlight_lexertheader_contenttfooter_contentt	in_headert	in_footert
blockstyletin_table_of_contentsttable_of_content_index_bodyt
list_leveltdef_list_leveltfootnote_ref_dictt
footnote_listtfootnote_chars_idxtfootnote_leveltpending_idstin_paragraphtfound_doc_titletbumped_list_level_stackRtline_block_leveltline_indent_leveltcitation_idtstyle_indextstr_stylesheettstr_stylesheetcontenttdom_stylesheetttable_stylestin_citationtinline_style_count_stack(RR�RTtparserRktformatRR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRxs�		 				

																																											cCs|jS(N(R�(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_str_stylesheet�scCs
d}|jj}tjj|�d}|dkr\t|d�}|j�}|j�n\||kr�t	j
|d�}|jd�}|jd�}|j�ntd||f�||_||_
tj|j�|_tj|j
�|_|j|�|_dS(s|Retrieve the stylesheet from either a .xml file or from
        a .odt (zip) file.  Return the content as a string.
        is.xmlR�s
styles.xmlscontent.xmls,stylesheet path (%s) must be %s or .xml fileN(RR�R�RRtsplitexttopenR�RTR�R�RJR�R�R:t
fromstringR�tdom_stylesheetcontenttextract_table_stylesR�(Rt	extensionRR�textt
stylesfileRWR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s$

		c
Cs�tj|�}i}|jdtdf�}xa|D]Y}|jdtdf�}|jd�d}|jdtdf�}|jt�r6|j|�}	|	dkr�t	�}	|	||<n|dkr-|jd	tdf�}
|
jd
tddf�}|dk	r�|d
kr�||	_
q�q�|dkr�|jdtdf�}
|
dk	r�|j|
�}|dk	r�||	_q�q�q�q6q6W|S(Ns{%s}automatic-stylesR's{%s}nameR-R�is
{%s}familyR/s{%s}table-propertiess{%s}%sR"sbackground-colortnones
table-cells{%s}table-cell-properties(
R:R�R�tCNSDRIRHR�tTABLESTYLEPREFIXRRlRmtget_propertyR(
Rt
styles_strRR�tauto_stylest	stylenodeRKt	tablenameR�t
tablestylet
propertiesRtR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s8
	

cCsTd}xGtD]?}|jdtd|f�}|dk	r
|dkr
|Sq
W|S(Ns{%s}%sR"R�(RtTABLEPROPERTYNAMESRIR�(RR�Rtpropertyname((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�s
cCs�|jj}|rh||_|jshtddi|jd�d6�}||_|jjd|�qhn|j|j�}|dk	r�|j
|�ndS(Nstext:pRRstext:style-namei(R�RR�R;RkR0Rjtinserttfind_first_text_pRtattach_page_style(RR0R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�s			cCsp|jdks|jdkr"|S|j�rhx3|j�D]%}|j|�}|dk	r;|Sq;WdSdSdS(sHSearch the generated doc and return the first <text:p> element.
        stext:pstext:hN(RtgetchildrenR�R(RR=tchildR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�!scCsu|jd�}d}t|jddi|d6dd6dd	6d
t�}|ra|jd|�n|jd|�dS(
s�Attach the default page style.

        Create an automatic-style that refers to the current style
        of this element and that refers to the default page style.
        stext:style-nametP1003sstyle:styleRs
style:namesrststyle-pagedefaultsstyle:master-page-nameR�sstyle:familyR<sstyle:parent-style-nameN(RIR>RhtSNSDR�(RR=t
current_stylet
style_nameR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�2s
	cCs'||}|jj|d|�}|S(s�
        Returns the style name to use for the given style.

        If `parameters` is given `name` must contain a matching number of
        ``%`` and is used as a format expression with `parameters` as
        the value.
        srststyle-%s(R\RI(RRKt
parameterstname1t	stylename((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRkDs
cCs
t|d�S(Nsoffice:text(R>(RR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRiPscCs{|j|j�t|j�dksRt|j�dksR|jjsR|jjre|j|j�nt	j
|j�}|S(Ni(tsetup_paperR�R�RzR{R�R�R�tadd_header_footerR:R�(Rtnew_content((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�Ss*cCs|jS(N(R�(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�[scswy>tjd�}tt|j�j��\��|j�Wnd\��nX���fd���|�dS(Nspaperconf -s 2> /dev/nullidics�|jdtdkr�|jjdtd�r�d�|jdtd<d�|jdtd<dd�|jdtd<|jd	td<dd�|jd
td<|jdtd<n!x|j�D]}�|�q�WdS(Ns{%s}page-layout-propertiesR-s{%s}page-widthR"s%.3fpts{%s}page-heightg�������?s{%s}margin-lefts{%s}margin-rights{%s}margin-tops{%s}margin-bottom(RR�Rthas_keyR�(R=tsubel(thR�twalk(sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�es03(idi(RtpopentmaptfloatR�RHRT(Rtroot_eltfin((R�R�R�sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�^s!
c
Csm|jdtd�}dtf}|j|�}|dkrCdSdtdf}|j|�}d}dtdf}|jd�}x-|D]%}|j|�|kr�|}Pq�q�W|dkr�dS|}	|js�|jj	r�t
dkrt|	d	d
t�}
nt|	d	dtd
t
�}
xF|jD];}tdd
t�}|jd
�|j|<|
j|�q-W|jj	r�|j|
|jj	d
|�}q�n|js�|jjrit
dkr�t|	dd
t�}
nt|	ddtd
t
�}
xF|jD];}tdd
t�}|jd�|j|<|
j|�q�W|jjri|j|
|jjd|�}qindS(Ns{%s}automatic-stylesR's{%s}master-styless{%s}master-pageR-s{%s}nametpagedefaultR6sstyle:headerR<Rstext:style-nameR9sstyle:footerR6(R�R�tNAME_SPACE_1RR�RkRIRzR�R�R9R>tSTYLES_NAMESPACE_ATTRIBtSTYLES_NAMESPACE_DICTR@RR?tcreate_custom_headfootR{R�(
RR�RhRt	master_eltmaster_el_containert
target_attribttarget_nameR=Rtel2tattrkeytelcustom((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�tsX

				is%(..?)%c
Cst|ddi|j|�d6�}d}|j|�}x�|D]�}|dtjkr�|ddkr�d|df}t|�n|j||d||�}	|	dkr�d|df}t|�q�|	}qA|dkr�|d|_qA|d|_	qAWdS(Nstext:pRstext:style-nameiitptPtt1tt2tt3tt4td1td2td3td4td5tstttasbad field spec: %%%s%%(R�R�R�R�R�R�R�R�R�R�R�R�R�R�(
R>RkRtsplit_field_specifiers_iterR�t
code_fieldRJtmake_field_elementR0ttail(
RRR0R�RhRgt
field_itertitemtmsgR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s*
			cCst
|dkr+t|ddidd6�}nE
|dkrOt|ddi�}n!
|dkr0|jd	7_t|d
di|j|�d6dd
6d|jd6�}t|ddid|jd6tdd6tdd6�}t|ddidd6�}t|d�}d|_t|ddidd6�}n@	|dkrE|jd	7_t|d
di|j|�d6dd
6d|jd6�}t|ddid|jd6tdd6tdd6�}t|ddidd6�}t|d�}d|_t|ddidd6�}t|d�}d|_t|ddidd6�}n+|dkrM|jd	7_t|d
di|j|�d6dd
6d|jd6�}t|ddid|jd6tdd6tdd6�}t|ddidd6�}t|d�}d|_t|ddidd6�}t|d�}d|_t|d �}n#|d!kr�|jd	7_t|d
di|j|�d6dd
6d|jd6�}t|ddid|jd6tdd6tdd6�}t|ddidd6�}t|d�}d|_t|ddidd6�}t|d�}d|_t|ddidd6�}t|d�}d|_t|d �}n�|d"kr�|jd	7_t|d#di|j|�d6d$|jd6�}t|d%did$|jd6dd&6tdd6tdd6�}t|d'didd6�}t|d�}d(|_t|d)didd6�}t|d�}d(|_t|d*�}n�|d+kr�|jd	7_t|d#di|j|�d6d$|jd6�}t|d%did$|jd6dd&6tdd6tdd6�}t|d'didd6�}t|d�}d(|_t|d)didd6�}t|d�}d(|_t|d*didd6�}n�|d,kr�|jd	7_t|d#di|j|�d6d$|jd6�}t|d%did$|jd6dd&6tdd6tdd6�}t|d'didd-6�}t|d�}d|_t|d)di�}t|d�}d.|_t|d*didd6�}n�|d/kr�|jd	7_t|d#di|j|�d6d$|jd6�}t|d%did$|jd6dd&6tdd6tdd6�}t|d'didd-6dd6�}t|d�}d|_t|d)di�}t|d�}d.|_t|d*didd6�}n�|d0kr�	|jd	7_t|d#di|j|�d6d$|jd6�}t|d%did$|jd6tdd6tdd6�}t|d*didd6�}t|d�}d1|_t|d'didd6�}t|d�}d1|_t|d)didd6�}n�|d2kr
t|d3di|j|�d6�}ne|d4kr?
t|d5di|j|�d6�}n1|d6krj
t|d7did8d
6�}nd}|S(9NR�stext:page-numberRtcurrentstext:select-pageR�stext:page-countR�is	text:timestext:style-namettrues
text:fixedsrst-time-style-%dsstyle:data-style-namesnumber:time-styles
style:nameR&sxmlns:numberR-sxmlns:stylesnumber:hourstlongsnumber:stylesnumber:textRGsnumber:minutesR�snumber:secondsR�Rasnumber:am-pmR�R�s	text:datesrst-date-style-%dsnumber:date-stylesnumber:automatic-ordersnumber:monthR�s
number:daysnumber:yearR�R�snumber:textuals, R�R�R�R�stext:subjectR�s
text:titleR�stext:author-nametfalse(R>R�RkR�R0R(RRR0R�RhRR�tel3((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s~
	
	
	
	
	
	
	
	
	
	
	
	
		
		
	
	ccs�d}t|�}x|tr�tjj||�}|r�|j�}||krftj|||!fVntj|jd�fV|j	�}qPqW||}|r�tj|fVndS(Nii(
R�RR�t	field_patRctstartt	code_textR�tgroupRe(RR0Rhtpos_endRitpos2ttrailing((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s	
cCs.|jj�}tj|�}t|�}|S(N(RftgetrootR:R
RX(RRRURW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytastext�scCs
|j�S(N(R�(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��scCs
||_dS(N(R(RR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	set_title�R	cCs|jS(N(R(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�R	cCs
||_dS(N(Rw(RRw((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytset_embedded_file_list�scCs|jS(N(Rw(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��R	cCs|jS(N(R(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�R	cCs�x�|jD]�\}}|jjdg�}t}xp|D]h}|jj|�}|dk	r8|r�t}tj|�}|j	|�q�|j
�}t|�dkr�|d}	|	j}
t
ddt�}|j|d�}|dkr�d}nt
ddt�}
|
|_|jjr!d}nd	}|jj�t
d
dt�}||j|<t
ddt�}||j|<t
ddt�}d
|j|<|
|_q�q8q8Wq
WdS(Ntbackrefsistext:idR<sfootnote-errorR	s
text:note-reftendnoteR7stext:note-classs
text:ref-namestext:reference-formattpage(R�t
attributesRIRR�RR�tcopytdeepcopyR?R�R�R0R@R�RR�R�Rtclear(RR�RR�tfirsttrefR�R�tchildrenR�tref1t	attribkeytid1Rt
note_class((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytprocess_footnotes�s>

				



cCsL|dkr|j}n|dkr6t||�}nt|||�}|S(N(RRgR>(RRRRR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytappend_child�scCsN|jddi|j|�d6�}|j|�|dk	rJ||_n|S(Nstext:pRstext:style-name(RRktappend_pending_idsRR0(RR-R0tresult((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytappend_ps
cCsJ|jjr=x.|jD] }t|ddi|d6�qWng|_dS(Nstext:reference-markRs	text:name(R�R�R�R>(RR=tid((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRs
cCs
||_dS(N(Rg(RR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytset_current_elementscCs|jj�|_dS(N(RgR(R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
set_to_parentscCsgd|jj|f}|jd�}t|ddi|jd�d6�}||_|jd�}|S(Ns%s:R@s	text:spanRR?stext:style-nameR*(R[tlabelsRR>RkR0(RR�tlabelR=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytgenerate_labeled_blocks	cCsgd|jj|f}|jd�}t|ddi|jd�d6�}||_|j�|_|S(Ns%s:R@s	text:spanRR?stext:style-name(R[RRR>RkR0R�R�(RR�RR=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytgenerate_labeled_line&s	cCs|jdd�}|S(Nu Ra(R\(RR0((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytencode/scCs$|j|�tjj||�dS(s9Override to catch basic attributes which many nodes have.N(thandle_basic_attsRRYtdispatch_visit(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR:s
cCs6t|tj�r2|dr2|j|d7_ndS(Ntids(t
isinstanceRR;R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR?scCs!|jjjd|jf�dS(Nsmissing visit_%s(R�R�R�ttagname(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
default_visitCscCs!|jjjd|jf�dS(Nsmissing depart_%s(R�R�R�R(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdefault_departureFscCs�t|jtjj�rdS|j�}t|jj��dkr�|jj�dj	rx|jj�dj	|7_	q�||jj�d_	n-|jj
r�|jj
|7_
n||j_
dS(Nii����(RRR�Rt
literal_blockR�R�RgR�R�R0(RR�R0((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_TextIscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_Text[scCs#|j|d�}|j|�dS(Ntaddress(R
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_addressbscCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_addressfscCsJt|jtj�r'|jd�}n|j|d�}|j|�dS(NR*tauthor(RRRtauthorsRR
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_authoriscCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_authorpscCsXd|jjdf}|jd�}t|ddi|jd�d6�}||_dS(Ns%s:RR@s	text:spanRR?stext:style-name(R[RRR>RkR0(RR�RR=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_authorsss
cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_authorszscCs#|j|d�}|j|�dS(Ntcontact(R
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_contact}scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_contact�scCs#|j|d�}|j|�dS(Nt	copyright(R
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_copyright�scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_copyright�scCs|j|d�dS(Ntdate(R(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_date�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_date�scCs#|j|d�}|j|�dS(Ntorganization(R
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_organization�scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_organization�scCs#|j|d�}|j|�dS(Ntstatus(R
R	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_status�scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_status�scCs|j|d�}dS(Ntrevision(R(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_revision�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_revision�scCs|j|d�}dS(NR�(R(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_version�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_version�scCs|jd|j��}dS(NR)(RR�(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_attribution�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_attribution�scCs�d|jdkrA|jj|jd��|jd�|_nld|jdkr�|jj|jd��|jd�|_n+|jj|jd��|jd�|_|jd7_dS(NR5tclassesR:R+i(R�RlR?RkR~R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_block_quote�scCs)|jj�d|_|jd8_dS(NR	i(RltpopR~R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_block_quote�s
	cCsD|jd7_|jr�|jjr'q@|jd�r�d|jdkr�t|jddi|jd�d6�}|j	j
|jd��nAt|jddi|jd	�d6�}|j	j
|jd
��|j|�nb|j|jd�kr:t|jddi|jd�d6�}|j	j
|jd
��n�|j|jd�kr�t|jddi|jd�d6�}|j	j
|jd��n�|j|jd�kr�t|jddi|jd�d6�}|j	j
|jd��nAt|jddi|jd�d6�}|j	j
|jd
��|j|�dS(NiR9sauto-tocs	text:listRRBstext:style-nameR3RAR,R+sblockquote-bulletlistsblockquote-bulletitemR:shighlights-bulletlistshighlights-bulletitemR5sepigraph-bulletlistsepigraph-bulletitemR-(
R�RR�R�R�R�R>RgRkRmR?R	R~(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_bullet_list�s@				cCs\|jr2|jjrqI|j�|jj�n|j�|jj�|jd8_dS(Ni(RR�R�R
RmR;R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_bullet_list�s	


cCstj��dS(N(RtSkipChildren(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_caption�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_captionscCs|jd�}t|ddi�}t|ddi�}tjjdd�}||_t|ddi�}|j�|_dS(NR@soffice:annotationRs
dc:creatorRR	stext:p(RR>RR
RIR0R�(RR�R=RR�RW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_comments	cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_commentscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_compoundscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_compoundscCsK|jjdd�}t|�dkrG|jj|j|d��ndS(NR9i((R�RIR�RlR?Rk(RR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_containerscCs;|jjdd�}t|�dkr7|jj�ndS(NR9i((R�RIR�RlR;(RR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_containerscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_decoration scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_decoration#scCs1|jd7_|jdkr-td��ndS(Niis*max definition list nesting level exceeded(R�R�RJ(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_definition_list&scCs|jd8_dS(Ni(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_definition_list,scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_definition_list_item/scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_definition_list_item2scCsB|jd|j�}|j�|_|j|�tj��dS(Nsdeflist-term-%d(RR�R�R0R	RR?(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_term5s
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_term;scCs:|jj|jd|j��|jjtd��dS(Nsdeflist-def-%di(RlR?RkR�R�Ru(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_definition>s	cCs|jj�|jj�dS(N(RlR;R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_definitionCs
cCsm|jj�}t|�dkri|d}t|ddi|jd�d6�}d|j�f|_ndS(Nii����s	text:spanRR2stext:style-names (%s)(RgR�R�R>RkR�R0(RR�telsR=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_classifierGs
cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_classifierPscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_documentSscCs|j�dS(N(R(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_documentVscCso|jd7_|jd7_|jjrk|jddid|jd6d|jd6�}|j|�ndS(Nistext:sectionRs	Section%ds	text:namesSect%dstext:style-name(RbRcR�R�RR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_docinfoYscCs,|jd8_|jjr(|j�ndS(Ni(RbR�R�R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_docinfocscCs9t|jddi|jd�d6�}|j|�dS(Ns	text:spanRR2stext:style-name(R>RgRkR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_emphasishscCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_emphasismscCs||j}|j|jd�krbt|ddi|jd�d6�}|jj|jd��n	|j|jd�kr�t|ddi|jd�d6�}|jj|jd	��n�|j|jd
�krt|ddi|jd�d6�}|jj|jd��nWd
|jdd�f}t|ddi|j|�d6�}|jj|jd��|j|�dS(NR+s	text:listRsblockquote-enumliststext:style-namesblockquote-enumitemR:shighlights-enumlistshighlights-enumitemR5sepigraph-enumlistsepigraph-enumitemsenumlist-%stenumtypetarabicR3(RgR~RkR>RmR?RIR	(RR�RR�t
liststylename((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_enumerated_listps$	cCs|j�|jj�dS(N(R
RmR;(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_enumerated_list�s
cCs3|jrZ|jjr;|jj|jd|jf��q/|jd�}|j|�n�|jd�}|}t	|j
�dkr|j
d}|j�r|jt
�x[|j
D]M}xDt|j��D]0}|jdd|�}|jdd|�}q�Wq�Wqn|jj|jd�|j|�dS(Nscontents-%dstext:list-itemii����s	text:listR(RR�R�RlR?RkR�RR	R�R�RzR{R�trangeR~Rm(RR�RR�t	level_objt
level_obj1tidxR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_list_item�s&		

cCs�|jr2|jjr%|jj�q�|j�n�t|j�dkr�|jd}|j�r�|j	t
�xE|jD]7}x.t|j��D]}|j�|j�q�WqwWq�n|jj�|j�dS(Nii����(
RR�R�RlR;R
R�R�RzR{RR`R~(RR�RaRbRc((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_list_item�s	




cCs
t|_dS(N(RR|(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_header�scCs
t|_dS(N(R�R|(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_header�scCs
t|_dS(N(RR}(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_footer�scCs
t|_dS(N(R�R}(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_footer�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_field�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_field�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_field_list�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_field_list�scCsG|jd�}t|ddi|jd�d6�}|j�|_dS(NR@s	text:spanRR?stext:style-name(RR>RkR�R0(RR�R=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_field_name�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_field_name�scCs|jj|jd��dS(NR*(RlR?Rk(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_field_body�scCs|jj�dS(N(RlR;(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_field_body�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_figure�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_figure�scCs�|jd7_|j|_td�}||_|jj||f�t|tjj	�rw|j
j|jd��n|j
j|jd��dS(Nistext:note-bodyR8R7(R�Rgtsave_footnote_currentR;R�R?RR�RR8RlRk(RR�R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_footnote�s	cCs,|jj�|j|_|jd8_dS(Ni(RlR;RtRgR�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_footnote�s
t*s**s***s++s+++s##s###s@@s@@@c
Cs�|jdkr�|jdd}|jjd�}|dkrGd}n|jjr\d}nd}|jddid	|fd
6|d6�}t|jjdd
��}t|t	j
j�r�d|j�}t
|ddi|d6�}||_n�|dkr4t
|ddi|j�d6�}|j�|_nw|dkr�|jttj�krdd|_ntj|j}	|jd
7_t
|ddi|	d6�}|	|_n||j|<nt
j��dS(NiRtrefidR	R�R7s	text:noteRs%sstext:idstext:note-classtautois[%s]stext:note-citations
text:labelRRw(R�R�RIRR�R�RtstrRR�Rtcitation_referenceR�R>R0R�R�R�tfootnote_charsR�R?(
RR�RRxRRt	note_autoR8R�t
footnote_char((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_footnote_reference�sB		

	

cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_footnote_reference%scCs^t|_x|jdD]}||_PqW|jj|jd��|jjtd��dS(NRR*i(	RR�R�R�RlR?RkR�Ru(RR�R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_citation(s		cCs0d|_|jj�|jj�t|_dS(N(RR�RlR;R�R�R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_citation0s	

cCs�|jjr\|jd}|jddid|fd6dd6�}d|_|j|�n3|jjdkr}d|j_n|jjd7_dS(	NRxstext:reference-refRs%ss
text:ref-nameR0stext:reference-formatt[(R�R�R�RR0R	RgR(RR�RR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_citation_reference6s

	cCs/|jjd7_|jjr+|j�ndS(Nt](RgR0R�R�R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_citation_referenceDscCs�t|jtjj�r'tj��n�|jdk	r�|jd�}|j	|�|j
jr�t|d�}d|_
|jddid|jfd6�}q�d|_
ndS(NR@s	text:spanR�stext:reference-mark-startRs%ss	text:name(RRR�RR7R?R�RRR	R�R�R>R0R(RR�R=tel0R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_labelIs
	cCs�t|jtjj�rn~|jdk	r�|jjrz|j	ddid|jfd6�}t
|jd�}d|_n|jjd7_|j
�ndS(Nstext:reference-mark-endRs%ss	text:names	text:spanR�(RRR�RR7R�RR�R�RR>RgR0R
(RR�R=R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_labelXscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_generatedfscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_generatediscCstjj|�rdSdSdS(Nii(RRtexists(RR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytcheck_file_existslscCsd|jkr�|jd}|jd�p7|jd�s�|jtj�s�tj|�\}}|r�tjj|�}|r�d|tj|f}q�q�n|j|�s�|j	j
jd|f�dSq�ndS||jkr�|j|\}}n7|j
d7_
tjj|�d}d|j
|f}|jd�sP|jd�r�ydtj|�}|j�}	|j�tjdd	t�}
|
j|	�|
j�|
j}|}Wn0tjk
r�}|j	j
jd
|f�nX||f}
ntjj|�|f}
|jj|
�||f|j|<|jrF|j}n(t|jddi|jd
�d6�}|}t |j!t"j#j$�r�|j%||||�\}}}}i}|j&|||||�\}}|dk	r
||_(q
n|j&||||�}dS(Nturishttp:shttps:s%s%s%ssCannot find image file %s.isPictures/1%08x%stwbtdeletesCan't open image url %s.stext:pRR@stext:style-name()R�R�RtsepRtget_source_lineRRR�R�R�R�RvRtRHturllib2turlopenR�RTR�R�R�RRRKt	HTTPErrortabspathRwR?R�RgR>RkRRR�Rtfiguretgenerate_figuretgenerate_imageRR�(RR�R�t	docsourceRfRtfilenameR�timgfileR�timgfile2timgfilenameR�tspecRR�R�tel4tel5R.Rtel6twidth((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_imagersd




	
	cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_image�scCs�d}d}||jkr�|j|}|j�}yh|jd�r�|dkratd��n|jd�}t|�d}d}nt|�\}}Wq�tk
r�}|jj	j
d||j||f�q�Xn||fS(Nt%theights!percentage not allowed for heights %gY@s)Invalid %s for image: "%s".  Error: "%s".(RR�tstriptendswitht
ValueErrortrstripR�t
convert_to_cmR�R�R�(RR�tattrtsizetunittexp((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_image_width_height�s$
	cCs|j�}|jd�r2t|d �d}n�|jd�rXt|d �d}n�|jd�r~t|d �d}nz|jd�r�t|d �d	}nT|jd
�r�t|d �d}n.|jd�r�t|d �}ntd
��d}||fS(s�Convert various units to centimeters.

        Note that a call to this method should be wrapped in:
            try: except ValueError:
        tpxi����g9��v���?tingR���Q@tptg�Q���?tpcg+���@tmmg$@tcmsunknown unit type(R�R�R�R�(RR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��s cCs�d|jkr�|jd}yt|�}Wn2tk
r`|jjjd|jdf�nX|dkr�|jjjd|f�d}n|d}nd}|S(NtscalesInvalid scale for image: "%s"is!scale out of range (%s), using 1.g{�G�z�?g�?(R�tintR�R�R�R�(RR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_image_scale�s

	
cCs|j|�}|j|d�\}}|j|d�\}}d}td
k	r�||jkr�|j|\}	}
tjj|	d�}|jjd|�}yt	|�Wq�||f}q�Xnd
}|d
ks�|d
kr�|d
kr�t
d��n|d
kr)|jd}t|�d}n|d
krU|jd	}t|�d}n|d
kr�|}|jd}
t|
�d}
|jd	}t|�d}|j
�}||}|||
}||}q�n||9}||9}d|}d|}||fS(s=Return the image size in centimeters adjusted by image attrs.R�R�iHR�tdpis4image size not fully specified and PIL not installedig9��v���?iR�s%.2fcm(iHiHN(R�R�RRRvtImageR�tinfoRItiterRJR�R�tget_page_width(RR�R�R�R�t
width_unitR�R�R�R�R�R�tfactortimage_widthtimage_heightt
line_width((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_image_scaled_width_height�sL








c
Cs|j�}|jd�}d}x�|D]�}|jd�}|jd�}|jd�}|dks(|dks(|dkr�q(nyC|j|�\}}|j|�\}}|j|�\}}Wn&tk
r�}	|jjjd�nX|||}q(W|dkrd}n|S(s0Return the document's page width in centimeters.s�.//{urn:oasis:names:tc:opendocument:xmlns:style:1.0}page-layout/{urn:oasis:names:tc:opendocument:xmlns:style:1.0}page-layout-propertiessG{urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0}page-widthsH{urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0}margin-leftsI{urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0}margin-rights;Stylesheet file contains invalid page width or margin size.g{�G�z.@N(	R�titerfindRRIR�R�R�R�R�(
RRRR�R�t
page_widthtmargin_lefttmargin_rightR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�	s4	
				cCsd}|j||�\}}x2|jjD]$}|jdkr+|j�}q+q+W|jd7_|dk	rGidd6dd6dd6d	d
6}	t|jdd|	d
t	�}
idd6dd6dd6dd6}	t|
dd|	d
t	�}idd6dd6dd6dd6dd6dd6dd 6dd!6}	t|
d"d|	d
t	�}nd#|j}d$t
j�}
i|d6d%d6|jd&�d
6}	t|jdd|	d
t	�}
d'}d(}d)|j
kr|j
d)j�}x;|D]0}|d=kr�|}q�|d>kr�|}q�q�Wni}	t}|jj
jd.�}|rNd/|krNt}n|rad0|	d1<n
d2|	d1<t|
d3d|	d
t	�}i|d46|
d56dd66dd76}	||	d8<t|d9d|	�}i}	t|d:d|	�}i|jd�d;6}	t|d<d|	�}||||fS(?NR.itextrasstyle:classR�sstyle:familytCaptions
style:nametStandardsstyle:parent-style-namesstyle:styleRR<s0.0835insfo:margin-bottoms
fo:margin-topt0stext:line-numberR�stext:number-linessstyle:paragraph-propertiest12ptsfo:font-sizetitalics
fo:font-styletTimessstyle:font-nametLucidasans1sstyle:font-name-complexsstyle:font-size-asiansstyle:font-size-complexsstyle:font-style-asiansstyle:font-style-complexsstyle:text-propertiessrstframestyle%ds
graphics%dR�RStcenterttoptaligntlefttrighttmiddletbottomR9twraptdynamics
style:wrapR�sstyle:graphic-propertiessdraw:style-names	draw:namestext:anchor-typesdraw:z-indexs	svg:widths
draw:frames
draw:text-boxstext:style-namestext:p(R�R�R�(R�R�R�(RR�RR�RR�RuR>RhR�tIMAGE_NAME_COUNTERtnextRkR�RHR�RIR(RR�R�R�RgR.R�R�tnode1RRR�R�t	draw_namethaligntvalignR�RER�R9R�R�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�D	s�



	
		



cCs�|j||�\}}|jd7_d|j}i|d6dd6|jd�d6}	t|jdd	|	d
t�}
d}d}d|jkr�|jdj�}
x;|
D]0}|d@kr�|}q�|dAkr�|}q�q�Wn|dkrYidd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d d$6d%d&6}	n|}	|dk	rx||	d'<n|dk	r�||	d<nt	}|jj
d(�}|r�d)|kr�t}n|r�d*|	d+<n
d|	d+<|j|�r�d|	d+<nt|
d,d	|	d
t�}d-t
j�}i|d.6|d/6d0d16}	t|jtj�red2|	d3<n
d|	d3<||	d4<||	d5<t|d6d	|	�}
t|
d7d	id8|fd96d:d;6d<d=6d>d?6�}|
|fS(BNisrstframestyle%ds
style:nameR�sstyle:familyRRsstyle:parent-style-namesstyle:styleRR<R�R�R�R�R�R�R�sstyle:vertical-posR�sstyle:vertical-relsstyle:horizontal-relR�sstyle:mirrorsrect(0cm 0cm 0cm 0cm)sfo:clips0%sdraw:luminances
draw:contrastsdraw:reds
draw:greens	draw:blues100%s
draw:gammaR�sdraw:color-inversionsdraw:image-opacitytstandardsdraw:color-modesstyle:horizontal-posR9R�R�s
style:wrapsstyle:graphic-propertiess
graphics%dsdraw:style-names	draw:nameRsdraw:z-indexsas-charstext:anchor-types	svg:widths
svg:heights
draw:frames
draw:images%ss
xlink:hreftsimples
xlink:typetembeds
xlink:showtonLoads
xlink:actuate(R�R�R�(R�R�R�(R�RuRkR>RhR�RR�RHR�RIRtis_in_tableR�R�RRRtTextElement(RR�R�R�Rgtframe_attrsR�R�R�RRR�R�R�RER�R9R�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��	s�
	
	


	








cCs<|j}x,|r7t|tjj�r+tS|j}qWtS(N(RRR�RtentryRR�(RR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��	s		
cCs\t|jtjj�rX|jd}|dd}||_|jj|jd��ndS(Ni����iR/(	RRR�RR�RgRlR?Rk(RR�R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_legend�	s

	cCsJt|jtjj�rF|jj�|j�|j�|j�ndS(N(RRR�RR�RlR;R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_legend�	s



cCs"|jd7_|jd7_dS(Ni(R�R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_line_block
scCs"|jd8_|jd8_dS(Ni(R�R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_line_block
scCsBd|j}t|jddi|j|�d6�}||_dS(Nslineblock%dstext:pRstext:style-name(R�R>RgRk(RR�R-R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_line

s
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_line
scCs9t|jddi|jd�d6�}|j|�dS(Ns	text:spanRR<stext:style-name(R>RgRkR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_literal
scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_literal
scCs�|jjdd�}|ri|j}x3|D]+}t|ddi|j|�d6�}q+Wt|�}nt|jd�}d}|j|�|jj|�dS(NR9s	text:spanRstext:style-namei((	R�RIRgR>RkR�R	R�R?(RR�R�R=tinline_styletcount((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_inline
s	

cCs4|jj�}xt|�D]}|j�qWdS(N(R�R;R`R
(RR�R�tx((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_inline.
scCsnd}tj|�}|r6|j�}t|�}n4tj|�}|rj|j�}t|�d}n|S(Nii(tSPACES_PATTERNtmatchR�R�tTABS_PATTERN(RRfR�tmatchobjtpad((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt_calculate_code_block_padding3
scs|tjj|dt�}|dkrEtd�fd�dt�}ntd	�fd�dt�}tj|||�}|S(
Ntstripalltlatexttexcs�j||�S(N(Rk(RKR�(R(sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt<lambda>C
stescape_functioncs�j||�S(N(Rk(RKR�(R(sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�G
s(R�R�(((tpygmentstlexerstget_lexer_by_nameRR
R`Rt	highlight(RtinsourceR[tlexertfmtrt	outsource((RsR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt_add_syntax_highlighting@
s	cCs.tj|j|�}tj|j|�}|S(N(t	FILL_PAT1tsubt
fill_func1t	FILL_PAT2t
fill_func2(RRf((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	fill_lineM
scCs&|jd�}dt|�f}|S(Nis<text:s text:c="%d"/>(R�R�(RR�tspacestrepl((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRR
scCs*|jd�}dt|�df}|S(Nis <text:s text:c="%d"/>i(R�R�(RR�RR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyRW
scCs�t|j�dkr.d|jd�f}nd|jd�f}|j�}tr�|jjr�|jdd�}|j||�}nt	|�}|j
d�}|dd	kr�|d=nd
g}g}x<|D]4}|j|�}|jdd�}|j
|�q�Wdj|�}	||	f}
|j
|
�|j
d
�d	j|�}tdkro|jd�}ntj|�}|j�}
x|
D]}|jj
|�q�WdS(Nis)<text:p text:style-name="%s">%%s</text:p>scodeblock-indentedR1R[RXs
i����R	sI<wrappertag1 xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0">s&#10;s<text:line-break/>s</wrappertag1>R6sutf-8(R�RlRkR�RR�R�RIR	R`RHRR\R?RR9RR:R�R�Rg(RR�twrapper1R�R[tlinestlines1tmy_linestmy_linetmy_lines_strt
my_lines_str2RWRR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_literal_block\
s>
	




cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_literal_block�
scCs*|jjjdd|�|j|�dS(Ns"math" role not supportedt	base_node(R�R�R�R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_math�
scCs|j|�dS(N(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_math�
scCs*|jjjdd|�|j|�dS(Ns"math" directive not supportedR(R�R�R�R(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_math_block�
scCs|j|�dS(N(R(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_math_block�
scCsP|jjd�}|jjd�}|dk	rL|dk	rL||j|<ndS(NRKR�(R�RIRR(RR�RKR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_meta�
scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_meta�
sc	Cs�d}|js+t|_t|jddi|j|�d6dd6dt�}t|ddid	d
6dd6d
d6dt�}t|jddi|jd|d5�d6dd6dt�}t|ddidd6dt�}t|jddi|jd|d6�d6dd6dt�}t|ddidd6dt�}t|jddi|jd|d7�d6dd6dt�}t|ddidd6dd6dd 6d
d!6dd"6dd#6dt�}t|d$dt�}t|jddi|jd|d8�d6dd6dt�}t|ddidd6dd%6dt�}t|jddi|jd|d9�d6dd6dt�}t|ddidd6dd 6d
d!6d
d"6dd#6dt�}t|jddi|jd|d:�d6dd6dt�}t|ddidd6dd 6dd!6d
d"6dd#6dt�}n|jd'di|j|�d(6|j|�d)6�}t|d*di|jd|d;�d)6�}t|d*di|jd|d<�d)6�}t|d+�}t|d,�}t|d-di|jd|d=�d)6d.d/6�}t|d0did1d26�}d3|_t|d-di|jd|d>�d)6d.d/6�}t|d0did1d26�}d4|_|j|�dS(?NRKsstyle:styleRs
style:nameR/sstyle:familyR<sstyle:table-propertiess17.59cmsstyle:widthR�stable:alignR�sstyle:shadows%s.%%cRWstable-columnsstyle:table-column-propertiess4.999cmsstyle:column-widthtBs12.587cms	%s.%%c%%dis
table-cellsstyle:table-cell-propertiesttransparentsfo:background-colors0.097cms
fo:paddings0.035cm solid #000000sfo:border-leftsfo:border-rights
fo:border-topsfo:border-bottomsstyle:background-images	fo:borderistable:tables
table:namestable:style-namestable:table-columnstable:table-header-rowsstable:table-rowstable:table-celltstringsoffice:value-typestext:ptTable_20_Headingstext:style-nametOptiontDescription(RW(R"(RWi(R"i(RWi(R"i(RW(R"(RWi(R"i(	RqRR>RhRkR�RR0R	(RR�t
table_nameR=RR�R�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_option_list�
s�		

	

	cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_option_listscCs |jd�}|j|�dS(Nstable:table-row(RR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_option_list_itemscCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_option_list_itemscCs;|jddid|jd6dd6�}|j|�dS(Nstable:table-cellRs
Table%d.A2stable:style-nameR$soffice:value-type(RRnR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_option_group
s
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_option_groupscCs/|jddidd6�}|j�|_dS(Nstext:pRtTable_20_Contentsstext:style-name(RR�R0(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_options
cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_optionscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_option_stringscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_option_stringscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_option_argument"scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_option_argument%scCse|jddid|jd6dd6�}t|ddidd	6�}|j�|_tj��dS(
Nstable:table-cellRs
Table%d.B2stable:style-nameR$soffice:value-typestext:pR/stext:style-name(RRnR>R�R0RR?(RR�R=R((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_description(s

cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_description2scCs�t|_|jr$|jd�}nQ|jr?|jd�}n6|jd}|jddi|d6�}|j|�|j|�dS(NR9R6i����stext:pRstext:style-name(	RR�R|RR}RlRRR	(RR�R=R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_paragraph5s			

cCs�t|_|j�|jrY|jj|jj�d�|jj|jj�d�nF|j	r�|j
j|jj�d�|jj|jj�d�ndS(Ni����(R�R�R
R|RzR?RgR�tremoveR}R{(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_paragraphBs	
						cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_problematicPscCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_problematicSscCsd|jkr|jd}|j�}d|kr|j�}djgtj�D]\}}d||f^qS�}d||f}tdkr�|jd�}ntj	|�}	|	j
�}
t|
�dkr|
d}|jr�q|j
r�q|jj|�qqntj��dS(	NR�R�Ras%s="%s"s<stuff %s>%s</stuff>R6sutf-8i(R�RHR�RReR^R9RR:R�R�R�R|R}RgR?RR?(RR�tformatst
formatlisttrawstrtktvtattrstrt
contentstrR�telementsR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	visit_rawVs(
	/
		cCs|jrn|jrndS(N(R|R}(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_rawms
		cCsR|j�}|jjr�|jd�r�|d}|jjr^|jd�r^|j|�}n|jddid|d6dd6�}|j|�q�|jd	�r�|jjr�|d	}|jd
did|d6dd
6�}q�q�|j	j
jd�n|jrNt
|j�dkrNt|jdtjj�rN|j|jd�ndS(Ntrefurismailto:stext:aRs%ss
xlink:hrefR�s
xlink:typeRxstext:reference-refs
text:ref-nameR0stext:reference-formats3References must have "refuri" or "refid" attribute.ii(R�R�R�R�R�R�tcloak_mailtoRR	R�R�R�RR�R�RR�Rt	generatedR9(RR�R0threfR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_referenceus.



	cCs/|jjr+|jd�r+|j�q+ndS(NRG(R�R�R�R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_reference�scCs�|jd�}|jd�}|r@|d}|r@|}q@nt|jddi|d6�}|j�}|j|�|_dS(NR>R9istext:hRstext:style-name(RkRIR>RgR�RR0(RR�R�R9tclass1R=R0((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_rubric�s

cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_rubric�sicCso|jd7_|jd7_|jjrk|jddid|jd6d|jd6�}|j|�ndS(Nistext:sectionRs	Section%ds	text:namesSect%dstext:style-name(RbRcR�R�RR	(RR�tmove_idsR=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_section�scCs,|jd8_|jjr(|j�ndS(Ni(RbR�R�R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_section�scCs9t|jddi|jd�d6�}|j|�dS(Ns	text:spanRR?stext:style-name(R>RgRkR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_strong�scCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_strong�scCstj��dS(N(RR?(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_substitution_definition�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_substitution_definition�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_system_message�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_system_message�scCs<d}d}t}|jd�}|dk	r`x0|D]%}|jt�r4|}t}Pq4q4Wn|dk	r�|jj|�}|dkr8|jjj	d|f�t
}|jj|�}|dkr�|jjj	d|f�t}q�q8nGt
}|jj|�}|dkr8|jjj	d|f�t}n|S(NR9s,Can't find table style "%s".  Using default.s=Can't find default table style "%s".  Using built-in default.(RR�RIR�R�RR�R�R�R�tTABLENAMEDEFAULTtBUILTIN_DEFAULT_TABLE_STYLE(RR�ttable_styleR(tuse_predefined_table_styletstr_classest	str_class((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytget_table_style�s>
	c
Csl|jd7_|j|�}dt}t|jddi|jd||jf�d6dd6d	t�}|jdkr�t|d
didd6d
d6dd6d	t�}n:t|d
didd6d
d6dd6|jd6d	t�}t|jddi|jd||jddf�d6dd6d	t�}|j	j
}|dkrR|j}n
d|f}t|ddidd6|d6|d6|d6|d6d	t�}	d}
x0|jD]%}|j
dkr�|j�}
Pq�q�W|
dk	r�|jd|
�}nt|jd di|jd||jf�d!6|jd||jf�d"6�}
|j|
�||_d#|_dS($Nis%s%%dsstyle:styleRs%ss
style:nameR/sstyle:familyR<sstyle:table-propertiesR�stable:alignt0ins
fo:margin-tops0.10insfo:margin-bottomtmarginssfo:background-colors	%s.%%c%%dRWs
table-cells0.%03dcm solid #000000sstyle:table-cell-propertiess0.049cms
fo:paddingsfo:border-leftsfo:border-rights
fo:border-topsfo:border-bottomRstable-titlestable:tables
table:namestable:style-nameg(RnR_R�R>RhRkR�RmRR�ttable_border_thicknessRR�RR�RRgR	tcurrent_table_stylettable_width(RR�R[R(Rtel1_1R�t	thicknesstline_style1tel2_1RR�R�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_table�sf

	

	
	

	
	cCsPtddt�}d|jf}|j}|d}||j|<|j�dS(Nsstyle:widthR<s%.4fini(R@R�RdRcRR
(RR�Rt	attribvalRR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_table2s	

cCstd�d|_dS(NRWi(R]Ro(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_tgroup:scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_tgroup=scCs�|jd7_|jdt|jt|j�f�}|dd}t|jddi|d6dd	6d
t�}t|ddid|d
6d
t�}|jddi|d6�}|j	|7_	dS(Nis	%s%%d.%%stcolwidthg(@sstyle:styleRs
style:namestable-columnsstyle:familyR<sstyle:table-column-propertiess%.4finsstyle:column-widthstable:table-columnstable:style-name(
RoRkR�RntchrR>RhR�RRd(RR�tcolspec_nameRnRReR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_colspec@s
		
cCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_colspecTscCs9|jd�}|j|�t|_|jjd�dS(Nstable:table-header-rowsR%(RR	Rtin_theadRlR?(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_theadWs
	cCs$|j�t|_|jj�dS(N(R
R�RsRlR;(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_thead]s
	cCs3td�d|_|jd�}|j|�dS(NRWistable:table-row(R]RoRR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	visit_rowbscCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_rowgscCs�|jd7_|jdt|jddf�}i|d6dd6}|jdd�}|dkr�d	|df|d
<|j|7_n|jdd�}|dkr�d	|df|d<n|jd
d|�}|j|�dS(Nis%s%%d.%%c%%dRWstable:style-nameR$soffice:value-typetmorecolsis%dstable:number-columns-spannedtmorerowsstable:number-rows-spannedstable:table-cellR(RoRkR�RnRIRR	(RR�t
cellspec_nameRRxRyR((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_entryjs 
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_entry~scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_tbody�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_tbody�scCs4|jd�p*|jd�p*|jd�s0ndS(NRGRxtrefname(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_target�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
depart_target�scCs;t|jtjj�r�|j}|dkri|jjjd�|jjjd|j	�f�d}n|j
ddid|d6|jd|f�d	6�}|j|�|j
|�n{t|jtjj�r7t|jd
di|j|�d	6�}|j|�|j	�}||_t|_|j
|�ndS(Nis4Heading/section levels greater than 7 not supported.s1    Reducing to heading level 7 for heading: "%s"stext:hRs%dstext:outline-levels	heading%dstext:style-namestext:p(RRR�RtsectionRbR�R�R�R�RRkRR	R>RgRRR�(RR�RPt
title_typeRbRR0((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_title�s.		

		cCsAt|jtjj�s0t|jtjj�r=|j�ndS(N(RRR�RR�R�R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_title�scCs|j||dd�dS(NR�RC(R�(RR�RP((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_subtitle�scCs|j|�dS(N(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_subtitle�scCsM|jddi|jd�d6�}|j|j��|_tj��dS(Ns	text:spanRR=stext:style-name(RRkRR�R0RR?(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_title_reference�scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_title_reference�sc	Cs�x�tdd�D]�}t|ddid|fd6|jd|f�d6�}t|d	�}t|d
�}t|ddidd
6dd6�}t|d�}qWdS(Niis$text:table-of-content-entry-templateRs%dstext:outline-levelscontents-%dstext:style-namestext:index-entry-chapterstext:index-entry-textstext:index-entry-tab-stopR�sstyle:leader-charR�s
style:typestext:index-entry-page-number(R`R>Rk(RRRcR�R�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt(generate_table_of_content_entry_template�s
cCshd}d}x*|jD]}t||�r|}PqqW|dk	rT|j�}n|jj|}|S(NR	(RR�RR�R[R(RR�t
class_typet	label_keyRt
title_nodeR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytfind_title_label�sc
Cs�d|jkr�d|jdkr�|j|tjjd�}|jjr2|jddidd6dd6d	d
6�}t|ddidd
6�}t|ddidd
6�}||_	|j
|�t|d�}t|d�}t|ddi|jd�d
6�}||_	|j|_
||_|j|�nL|jd�}	|jd�}	t|	ddi|jd�d
6�}||_	t|_q�d|jdkr|jd�}	|jd�}	t|	ddi|jd�d
6�}|j|tjjd�}||_	q�d|jdkr�|jd�}	|jd�}	t|	ddi|jd�d
6�}|j|tjjd�}||_	q�ndS(NR9tcontentsstext:table-of-contentRsTable of Contents1s	text:nameR�stext:protectedtSect1stext:style-namestext:table-of-content-sourcet10stext:outline-levelstext:index-title-templatetContents_20_Headingstext:index-bodystext:index-titlestext:pscontents-headingR;R0s	text:spanR?tabstractt
dedication(R�R�R�RRR�R�RR>R0R�RkRgtsave_current_elementR�R	RRR(
RR�RRR�R�R�R�R�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_topic�s^	


	
					cCssd|jkrod|jdkro|jjrQ|j|j�|j|j�n|jd�}t|_	qondS(NR9R�R;(
R�R�R�tupdate_toc_page_numbersR�R	R�RR�R(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_topic
s
cCs*g}|j|d|�|j|�dS(Ni(tupdate_toc_collecttupdate_toc_add_numbers(RR=t
collection((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�%
scCs]|j||f�|d7}x9|j�D]+}|jdkr*|j|||�q*q*WdS(Nistext:index-body(R?R�RR�(RR=RvR�tchild_el((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�*
s

cCsTxM|D]E\}}|jdkr|jdkrt|d�}d|_qqWdS(Nstext:psTable of Contentsstext:tabt9999(RR0R>R�(RR�RvRR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�1
s
cCs|jd�}dS(NR;(R(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_transition9
scCsdS(N((RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_transition<
scCs|j|d�dS(NR�(tgenerate_admonition(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_warningB
scCs|jj�dS(N(RlR;(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_warningE
scCs|j|d�dS(Nt	attention(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_attentionH
scCs|j|d�dS(Ntcaution(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_cautionM
scCs|j|d�dS(Ntdanger(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_dangerR
scCs|j|d�dS(Nterror(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_errorW
scCs|j|d�dS(Nthint(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_hint\
scCs|j|d�dS(Nt	important(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_importanta
scCs|j|d�dS(Ntnote(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt
visit_notef
scCs|j|d�dS(Nttip(R�(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt	visit_tipk
scCs�d}x/|jD]$}|jdkr|j�}qqW|dkri|jd�}|ri|d}qin|j|d|�dS(NRR9itgeneric(RR�RR�RIR�(RR�RR�tclasses1((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_admonitionp
scCs�t|jd�r%|jj|}n|}t|jddi|jd|f�d6�}|rk||_nd|j�f|_|jd|f�}|jj	|�dS(NRstext:pRsadmon-%s-hdrstext:style-names%s!s
admon-%s-body(
thasattrR[RR>RgRkR0t
capitalizeRlR?(RR�RRttranslated_labelRRW((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�}
scCs-|jddidd6�}|j|�dS(Ns	text:spanRsrststyle-subscriptstext:style-name(RR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_subscript�
s
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_subscript�
scCs-|jddidd6�}|j|�dS(Ns	text:spanRsrststyle-superscriptstext:style-name(RR	(RR�R=((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytvisit_superscript�
s
cCs|j�dS(N(R
(RR�((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pytdepart_superscript�
s([R)R*R+sblockquote-bulletitemsblockquote-bulletlistsblockquote-enumitemsblockquote-enumlistR,R-R.R/R0R1scodeblock-indentedscodeblock-classnamescodeblock-commentscodeblock-functionnamescodeblock-keywordscodeblock-namescodeblock-numberscodeblock-operatorscodeblock-stringR2R3R4R5sepigraph-bulletitemsepigraph-bulletlistsepigraph-enumitemsepigraph-enumlistR6R7R8R9R:shighlights-bulletitemshighlights-bulletlistshighlights-enumitemshighlights-enumlistR;R<R=R>R?stable-titleR@RARBRRCRDRERFRGRHRIRJsadmon-attention-hdrsadmon-attention-bodysadmon-caution-hdrsadmon-caution-bodysadmon-danger-hdrsadmon-danger-bodysadmon-error-hdrsadmon-error-bodysadmon-generic-hdrsadmon-generic-bodysadmon-hint-hdrsadmon-hint-bodysadmon-important-hdrsadmon-important-bodysadmon-note-hdrsadmon-note-bodys
admon-tip-hdrsadmon-tip-bodysadmon-warning-hdrsadmon-warning-bodyRKstableoption.%cstableoption.%c%dsTable%ds
Table%d.%csTable%d.%c%dRLRMRNRORPRQRRRS(N(RRR_RR�R�R�R�R�R�R�RkRiR�R�R�R�R`t	code_noneR�R�tretcompileR�R�R�R�R�R�R�RR�R�RRRRRRR	R
R
RRRRRRRRRRRR R!R"R$R%R'R(R*R+R-R.R0R1R3R4R5R6R7R8R:R<R=R>R@RARBRCRDRERFRGRHRIRJRKRLRMRNRORPRQRSRTRURVRWRXRYRZR^R_RdReRfRgRhRiRjRkRlRmRnRoRpRqRrRsRuRvR|RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R	RRRRRtvisit_doctest_blocktdepart_doctest_blockRRRRR R!R)R*R+R,R-R.R0R1R2R3R4R5R6R7R8R:R;R<RERFRKRLRNRORQRRRSRTRURVRWRXR_RiRkRlRmRqRrRtRuRvRwR{R|R}R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tdepart_attentionR�tdepart_cautionR�t
depart_dangerR�tdepart_errorR�tdepart_hintR�tdepart_importantR�tdepart_noteR�t
depart_tipR�tdepart_admonitionR�R�R�R�R�(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR�=sd	Z												2		�									&																																								,																										
																									(											;					+	&	US												
	
				(								\												
		
									
								(	?														
							
	6																				tReadercBseZd�ZRS(cCsHtjj|�}|jjr"|Sg|D]}|tjk	r)|^q)S(N(RR�tget_transformsR�R�RtDanglingReferences(RR�ti((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��
s
(RRR�(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyR��
s(]t__doc__Rt
__docformat__RPRtos.pathR�R�txml.domRR�R�ROR�R�t	itertoolsR�R�tImportErrorRRRRRtdocutils.readersRtdocutils.transformsRR�R�R9R�t	xml.etreeR
R:RRWRtpygments.lexerstpygmentsformatterRR
tSyntaxErrorR�Rt	PIL.ImageRR�tobjecttweakreftWeakKeyDictionaryRRR;ttypeRRR�R�R�R
R
R�RYR�tGENERATOR_DESCR�RdR�R�R�R�R�RR
ReR�R�R	R>R8R@RXR`RbRkRlRZRuR�RYR�R�(((sR/opt/alt/python27/lib/python2.7/site-packages/docutils/writers/odf_odt/__init__.pyt<module>s�
(





	

	





						
������������q