Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/svgwrite
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
svgwrite
/
📁
..
📄
__init__.py
(2.39 KB)
📄
__init__.pyc
(3.15 KB)
📄
__init__.pyo
(3.15 KB)
📄
animate.py
(6.47 KB)
📄
animate.pyc
(7.61 KB)
📄
animate.pyo
(7.61 KB)
📄
base.py
(7.88 KB)
📄
base.pyc
(9.78 KB)
📄
base.pyo
(9.78 KB)
📄
container.py
(8.81 KB)
📄
container.pyc
(10.69 KB)
📄
container.pyo
(10.69 KB)
📁
data
📄
drawing.py
(4.24 KB)
📄
drawing.pyc
(4.82 KB)
📄
drawing.pyo
(4.82 KB)
📄
elementfactory.py
(2.15 KB)
📄
elementfactory.pyc
(2.89 KB)
📄
elementfactory.pyo
(2.89 KB)
📄
etree.py
(1.33 KB)
📄
etree.pyc
(1.27 KB)
📄
etree.pyo
(1.27 KB)
📄
filters.py
(7.71 KB)
📄
filters.pyc
(13.33 KB)
📄
filters.pyo
(13.33 KB)
📄
gradients.py
(4.61 KB)
📄
gradients.pyc
(5.89 KB)
📄
gradients.pyo
(5.89 KB)
📄
image.py
(2.39 KB)
📄
image.pyc
(2.95 KB)
📄
image.pyo
(2.95 KB)
📄
masking.py
(1.78 KB)
📄
masking.pyc
(2.24 KB)
📄
masking.pyo
(2.24 KB)
📄
mixins.py
(10.2 KB)
📄
mixins.pyc
(12.74 KB)
📄
mixins.pyo
(12.74 KB)
📄
params.py
(1.84 KB)
📄
params.pyc
(2.73 KB)
📄
params.pyo
(2.73 KB)
📄
path.py
(3.51 KB)
📄
path.pyc
(3.66 KB)
📄
path.pyo
(3.66 KB)
📄
pattern.py
(1.9 KB)
📄
pattern.pyc
(2.29 KB)
📄
pattern.pyo
(2.29 KB)
📄
shapes.py
(5.72 KB)
📄
shapes.pyc
(6.6 KB)
📄
shapes.pyo
(6.6 KB)
📄
text.py
(7.94 KB)
📄
text.pyc
(9.5 KB)
📄
text.pyo
(9.5 KB)
📄
utils.py
(6.07 KB)
📄
utils.pyc
(7.37 KB)
📄
utils.pyo
(7.37 KB)
📄
validator2.py
(5.93 KB)
📄
validator2.pyc
(6.95 KB)
📄
validator2.pyo
(6.95 KB)
Editing: image.py
#coding:utf-8 # Author: mozman --<mozman@gmx.at> # Purpose: svg image element # Created: 09.10.2010 # Copyright (C) 2010, Manfred Moitzi # License: MIT License from svgwrite.base import BaseElement from svgwrite.mixins import Transform, _vert, _horiz, Clipping class Image(BaseElement, Transform, Clipping): """ The **image** element indicates that the contents of a complete file are to be rendered into a given rectangle within the current user coordinate system. The **image** element can refer to raster image files such as PNG or JPEG or to files with MIME type of "image/svg+xml". """ elementname = 'image' def __init__(self, href, insert=None, size=None, **extra): """ :param string href: hyperlink to the image resource :param 2-tuple insert: insert point (**x**, **y**) :param 2-tuple size: (**width**, **height**) :param dict attribs: additional SVG attributes :param extra: additional SVG attributs as keyword-arguments """ super(Image, self).__init__(**extra) self['xlink:href'] = href if insert: self['x'] = insert[0] self['y'] = insert[1] if size: self['width'] = size[0] self['height'] = size[1] def stretch(self): """ Stretch viewBox in x and y direction to fill viewport, does not preserve aspect ratio. """ self['preserveAspectRatio'] = 'none' def fit(self, horiz="center", vert="middle", scale="meet"): """ 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 ============= =========== """ if self.debug and scale not in ('meet', 'slice'): raise ValueError("Invalid scale parameter '%s'" % scale) self.attribs['preserveAspectRatio'] = "%s%s %s" % (_horiz[horiz],_vert[vert], scale)
Upload File
Create Folder