<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . . import parse_xml <EOL> from ... enum . shapes import MSO_AUTO_SHAPE_TYPE , PP_PLACEHOLDER <EOL> from . . ns import nsdecls <EOL> from . shared import BaseShapeElement <EOL> from . . simpletypes import XsdBoolean , XsdString <EOL> from . . text import CT_TextBody <EOL> from . . xmlchemy import ( <EOL> BaseOxmlElement , OneAndOnlyOne , OptionalAttribute , RequiredAttribute , <EOL> ZeroOrOne , ZeroOrMore <EOL> ) <EOL> class CT_GeomGuide ( BaseOxmlElement ) : <EOL> """<STR_LIT>""" <EOL> name = RequiredAttribute ( '<STR_LIT:name>' , XsdString ) <EOL> fmla = RequiredAttribute ( '<STR_LIT>' , XsdString ) <EOL> class CT_GeomGuideList ( BaseOxmlElement ) : <EOL> """<STR_LIT>""" <EOL> gd = ZeroOrMore ( '<STR_LIT>' ) <EOL> class CT_NonVisualDrawingShapeProps ( BaseShapeElement ) : <EOL> """<STR_LIT>""" <EOL> spLocks = ZeroOrOne ( '<STR_LIT>' ) <EOL> txBox = OptionalAttribute ( '<STR_LIT>' , XsdBoolean ) <EOL> class CT_PresetGeometry2D ( BaseOxmlElement ) : <EOL> """<STR_LIT>""" <EOL> avLst = ZeroOrOne ( '<STR_LIT>' ) <EOL> prst = RequiredAttribute ( '<STR_LIT>' , MSO_AUTO_SHAPE_TYPE ) <EOL> @ property <EOL> def gd_lst ( self ) : <EOL> """<STR_LIT>""" <EOL> avLst = self . avLst <EOL> if avLst is None : <EOL> return [ ] <EOL> return avLst . gd_lst <EOL> def rewrite_guides ( self , guides ) : <EOL> """<STR_LIT>""" <EOL> self . _remove_avLst ( ) <EOL> avLst = self . _add_avLst ( ) <EOL> for name , val in guides : <EOL> gd = avLst . _add_gd ( ) <EOL> gd . name = name <EOL> gd . fmla = '<STR_LIT>' % val <EOL> class CT_Shape ( BaseShapeElement ) : <EOL> """<STR_LIT>""" <EOL> nvSpPr = OneAndOnlyOne ( '<STR_LIT>' ) <EOL> spPr = OneAndOnlyOne ( '<STR_LIT>' ) <EOL> txBody = ZeroOrOne ( '<STR_LIT>' , successors = ( '<STR_LIT>' , ) ) <EOL> def get_or_add_ln ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . spPr . get_or_add_ln ( ) <EOL> @ property <EOL> def is_autoshape ( self ) : <EOL> """<STR_LIT>""" <EOL> prstGeom = self . prstGeom <EOL> if prstGeom is None : <EOL> return False <EOL> if self . nvSpPr . cNvSpPr . txBox is True : <EOL> return False <EOL> return True <EOL> @ property <EOL> def is_textbox ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . nvSpPr . cNvSpPr . txBox is True : <EOL> return True <EOL> return False <EOL> @ property <EOL> def ln ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . spPr . ln <EOL> @ staticmethod <EOL> def new_autoshape_sp ( id_ , name , prst , left , top , width , height ) : <EOL> """<STR_LIT>""" <EOL> tmpl = CT_Shape . _autoshape_sp_tmpl ( ) <EOL> xml = tmpl % ( id_ , name , left , top , width , height , prst ) <EOL> sp = parse_xml ( xml ) <EOL> return sp <EOL> @ staticmethod <EOL> def new_placeholder_sp ( id_ , name , ph_type , orient , sz , idx ) : <EOL> """<STR_LIT>""" <EOL> tmpl = CT_Shape . _ph_sp_tmpl ( ) <EOL> xml = tmpl % ( id_ , name ) <EOL> sp = parse_xml ( xml ) <EOL> ph = sp . nvSpPr . nvPr . get_or_add_ph ( ) <EOL> ph . type = ph_type <EOL> ph . idx = idx <EOL> ph . orient = orient <EOL> ph . sz = sz <EOL> placeholder_types_that_have_a_text_frame = ( <EOL> PP_PLACEHOLDER . TITLE , PP_PLACEHOLDER . CENTER_TITLE , <EOL> PP_PLACEHOLDER . SUBTITLE , PP_PLACEHOLDER . BODY , <EOL> PP_PLACEHOLDER . OBJECT <EOL> ) <EOL> if ph_type in placeholder_types_that_have_a_text_frame : <EOL> sp . append ( CT_TextBody . new ( ) ) <EOL> return sp <EOL> @ staticmethod <EOL> def new_textbox_sp ( id_ , name , left , top , width , height ) : <EOL> """<STR_LIT>""" <EOL> tmpl = CT_Shape . _textbox_sp_tmpl ( ) <EOL> xml = tmpl % ( id_ , name , left , top , width , height ) <EOL> sp = parse_xml ( xml ) <EOL> return sp <EOL> @ property <EOL> def prst ( self ) : <EOL> """<STR_LIT>""" <EOL> prstGeom = self . prstGeom <EOL> if prstGeom is None : <EOL> return None <EOL> return prstGeom . prst <EOL> @ property <EOL> def prstGeom ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . spPr . prstGeom <EOL> @ staticmethod <EOL> def _autoshape_sp_tmpl ( ) : <EOL> return ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( nsdecls ( '<STR_LIT:a>' , '<STR_LIT:p>' ) , '<STR_LIT>' , '<STR_LIT:%s>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:%s>' ) <EOL> ) <EOL> def _new_txBody ( self ) : <EOL> return CT_TextBody . new_p_txBody ( ) <EOL> @ staticmethod <EOL> def _ph_sp_tmpl ( ) : <EOL> return ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % ( nsdecls ( '<STR_LIT:a>' , '<STR_LIT:p>' ) , '<STR_LIT>' , '<STR_LIT:%s>' ) <EOL> ) <EOL> @ staticmethod <EOL> def _textbox_sp_tmpl ( ) : <EOL> return ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( nsdecls ( '<STR_LIT:a>' , '<STR_LIT:p>' ) , '<STR_LIT>' , '<STR_LIT:%s>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> class CT_ShapeNonVisual ( BaseShapeElement ) : <EOL> """<STR_LIT>""" <EOL> cNvPr = OneAndOnlyOne ( '<STR_LIT>' ) <EOL> cNvSpPr = OneAndOnlyOne ( '<STR_LIT>' ) <EOL> nvPr = OneAndOnlyOne ( '<STR_LIT>' ) </s>
