404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.53.214: ~ $
#!/usr/bin/env python
#coding:utf-8
# Author:  mozman
# Purpose: svgwrite package parameter
# Created: 10.09.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License

from svgwrite.validator2 import get_validator


class Parameter(object):
    """
    .. attribute:: Parameter.debug

       *read/write* property

       * *True* : debug mode is on, all SVG attributes are checked if valid
         in the element context. Also the included SVG subelements will be
         checked if they are valid for the parent SVG element.

       * *False*: no validation checks will be done, but program execution is
         faster.

    .. attribute:: Parameter.profile

       *read/write* property

       name of the SVG profile, valid profiles are: ``'full|basic|tiny'``
    """
    __slots__ = ['_debug', 'validator', '_profile']

    def __init__(self, debug=True, profile='full'):
        self._debug = debug
        self.profile = profile

    def _init_validator(self):
        self.validator = get_validator(self.profile,  self.debug)

    @property
    def debug(self):
        return self._debug

    @debug.setter
    def debug(self, debug):
        self._debug = debug
        self._init_validator()

    def get_version(self):
        if self._profile == 'tiny':
            return '1.2'
        else:
            return '1.1'

    @property
    def profile(self):
        return self._profile

    @profile.setter
    def profile(self, profile):
        """
        :param string profile: name of the SVG profile, valid profiles are:
        ``'full|basic|tiny'``

        """
        profile = profile.lower()
        if profile in ('tiny', 'basic', 'full'):
            self._profile = profile
            self._init_validator()
        else:
            raise ValueError("'%s' is not a valid profile." % profile)

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
data Folder 0755
extensions Folder 0755
__init__.py File 2.45 KB 0644
animate.py File 6.51 KB 0644
base.py File 8.42 KB 0644
container.py File 10.49 KB 0644
drawing.py File 5.17 KB 0644
elementfactory.py File 2.24 KB 0644
etree.py File 1.33 KB 0644
filters.py File 7.81 KB 0644
gradients.py File 4.59 KB 0644
image.py File 2.43 KB 0644
masking.py File 1.81 KB 0644
mixins.py File 10.5 KB 0644
params.py File 1.86 KB 0644
path.py File 2.78 KB 0644
pattern.py File 1.93 KB 0644
shapes.py File 5.19 KB 0644
solidcolor.py File 1.69 KB 0644
text.py File 7.95 KB 0644
utils.py File 7.25 KB 0644
validator2.py File 6.06 KB 0644
version.py File 1.09 KB 0644