403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/inkscape/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/inkscape/extensions/__pycache__/ungroup_deep.cpython-310.pyc
o

0�a�@shdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZGdd�dej�Z
edkr2e
���dSdS)z�
see #inkscape on Freenode and
https://github.com/nikitakit/svg2sif/blob/master/synfig_prepare.py#L370
for an example how to do the transform of parent to children.
�N)
�Group�Anchor�Switch�	NamedView�Defs�Metadata�
ForeignObject�ClipPath�Use�SvgDocumentElementc@sHeZdZdd�Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�UngroupDeepcCs:|jdtddd�|jdtddd�|jdtdd	d�dS)
Nz--startdepthrzstarting depth for ungrouping)�type�default�helpz
--maxdepthi��zmaximum ungrouping depthz--keepdepthz'levels of ungrouping to leave untouched)�add_argument�int)�self�pars�r�./usr/share/inkscape/extensions/ungroup_deep.py�
add_argumentss
�
�

�zUngroupDeep.add_argumentsc	Cs�|j}i}dg}|D]}||��vr||||<||=q
|��}|�|�|}ddg}|D]}|�|�r?|�|�||<|j|=q-t|ttt	t
f�r^|sYd|��vrW|jd=dSdS||_dS|�|�||_dS)z�Propagate style and transform to remove inheritance
        Originally from
        https://github.com/nikitakit/svg2sif/blob/master/synfig_prepare.py#L370
        �filter�fill�stroke�styleN)r�keys�copy�update�get�attrib�
isinstancerrrr)	�noder�
this_style�remaining_style�non_propagated�key�parent_style_copy�
style_attribsrrrr�_merge_styles2�

��


zUngroupDeep._merge_stylecCs�|r^|dkr`|j}|r>|jj�tdd��}|�d�|j�|dd��}|��D]}|�t�	|dd��q(d|�
d	�d
}|�
d�}|rV|j�|dd��}|�
d�}|sE|�d|�dSdSdS)N�none�userSpaceOnUse)�
clipPathUnits�clipPath����rzurl(#�id�)�	clip-path)�	transform�svg�defs�addr	�
set_random_id�getElementById�iterchildrenr
�newr�set)rr!�clippathurl�node_transform�new_clippath�clippath�child�node_clippathurlrrr�_merge_clippathGs 


��zUngroupDeep._merge_clippathcCs�|��}t|��|�}|j}|j}|�d�}tt|��D]!}||j|_|�d�dur1|�||�|�||�|�	||�q|�
|�dS)Nr1r)�	getparent�list�indexrr2r�reversedr(rA�insert�remove)rr!�node_parent�
node_index�
node_styler<r@r?rrr�_ungroupas
zUngroupDeep._ungroupcCsJt|t�r#|��dur#||jjkr#|jj|kr |jjkr#dSdSdS)NTF)r rrB�options�	keepdepth�
startdepth�maxdepth)rr!�depth�heightrrr�
_want_ungroupss
��zUngroupDeep._want_ungroupc	Cs�|dddidd�g}|r}|d}|d}|d}|d}|durQt|ttttf�r-|��t|t�r6t|�s;d|d<n>|d7}|��D]}|�	|||dd��qCn(|�
|||�r]|�|�|d7}|d	}|d}|dusq||kru||d<|��|sdSdS)
NrrQ)r!rP�prevrQr.r!rP�)r!rSrPrQrS)r rrrr�poprrCr8�appendrRrK)	rr!�q�currentrPrQr?�previous�prev_heightrrr�
_deep_ungroup|s<�

��
�zUngroupDeep._deep_ungroupcCsF|jjr|jj��D]}|�|�q
dS|j��D]}|�|�qdS)N)r3�selected�valuesr[�document�getroot)rr!rrr�effect�s��zUngroupDeep.effectN)�__name__�
__module__�__qualname__r�staticmethodr(rArKrRr[r`rrrrrs
.	1r�__main__)�__doc__�inkexrrrrrrrr	r
r�EffectExtensionrra�runrrrr�<module>s0(�

Youez - 2016 - github.com/yon3zu
LinuXploit