OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
svgwrite
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:36:16 AM
rwxr-xr-x
📄
__init__.py
2.33 KB
11/14/2023 02:35:25 PM
rw-r--r--
📁
__pycache__
-
02/16/2024 09:01:46 PM
rwxr-xr-x
📄
animate.py
6.31 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
base.py
8.01 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
container.py
10.15 KB
11/14/2023 02:35:25 PM
rw-r--r--
📁
data
-
02/16/2024 09:01:46 PM
rwxr-xr-x
📄
drawing.py
5.05 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
elementfactory.py
2.15 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
etree.py
1.26 KB
11/14/2023 02:35:25 PM
rw-r--r--
📁
extensions
-
02/16/2024 09:01:46 PM
rwxr-xr-x
📄
filters.py
7.53 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
gradients.py
4.5 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
image.py
2.35 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
masking.py
1.74 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
mixins.py
10.18 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
params.py
1.77 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
path.py
2.75 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
pattern.py
1.9 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
shapes.py
5.61 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
solidcolor.py
1.63 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
text.py
7.74 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
utils.py
7.58 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
validator2.py
5.87 KB
11/14/2023 02:35:25 PM
rw-r--r--
📄
version.py
1.06 KB
11/14/2023 02:35:25 PM
rw-r--r--
Editing: path.py
Close
#coding:utf-8 # Author: mozman # Purpose: svg path element # Created: 08.09.2010 # License: MIT License 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 coordinates 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()