%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/svgwrite/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyo

�
oQ+Pc@s�ddlmZddlmZidd6dd6dd6Zid	d
6dd6d
d6Zdefd��YZdefd��YZdefd��YZdefd��YZ	defd��YZ
defd��YZdefd��YZdS(i����(tstrlist(t	is_stringtxMidtcentertxMintlefttxMaxtrighttYMidtmiddletYMinttoptYMaxtbottomtViewBoxcBs>eZdZddddd�Zd�Zdddd�ZRS(s� The **ViewBox** mixin provides the ability to specify that a
    given set of graphics stretch to fit a particular container element.

    The value of the **viewBox** attribute is a list of four numbers
    **min-x**, **min-y**, **width** and **height**, separated by whitespace
    and/or a comma, which specify a rectangle in **user space** which should
    be mapped to the bounds of the viewport established by the given element,
    taking into account attribute **preserveAspectRatio**.

    icCs t||||g�|d<dS(s~ Specify a rectangle in **user space** (no units allowed) which
        should be mapped to the bounds of the viewport established by the
        given element.

        :param number minx: left border of the viewBox
        :param number miny: top border of the viewBox
        :param number width: width of the viewBox
        :param number height: height of the viewBox

        tviewBoxN(R(tselftminxtminytwidththeight((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytviewboxscCsd|d<dS(sh Stretch viewBox in x and y direction to fill viewport, does not
        preserve aspect ratio.
        tnonetpreserveAspectRatioN((R((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytstretch&sRR	tmeetcCsK|jr(|dkr(td|��ndt|t||f|d<dS(s Set the **preserveAspectRatio** attribute.

        :param string horiz: horizontal alignment ``'left | center | right'``
        :param string vert: vertical alignment ``'top | middle | bottom'``
        :param string scale: scale method ``'meet | slice'``

        ============= =======================================================
        Scale methods Description
        ============= =======================================================
        ``'meet'``    preserve aspect ration and zoom to limits of viewBox
        ``'slice'``   preserve aspect ration and viewBox touch viewport on
                      all bounds, viewBox will extend beyond the bounds of
                      the viewport
        ============= =======================================================

        RtslicesInvalid scale parameter '%s's%s%s %sRN(Rsslice(tdebugt
ValueErrort_horizt_vert(Rthoriztverttscale((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytfit,s(t__name__t
__module__t__doc__RRR"(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRs

	t	TransformcBs\eZdZdZd	d�Zd	d�Zd	d�Zd�Zd�Z	d�Z
d�ZRS(
s| The **Transform** mixin operates on the **transform** attribute.
    The value of the **transform** attribute is a `<transform-list>`, which
    is defined as a list of transform definitions, which are applied in the
    order provided. The individual transform definitions are separated by
    whitespace and/or a comma. All coordinates are **user
    space coordinates**.

    t	transformcCs!|jdt||g��dS(s�
        Specifies a translation by **tx** and **ty**. If **ty** is not provided,
        it is assumed to be zero.

        :param number tx: user coordinate - no units allowed
        :param number ty: user coordinate - no units allowed
        s
translate(%s)N(t_add_transformationR(Rttxtty((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyt	translateKscCs!|jdt||g��dS(sc
        Specifies a rotation by **angle** degrees about a given point.
        If optional parameter **center** are not supplied, the rotate is
        about the origin of the current user coordinate system.

        :param number angle: rotate-angle in degrees
        :param 2-tuple center: rotate-center as user coordinate - no units allowed

        s
rotate(%s)N(R(R(RtangleR((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytrotateUs
cCs!|jdt||g��dS(s
        Specifies a scale operation by **sx** and **sy**. If **sy** is not
        provided, it is assumed to be equal to **sx**.

        :param number sx: scalar factor x-axis, no units allowed
        :param number sy: scalar factor y-axis, no units allowed

        s	scale(%s)N(R(R(Rtsxtsy((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyR!as	cCs|jd|�dS(s� Specifies a skew transformation along the x-axis.

        :param number angle: skew-angle in degrees, no units allowed

        s	skewX(%s)N(R((RR,((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytskewXlscCs|jd|�dS(s� Specifies a skew transformation along the y-axis.

        :param number angle: skew-angle in degrees, no units allowed

        s	skewY(%s)N(R((RR,((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytskewYtsc	Cs-|jdt||||||g��dS(Ns
matrix(%s)(R(R(Rtatbtctdtetf((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytmatrix|scCs9|jj|jd�}d||fj�||j<dS(Nts%s %s(tattribstgett
transformnametstrip(Rt
new_transformt
old_transform((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyR(sN(R#R$R%R<tNoneR+R-R!R0R1R8R((((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyR&As
			tXLinkcBs5eZdZd�Zddddd�Zd�ZRS(s
 XLink mixin cCs||_|j�dS(s

        Create a reference to **element**.

        :param element: if element is a `string` its the **id** name of the
          referenced element, if element is a **BaseElement** class the **id**
          SVG Attribute is used to create the reference.

        N(threft	update_id(Rtelement((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytset_href�s		cCsh|dk	r||d<n|dk	r2||d<n|dk	rK||d<n|dk	rd||d<ndS(sA Set XLink attributes (for `href` use :meth:`set_href`).
        s
xlink:roles
xlink:arcrolesxlink:titles
xlink:showN(R@(Rttitletshowtroletarcrole((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyt	set_xlink�s


cCsNt|d�sdSt|j�r.|j}n|jj�}||jd<dS(NRBs
xlink:href(thasattrRRBtget_iriR:(Rtidstr((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRC�sN(R#R$R%RER@RJRC(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRA�s	tPresentationcBsJeZdZdddd�Zddddddd�Zddd�ZRS(s8
    Helper methods to set presentation attributes.
    cCs\|r2t|�r||d<q2|j�|d<n|rE||d<n|rX||d<n|S(sS
        Set SVG Properties **fill**, **fill-rule** and **fill-opacity**.

        tfills	fill-rulesfill-opacity(Rtget_paint_server(Rtcolortruletopacity((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRO�s


cCs�|r2t|�r||d<q2|j�|d<n|rE||d<n|rX||d<n|rk||d<n|r~||d<n|r�||d<n|S(s�
        Set SVG Properties **stroke**, **stroke-width**, **stroke-opacity**,
        **stroke-linecap** and **stroke-miterlimit**.

        tstrokesstroke-widthsstroke-opacitysstroke-linecapsstroke-linejoinsstroke-miterlimit(RRP(RRQRRStlinecaptlinejoint
miterlimit((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRT�s





cCs3|rt|d�|d<n|r/||d<n|S(st
        Set SVG Properties **stroke-dashoffset** and **stroke-dasharray**.

        Where *dasharray* specify the lengths of alternating dashes and gaps as
        <list> of <int> or <float> values or a <string> of comma and/or white
        space separated <lengths> or <percentages>. (e.g. as <list> dasharray=[1, 0.5]
        or as <string> dasharray='1 0.5')
        t sstroke-dasharraysstroke-dashoffset(R(Rt	dasharraytoffset((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRY�s
	
N(R#R$R%R@RORTRY(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRN�s
t
MediaGroupcBseZdZddd�ZRS(s8
    Helper methods to set media group attributes.

    cCs*|r||d<n|r&||d<n|S(sV
        Set SVG Properties **viewport-fill** and **viewport-fill-opacity**.

        s
viewport-fillsviewport-fill-opacity((RRQRS((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyt
viewport_fill�s


N(R#R$R%R@R\(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyR[�stMarkerscBseZdZd�ZRS(s3
    Helper methods to set marker attributes.

    cCs�d�}t|�r(||�|d<nmyC|\}}}||�|d<||�|d<||�|d<Wn'ttfk
r�||�|d<nXdS(s�
        Set markers for line elements (line, polygon, polyline, path) to
        values specified by  `markers`.

        * if `markers` is a 3-tuple:

          * attribute 'marker-start' = markers[0]
          * attribute 'marker-mid' = markers[1]
          * attribute 'marker-end' = markers[2]

        * `markers` is a `string` or a `Marker` class:

          * attribute 'marker' = `FuncIRI` of markers

        cSs$t|�rd|Sd|dSdS(Nsurl(%s)surl(#%s)tid(R(tvalue((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytget_funciristmarkersmarker-starts
marker-mids
marker-endN(Rt	TypeErrortKeyError(RtmarkersR`tmarkerstartt	markermidt	markerend((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pytset_markers�s	(R#R$R%Rh(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyR]�stClippingcBseZddddd�ZRS(tautocCsd||||f|d<dS(s-
        Set SVG Property **clip**.

        srect(%s,%s,%s,%s)tclipN((RRRR
R((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyt	clip_rects(R#R$Rl(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyRisN(
tsvgwrite.utilsRRRRtobjectRR&RARNR[R]Ri(((s@/opt/alt/python27/lib/python2.7/site-packages/svgwrite/mixins.pyt<module>s3B#<(

Zerion Mini Shell 1.0