| 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 : |
o
5�ac � @ s~ d Z ddlZddlZddlmZmZmZ ed�\ZZ ed�\Z
ZZdZ
zddlmZ W n ey4 Y nw G dd � 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^ e Zd ZdZdZdZdZdd� Zdd� Zd d
� Z ddd
�Z
dd� Zdd� Zdd� Z
dd� ZdS )�Barcodez.Provide a base class for all barcode renderers� � Nc C s t j�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.errorc C s t d��)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)r r r r r �encode1 s zBarcode.encodec C s� |pi }|� dd �| _g | _g | _t|� dd��| _t|� dd��| _|� dd �| _|� dd�| _|� d| j �| _
|� d t�| _| jrLt
| j�d
��| _| jsStd��d S )N�document�xr �yr �scale� �height�text_posz//@idz No string specified for barcode.)�getr � known_ids�_extra�int�pos_x�pos_yr r �default_heightr �TEXT_POS_BOTTOM�pos_text�list�xpath�
ValueError)r �paramr r r �__init__8 s �zBarcode.__init__�elementc C s: d}|| j v r|d7 }d�|�}|| j v s| j �|� |S )z%Get the next useful id (and claim it)r r zbarcode{:d})r! r �append)r r �indexr r r �get_idK s
�zBarcode.get_idc K sH ddl m} | j|d<