| 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/__pycache__/ |
Upload File : |
o
5�a� � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZmZ e� Z
ej�e
p1dd�Zej�e�rAej�de� zddlmZ W n eyT dZY nw d ZG d
d� de�Zedkruedurneej� dS e� �� dS dS )
zh
Bootstrap the inkscape extensions manager setting up the virtualenv
and adding the extensions package.
� N)�get_user_directory)�InkscapeExtension)�CommandNotFound�ProgramRunError�callz./zorg.inkscape.inkman��runzAhttps://media.inkscape.org/static/extensions-manager-fallback.zipc @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dS )� BootstrapTc C s |� d� |j ddd� d S )Nz--tabz --versionzinkscape-extensions-manager)�default)�add_argument)�self�pars� r �=/usr/share/inkscape/extensions/extension-manager-bootstrap.py�
add_arguments0 s
zBootstrap.add_argumentsc C s d S )Nr )r r r r �load_raw4 s zBootstrap.load_rawc C sn t j�t�rtj�dt� n trtj�dt� zddlm} W n t t
fy/ | �d� Y S w |tj� d S )Nr r z+Extension manager installed, please re-run.)
�os�path�isdir�FALLBACK_DIR�sys�insert�
TARGET_DIR�manage_extensionsr �ImportError�ModuleNotFoundError�msg�argv)r �ret�run_existingr r r �save_raw7 s �zBootstrap.save_rawc
C s� d}z t dtdd� W n ty d}Y n ty* } z t�dt|� ��d }~ww |r8| �� r3d S t�d��zt tj �
tdd �d
| jj� W d S tyU t�d�� tyi } z t�dt|� ��d }~ww )
NF�
virtualenv�python3)�pTz:There has been a problem creating the python environment:
z�You must have the python-virtualenv package installed. This should have been included with Inkscape, but in some special cases it might not be. Please install this software externally and try again.�bin�pip�installz8Can't find pip program after environment initialisation!z,Error installing extension manager package:
)
r r r r �inkex�AbortExtension�str�install_fallbackr r �join�options�version)r �fallback�errr r r �effectB s2
����"
��zBootstrap.effectc C s� ddl m} ddl}ddl}d}|�� }z_zB|�t�}|rV|jdkrV|�t �
|j���#}|�� D ]}d|v r8d}| �
|�|�tj�t|�� q0W d � n1 sQw Y W n |ye | �d� Y nw W |�� |S W |�� |S |�� w ) zS
A pre-set zip installer which has been prepared for installation.
r )�NewConnectionErrorNF�� z.inxTzICould not connect to the internet, please check connection and try again!)�urllib3.exceptionsr1 �requests�zipfile�session�get�FALLBACK_URL�status_code�ZipFile�io�BytesIO�content�namelist�
_install_file�readr r r+ r r �close) r r1 r4 r5 �doner6 �remote�archive�filenamer r r r* \ s8
�������
�zBootstrap.install_fallbackc C sl t j�|�}t j�|�st �|� t j�|�s4t|d��}|�|� W d � dS 1 s-w Y dS dS )z+Install the content into the given location�wbN)r r �dirnamer �makedirs�open�write)r r= rE �filedir�fhlr r r r? v s
"��zBootstrap._install_fileN)
�__name__�
__module__�__qualname__� multi_inxr r r r0 r* r? r r r r r - s r �__main__)�__doc__r r; r r'