[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: inkscape.py
File is not writable. Editing disabled.
# Copyright (c) 2018 Manfred Moitzi # License: MIT License # based on work of: # Copyright (c) 2018 Antonio Ospite <ao2@ao2.it> from svgwrite.data.types import SVGAttribute INKSCAPE_NAMESPACE = 'http://www.inkscape.org/namespaces/inkscape' SODIPODI_NAMESPACE = 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' INKSCAPE_ATTRIBUTES = { 'xmlns:inkscape': SVGAttribute('xmlns:inkscape', anim=False, types=[], const=frozenset([INKSCAPE_NAMESPACE])), 'xmlns:sodipodi': SVGAttribute('xmlns:sodipodi', anim=False, types=[], const=frozenset([SODIPODI_NAMESPACE])), 'inkscape:groupmode': SVGAttribute('inkscape:groupmode', anim=False, types=[], const=frozenset(['layer'])), 'inkscape:label': SVGAttribute('inkscape:label', anim=False, types=frozenset(['string']), const=[]), 'sodipodi:insensitive': SVGAttribute('sodipodi:insensitive', anim=False, types=[], const=frozenset(['true', 'false', '0', '1'])) } def _setup_validator(validator): # setup already done? if 'xmlns:inkscape' in validator.attributes: return validator.attributes.update(INKSCAPE_ATTRIBUTES) elements = validator.elements # extend SVG attributes elements['svg'].valid_attributes = \ { 'xmlns:inkscape', 'xmlns:sodipodi', } | elements['svg'].valid_attributes # extend group attributes elements['g'].valid_attributes = \ { 'inkscape:groupmode', 'inkscape:label', 'sodipodi:insensitive', } | elements['g'].valid_attributes GROUP_MODE = 'inkscape:groupmode' LABEL = 'inkscape:label' INSENSITIVE = 'sodipodi:insensitive' class Inkscape(object): """ Extension to support SOME Inkscape features. """ def __init__(self, drawing): self.svg = drawing _setup_validator(drawing.validator) drawing['xmlns:inkscape'] = INKSCAPE_NAMESPACE drawing['xmlns:sodipodi'] = SODIPODI_NAMESPACE def layer(self, label=None, locked=False, **kwargs): """ Create new Inkscape layer. Args: label: layer name as string locked: when set to True, make objects at this layer unselectable """ new_layer = self.svg.g(**kwargs) new_layer[GROUP_MODE] = 'layer' if label is not None: new_layer[LABEL] = label if locked: new_layer[INSENSITIVE] = 1 return new_layer
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.07 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A