/
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
svgwrite
/
/opt/alt/python27/lib/python2.7/site-packages/svgwrite
mkdir
upload
Name
Size
Mode
Actions
data/
-
0755
rm
animate.py
6630
0644
edit
dl
rm
animate.pyc
7791
0644
edit
dl
rm
animate.pyo
7791
0644
edit
dl
rm
base.py
8064
0644
edit
dl
rm
base.pyc
10016
0644
edit
dl
rm
base.pyo
10016
0644
edit
dl
rm
container.py
9022
0644
edit
dl
rm
container.pyc
10945
0644
edit
dl
rm
container.pyo
10945
0644
edit
dl
rm
drawing.py
4344
0644
edit
dl
rm
drawing.pyc
4940
0644
edit
dl
rm
drawing.pyo
4940
0644
edit
dl
rm
elementfactory.py
2199
0644
edit
dl
rm
elementfactory.pyc
2964
0644
edit
dl
rm
elementfactory.pyo
2964
0644
edit
dl
rm
etree.py
1361
0644
edit
dl
rm
etree.pyc
1300
0644
edit
dl
rm
etree.pyo
1300
0644
edit
dl
rm
filters.py
7899
0644
edit
dl
rm
filters.pyc
13655
0644
edit
dl
rm
filters.pyo
13655
0644
edit
dl
rm
gradients.py
4719
0644
edit
dl
rm
gradients.pyc
6030
0644
edit
dl
rm
gradients.pyo
6030
0644
edit
dl
rm
image.py
2445
0644
edit
dl
rm
image.pyc
3021
0644
edit
dl
rm
image.pyo
3021
0644
edit
dl
rm
masking.py
1827
0644
edit
dl
rm
masking.pyc
2293
0644
edit
dl
rm
masking.pyo
2293
0644
edit
dl
rm
mixins.py
10446
0644
edit
dl
rm
mixins.pyc
13041
0644
edit
dl
rm
mixins.pyo
13041
0644
edit
dl
rm
params.py
1880
0644
edit
dl
rm
params.pyc
2791
0644
edit
dl
rm
params.pyo
2791
0644
edit
dl
rm
path.py
3591
0644
edit
dl
rm
path.pyc
3743
0644
edit
dl
rm
path.pyo
3743
0644
edit
dl
rm
pattern.py
1950
0644
edit
dl
rm
pattern.pyc
2347
0644
edit
dl
rm
pattern.pyo
2347
0644
edit
dl
rm
shapes.py
5858
0644
edit
dl
rm
shapes.pyc
6756
0644
edit
dl
rm
shapes.pyo
6756
0644
edit
dl
rm
text.py
8129
0644
edit
dl
rm
text.pyc
9729
0644
edit
dl
rm
text.pyo
9729
0644
edit
dl
rm
utils.py
6218
0644
edit
dl
rm
utils.pyc
7544
0644
edit
dl
rm
utils.pyo
7544
0644
edit
dl
rm
validator2.py
6073
0644
edit
dl
rm
validator2.pyc
7112
0644
edit
dl
rm
validator2.pyo
7112
0644
edit
dl
rm
__init__.py
2449
0644
edit
dl
rm
__init__.pyc
3226
0644
edit
dl
rm
__init__.pyo
3226
0644
edit
dl
rm
Edit:
/opt/alt/python27/lib/python2.7/site-packages/svgwrite/path.py
(3591B)
#coding:utf-8 # Author: mozman # Purpose: svg path element # Created: 08.09.2010 # # Copyright (C) 2010 Manfred Moitzi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from svgwrite.base import BaseElement from svgwrite.utils import strlist from svgwrite.mixins import Presentation, Markers, Transform from svgwrite.utils import to_unicode class Path(BaseElement, Transform, Presentation, Markers): """ The <path> element represent the outline of a shape which can be filled, stroked, used as a clipping path, or any combination of the three. """ elementname = 'path' def __init__(self, d=None, **extra): """ :param `iterable` d: *coordinates*, *length* and *commands* :param dict attribs: additional SVG attributes :param extra: additional SVG attributs as keyword-arguments """ super(Path, self).__init__(**extra) self.commands = [] self.push(d) if self.debug: self.validator.check_all_svg_attribute_values(self.elementname, self.attribs) def push(self, *elements): """ Push commands and coordinats onto the command stack. :param `iterable` elements: *coordinates*, *length* and *commands* """ self.commands.extend(elements) @staticmethod def arc_flags(large_arc=True, angle_dir='+'): large_arc_flag = int(large_arc) sweep_flag = {'+': 1, '-': 0}[angle_dir] return "%d,%d" % (large_arc_flag, sweep_flag) def push_arc(self, target, rotation, r, large_arc=True, angle_dir='+', absolute=False): """ Helper function for the elliptical-arc command. see SVG-Reference: http://www.w3.org/TR/SVG11/paths.html#PathData :param 2-tuple target: *coordinate* of the arc end point :param number rotation: x-axis-rotation of the ellipse in degrees :param number|2-tuple r: radii rx, ry when r is a *2-tuple* or rx=ry=r if r is a *number* :param bool large_arc: draw the arc sweep of greater than or equal to 180 degrees (**large-arc-flag**) :param angle_dir: ``'+|-'`` ``'+'`` means the arc will be drawn in a "positive-angle" direction (**sweep-flag**) :param bool absolute: indicates that target *coordinates* are absolute else they are relative to the current point """ self.push({ True: 'A', False: 'a' }[absolute]) if isinstance(r, (float, int)): self.push(r, r) else: self.push(r) self.push(rotation) self.push(Path.arc_flags(large_arc, angle_dir)) self.push(target) def get_xml(self): """ Get the XML representation as `ElementTree` object. :return: XML `ElementTree` of this object and all its subelements """ self.attribs['d'] = to_unicode(strlist(self.commands, ' ')) return super(Path, self).get_xml()
Save
cmd:
run