ÿØÿà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Áß_ÿÙ J^oRc@sdZddlZejddkZddlmZerJeZeZn dZdZ ddl m Z dddd d Z d Z d d ZdZdZdZddZdefdYZdS(s .. autofunction:: rgb .. autofunction:: iterflatlist .. autofunction:: strlist .. autofunction:: get_unit .. autofunction:: split_coordinate .. autofunction:: split_angle .. autofunction:: rect_top_left_corner iNii(tpartialcCs)t|trt|ddSt|S(Ntencodingtutf8(t isinstancetstrtunicode(tvalue((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyt to_unicode#scCs t|tS(N(Rt basestring(R((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyt is_string(s(tpatterntRGBcCsd}|jdkrJdt|d@t|d@t|d@fS|dkryd||||||fStd|dS( sM Convert **r**, **g**, **b** values to a `string`. :param r: red part :param g: green part :param b: blue part :param string mode: ``'RGB | %'`` :rtype: string ========= ============================================================= mode Description ========= ============================================================= ``'RGB'`` returns a rgb-string format: ``'rgb(r, g, b)'`` ``'%'`` returns percent-values as rgb-string format: ``'rgb(r%, g%, b%)'`` ========= ============================================================= cSs:t|}|dkr!d}n|dkr6d}n|S(Niid(tint(R((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytpercentAs      R s rgb(%d,%d,%d)it%srgb(%d%%,%d%%,%d%%)sInvalid mode '%s'N(tupperR t ValueError(trtgtbtmodeR ((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytrgb.s  / #ccsUxN|D]F}t|drHt| rHx!t|D] }|Vq6Wq|VqWdS(s: Flatten nested *values*, returns an `iterator`. t__iter__N(thasattrR t iterflatlist(tvaluestelementtitem((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyRRs   t,cCsLt|r|S|jgt|D]}|dk r#t|^q#SdS(s Concatenate **values** with **sepertator**, `None` values will be excluded. :param values: `iterable` object :returns: `string` N(R tjoinRtNoneR(Rt seperatorR((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytstrlist^s cCsRt|ttfrdStjj|}|r>|jdStd|dS(s Get the `unit` identifier of **coordinate**, if **coordinate** has a valid `unit` identifier appended, else returns `None`. isInvalid format: '%s'N( RR tfloatRR t coordinatetmatchtgroupR(R"tresult((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytget_unitks  cCsst|ttfr%t|dfStjj|}|r_t|jd|jdfStd|dS(s Split coordinate into `` and 'unit` identifier. :returns: <2-tuple> (number, unit-identifier) or (number, None) if no unit-identifier is present or coordinate is an int or float. iisInvalid format: '%s'N( RR R!RR R"R#R$R(R"R%((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytsplit_coordinateys "cCsst|ttfr%t|dfStjj|}|r_t|jd|jdfStd|dS(s Split angle into `` and `` identifier. :returns: <2-tuple> (number, angle-identifier) or (number, None) if no angle-identifier is present or angle is an int or float. iisInvalid format: '%s'N( RR R!RR tangleR#R$R(R(R%((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyt split_angles "stop-leftc Cs|jjd\}}t|d\}}t|d\}}t|d\} } t|d\} } || krtdn|| krtdn|dkr|| d}n8|dkr|| }n|d krtd |n|d kr|| d}n8|d kr4|| }n|d krStd|n|rld||f}n|rd||f}n||fS(s4 Calculate top-left corner of a rectangle. **insert** and **size** must have the same units. :param 2-tuple insert: insert point :param 2-tuple size: (width, height) :param string pos: insert position ``'vert-horiz'`` :return: ``'top-left'`` corner of the rect :rtype: 2-tuple ========== ============================== pos valid values ========== ============================== **vert** ``'top | middle | bottom'`` **horiz** ``'left'|'center'|'right'`` ========== ============================== t-iis0x-coordinate and width has to have the same units1y-coordinate and height has to have the same unittcenterg@trighttlefts!Invalid horizontal position: '%s'tmiddletbottomttopsInvalid vertical position: '%s's%s%s(tlowertsplitR'R( tinserttsizetpostvertthoriztxtxunittytyunittwidthtwunittheightthunit((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytrect_top_left_corners4          tAutoIDcBs>eZdZddZeddZeddZRS(icCs|j|dS(N(t _set_value(tselfR((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyt__init__scCs|dk r||_ndS(N(Rt_nextid(tclsR((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyRBs cCs-|j|d|j}|jd7_|S(Nsid%di(RBRE(RFRtretval((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pytnext_ids  N(t__name__t __module__RERRDt classmethodRBRH(((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyRAs  (t__doc__tsyst version_infotPYTHON3t functoolsRRRRR t svgwrite.dataR RRR R&R'R)R@tobjectRA(((s?/opt/alt/python27/lib/python2.7/site-packages/svgwrite/utils.pyts"    $    2