%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/svgwrite/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyc

�
#8oRc@sedZddlmZddlZddlmZmZddlmZdeefd��YZ	dS(u�
The *Drawing* object is the overall container for all SVG
elements. It provides the methods to store the drawing into a file or a
file-like object. If you want to use stylesheets, the reference links
to this stylesheets were also stored (`add_stylesheet`)
in the *Drawing* object.

set/get SVG attributes::

    element['attribute'] = value
    value = element['attribute']

The Drawing object also includes a defs section, add elements to the defs
section by::

    drawing.defs.add(element)

i����(tunicode_literalsN(tSVGtDefs(tElementFactorytDrawingcBsPeZdZddd�Zd�Zddd�Zd�Zd	�Zd
�ZRS(u� This is the SVG drawing represented by the top level *svg* element.

    A drawing consists of any number of SVG elements contained within the drawing
    element, stored in the *elements* attribute.

    A drawing can range from an empty drawing (i.e., no content inside of the drawing),
    to a very simple drawing containing a single SVG element such as a *rect*,
    to a complex, deeply nested collection of container elements and graphics elements.
    u
noname.svgu100%cKs2tt|�jd||�||_g|_dS(u�
        :param string filename: filesystem filename valid for :func:`open`
        :param 2-tuple size: width, height
        :param keywords extra: additional svg-attributes for the *SVG* object

        Important (and not SVG Attributes) **extra** parameters:

        :param string profile: ``'tiny | full'`` - define the SVG baseProfile
        :param bool debug: switch validation on/off

        tsizeN(tsuperRt__init__tfilenamet_stylesheets(tselfRRtextra((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyR*s	cCsf|j}|j}d|jd<d|jd<d|jd<||jd<||jd<tt|�j�S(	u� Get the XML representation as `ElementTree` object.

        :return: XML `ElementTree` of this object and all its subelements

        uhttp://www.w3.org/2000/svguxmlnsuhttp://www.w3.org/1999/xlinkuxmlns:xlinku!http://www.w3.org/2001/xml-eventsuxmlns:evubaseProfileuversion(tprofiletversiontattribsRRtget_xml(R
RR
((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyR:s		




unouscreencCs |jj||||f�dS(u5 Add a stylesheet reference.

        :param string href: link to stylesheet <URI>
        :param string title: name of stylesheet
        :param string alternate: ``'yes'|'no'``
        :param string media: ``'all | aureal | braille | embossed | handheld | print | projection | screen | tty | tv'``

        N(R	tappend(R
threfttitlet	alternatetmedia((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pytadd_stylesheetJs	cCsO|jd�d}x"|jD]}|j||�qW|j|j��dS(u� Write XML string to **fileobj**.

        :param fileobj: a *file-like* object

        Python 3.x - set encoding at the open command::

            open('filename', 'w', encoding='utf-8')
        u(<?xml version="1.0" encoding="utf-8" ?>
uR<?xml-stylesheet href="%s" type="text/css" title="%s" alternate="%s" media="%s"?>
N(twriteR	ttostring(R
tfileobjtstylesheet_templatet
stylesheet((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyRUs


cCs9tj|jdddd�}|j|�|j�dS(u' Write the XML string to **filename**. tmodeuwtencodinguutf-8N(tiotopenRRtclose(R
R((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pytsaveks
cCs||_|j�dS(u{ Write the XML string to **filename**.

        :param string filename: filesystem filename valid for :func:`open`
        N(RR (R
R((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pytsaveasqs	(u100%u100%(	t__name__t
__module__t__doc__RRRRR R!(((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyR s				(
R$t
__future__RRtsvgwrite.containerRRtsvgwrite.elementfactoryRR(((sA/opt/alt/python27/lib/python2.7/site-packages/svgwrite/drawing.pyt<module>s


Zerion Mini Shell 1.0