;i dZddlmZddlmZmZmZddlmZddl m Z m Z m Z er ddl mZddlmZGdd e ZGd d e Zd S) zOCustom element classes that correspond to the document part, e.g. .) annotations) TYPE_CHECKINGCallableList) CT_SectPr)BaseOxmlElement ZeroOrMore ZeroOrOne)CT_Tbl)CT_PcLeZdZUdZedZded<ed dZdS) CT_DocumentzB```` element, the root element of a document.xml file.zw:bodyCT_BodybodyreturnList[CT_SectPr]c0d}||S)aAll `w:sectPr` elements directly accessible from document element. Note this does not include a `sectPr` child in a paragraphs wrapped in revision marks or other intervening layer, perhaps `w:sdt` or customXml elements. `w:sectPr` elements appear in document order. The last one is always `w:body/w:sectPr`, all preceding are `w:p/w:pPr/w:sectPr`. z/./w:body/w:p/w:pPr/w:sectPr | ./w:body/w:sectPrxpath)selfrs FC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\docx/oxml/document.py sectPr_lstzCT_Document.sectPr_lstsBzz%   N)rr) __name__ __module__ __qualname____doc__r r__annotations__propertyrrrrrsULLIh''D''''  ! ! !X ! ! !rrceZdZUdZded<ded<ded<ded <d ed <ed d Zedd ZeddZ ded<ddZ dZ e ddZ dS)rzN`w:body`, the container element for the main document story in `document.xml`.zCallable[[], CT_P]add_pzCallable[[], CT_SectPr]get_or_add_sectPrz List[CT_P]p_lstz List[CT_Tbl]tbl_lstzCallable[[CT_Tbl], CT_Tbl] _insert_tblzw:p)w:sectPr) successorszw:tblr'r zCT_SectPr | NonesectPrrrc|}|||dD]}|||S)apReturn `w:sectPr` element for new section added at end of document. The last `w:sectPr` becomes the second-to-last, with the new `w:sectPr` being an exact clone of the previous one, except that all header and footer references are removed (and are therefore now "inherited" from the prior section). A copy of the previously-last `w:sectPr` will now appear in a new `w:p` at the end of the document. The returned `w:sectPr` is the sentinel `w:sectPr` for the document (and as implemented, `is` the prior sentinel `w:sectPr` with headers and footers removed). z#w:headerReference|w:footerReference)r#r" set_sectPrclonerremove)rsentinel_sectPr hdrftr_refs radd_section_breakzCT_Body.add_section_break3sx0022  5 5 7 7888)//0UVV / /J  " ": . . . .rc`|dD]}||dS)z~Remove all content child elements from this element. Leave the element if it is present. z./*[not(self::w:sectPr)]N)rr-)r content_elms r clear_contentzCT_Body.clear_contentIs?  ::&@AA % %K KK $ $ $ $ % %rList[CT_P | CT_Tbl]c,|dS)zGenerate all `w:p` and `w:tbl` elements in this document-body. Elements appear in document order. Elements shaded by nesting in a `w:ins` or other "wrapper" element will not be included. z./w:p | ./w:tblr)rs rinner_content_elementszCT_Body.inner_content_elementsQszz+,,,rN)rr)rr4)rrrrrr ptblr r)r0r3rr6r rrrr#sXX....++++ 5]333A *W 7 7 7C(yr   F,%%%---X---rrN)r __future__rtypingrrrdocx.oxml.sectionrdocx.oxml.xmlchemyrr r docx.oxml.tabler docx.oxml.text.paragraphr rrr rrr?sUU""""""0000000000''''''EEEEEEEEEE.&&&&&&------!!!!!/!!!(5-5-5-5-5-o5-5-5-5-5-r