ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ Rc@sdZddlmZddlZddlmZddlmZmZm Z de fdYZ de fd YZ d e fd YZ d e fd YZdS(s7 The **BaseElement** is the root for all SVG elements. i(tetreeN(t Parameter(tAutoIDt to_unicodetPYTHON3t BaseElementcBseZdZdZdZdZdZedZedZ edZ edZ d Z dd Zd Zd Zd ZdZdZdZdZdZdZdddZdZRS(s The **BaseElement** is the root for all SVG elements. The SVG attributes are stored in **attribs**, and the SVG subelements are stored in **elements**. t baseElementcKs|jdd}|dk r-|j|_n t|_|jdd}|dk rf||j_n|jdd}|dk r||j_nt|_|j|t |_ dS(s :param extra: extra SVG attributes (keyword arguments) * add trailing '_' to reserved keywords: ``'class_'``, ``'from_'`` * replace inner '-' by '_': ``'stroke_width'`` SVG attribute names will be checked, if **debug** is `True`. workaround for removed **attribs** parameter in Version 0.2.2:: # replace element = BaseElement(attribs=adict) #by element = BaseElement() element.update(adict) tfactorytdebugtprofileN( tpoptNonet _parameterRRR tdicttattribstupdatetlisttelements(tselftextraRRR ((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt__init__s      cCsLxE|jD]7\}}|jdjdd}|j||q WdS(s Update SVG Attributes from `dict` attribs. Rules for keys: 1. trailing '_' will be removed (``'class_'`` -> ``'class'``) 2. inner '_' will be replaced by '-' (``'stroke_width'`` -> ``'stroke-width'``) t_t-N(titemstrstriptreplacet __setitem__(RRtkeytvalue((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRHs cCs_tj|}tj|j|_tj|j|_d|jkr[|j|d/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRWs cCs |jjS(N(R R(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR_scCs |jjS(N(R R (R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR cscCs |jjS(N(R t validator(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR!gscCs |jjS(N(R t get_version(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pytversionkscCs ||_dS(N(R (Rt parameter((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt set_parameteroscCs tj|S(N(RR(RR((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRrscCs0d|jkr%|j|jd/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pytget_iduscCsd|jS(sn Get the `IRI` reference string of the object. (i.e., ``'#id'``). :returns: `string` s#%s(R&(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pytget_iriscCsd|jS(sv Get the `FuncIRI` reference string of the object. (i.e. ``'url(#id)'``). :returns: `string` surl(%s)(R'(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt get_funciriscCs |j|S(sz Get SVG attribute by `key`. :param string key: SVG attribute name :return: SVG attribute value (R(RR((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt __getitem__scCs6|jr%|jj|j||n||j|/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRs cCs9|jr%|jj|j|jn|jj||S(s Add an SVG element as subelement. :param element: append this SVG element :returns: the added element (RR!tcheck_valid_childrenR+Rtappend(Rtelement((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pytadds cCs.|j}tj|dd}|jdS(s Get the XML representation as unicode `string`. :return: unicode XML string of this object and all its subelements tencodingsutf-8(tget_xmlRttostringtdecode(Rtxmlt xml_utf8_str((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR2s cCstj|j}|jr7|jj|j|jnxT|jjD]C\}}|dk rG|j |}|r|j ||qqGqGWx$|j D]}|j |j qW|S(s Get the XML representation as `ElementTree` object. :return: XML `ElementTree` of this object and all its subelements N(RtElementR+RR!tcheck_all_svg_attribute_valuesRRR tvalue_to_stringtsetRR-R1(RR4t attributeRR.((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR1s  cCsqt|ttfrg|jr4|jj|dnt|trg|jdkrgt|d}qgnt|S(s Converts *value* into a includes a value check, depending on :attr:`self.debug` and :attr:`self.profile`. tnumberttinyi( t isinstancetinttfloatRR!tcheck_svg_typeR troundR(RR((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR8s  cCsT|dk r(|jjdt|n|dk rP|jjdt|ndS(sK Insert a **title** and/or a **desc** element as first subelement. iN(R RtinserttDesctTitle(Rttitletdesc((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pytset_descs  cCst|}t|jdkr4|jj|nid}xM|j|jdkr|d7}|t|jkr=|jj|dSq=W|jj||dS(sN :param xmldata: an xml.etree.ElementTree - Element() object. iRERFiN(RERF(tMetadatatlenRR-R+RB(Rtxmldatatmetadatatpos((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt set_metadatas  N(t__name__t __module__t__doc__R+RRRtpropertyRR R!R#R%R RR&R'R(R)RR/R2R1R8RGRM(((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRs, +        RDcBs eZdZdZdZRS(REcCs+tj|j|_t||j_dS(N(RR6R+R4Rttext(RRR((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRscCs|jS(N(R4(R((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyR1s(RNROR+RR1(((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRDs RCcBseZdZRS(RF(RNROR+(((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRCsRHcBseZdZdZRS(RKcCs&tjd|_|jj|dS(sN :param xmldata: an xml.etree.ElementTree - Element() object. RKN(RR6R4R-(RRJ((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRs(RNROR+R(((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyRHs(RPtsvgwrite.etreeRRtsvgwrite.paramsRtsvgwrite.utilsRRRtobjectRRDRCRH(((s>/opt/alt/python27/lib/python2.7/site-packages/svgwrite/base.pyt s